Skip to content

Commit

Permalink
Refactor bad smells:
Browse files Browse the repository at this point in the history
- UnnecessaryToStringCall
The toString() method is not needed in cases the underlying method handles the conversion. Also calling toString() on a String is redundant. Removing them simplifies the code.
  • Loading branch information
MartinWitt committed Jan 6, 2023
1 parent cca2ef2 commit 65c47eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public void report(final PrintStream out) {
sb.append(each + " ");
i++;
if ((i % 4) == 0) {
out.println("> " + sb.toString());
out.println("> " + sb );
sb = new StringBuilder();
}
}
out.println("> " + sb.toString());
out.println("> " + sb );
}

public String getMutatorName() {
Expand Down
2 changes: 1 addition & 1 deletion pitest/src/main/java/org/pitest/util/Log.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public String format(final LogRecord record) {
if (throwable != null) {
final StringWriter sink = new StringWriter();
throwable.printStackTrace(new PrintWriter(sink, true));
buf.append(sink.toString());
buf.append(sink);
}

return buf.toString();
Expand Down

0 comments on commit 65c47eb

Please sign in to comment.