Skip to content

[TOREVIEW] Pozniakoff_Vallon#35

Open
pozniako16 wants to merge 47 commits into
SoftEng-HEIGVD:masterfrom
pozniako16:lab1
Open

[TOREVIEW] Pozniakoff_Vallon#35
pozniako16 wants to merge 47 commits into
SoftEng-HEIGVD:masterfrom
pozniako16:lab1

Conversation

@pozniako16

Copy link
Copy Markdown

No description provided.

pozniako16 and others added 30 commits March 5, 2021 15:22
…-HEIGVD-Teaching-HEIGVD-RES-2021-Labo-Java-IO into feat/filters
fix visitor, now pass the tests
…-HEIGVD-Teaching-HEIGVD-RES-2021-Labo-Java-IO into feat/FileNumberingFilterWriter
…terWriter

Revert "Feat/file numbering filter writer"
Revert "fix visitor, now pass the tests"
@pozniako16 pozniako16 changed the title [WIP] initial commit (test) [WIP] Pozniakoff_Vallon Mar 17, 2021
@pozniako16 pozniako16 changed the title [WIP] Pozniakoff_Vallon [TOREVIEW] Pozniakoff_Vallon Mar 19, 2021
*/
void storeQuote(Quote quote, String filename) throws IOException {
throw new UnsupportedOperationException("The student has not implemented this method yet.");
String tmp = new String();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I detect that this code is problematic. According to the Performance (PERFORMANCE), Dm: Method invokes inefficient new String() constructor (DM_STRING_VOID_CTOR).
Creating a new java.lang.String object using the no-argument constructor wastes memory because the object so created will be functionally indistinguishable from the empty string constant "".  Java guarantees that identical string constants will be represented by the same String object.  Therefore, you should just use the empty string constant directly.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it, the string is now initialized with empty string

@pozniako16

Copy link
Copy Markdown
Author

Please review again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants