Skip to content

Commit

Permalink
refactor: refactor bad smell UnnecessaryToStringCall (#186)
Browse files Browse the repository at this point in the history
* Refactor bad smells:
- 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 May 17, 2023
1 parent 57edc03 commit d5d3bd7
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -262,14 +262,13 @@ private ClazzpathUnit addDependencyToClasspath(Clazzpath cp, Artifact dependency
log.warn(dependency.getFile()
+ " could not be unpacked/read for minimization; dependency is probably malformed.");
IOException ioe = new IOException(
"Dependency " + dependency.toString() + " in file " + dependency.getFile()
"Dependency " + dependency + " in file " + dependency.getFile()
+ " could not be unpacked. File is probably corrupt",
e);
throw ioe;
} catch (ArrayIndexOutOfBoundsException | IllegalArgumentException e) {
// trap ArrayIndexOutOfBoundsExceptions caused by malformed dependency classes (MSHADE-107)
log.warn(dependency.toString()
+ " could not be analyzed for minimization; dependency is probably malformed.");
log.warn(dependency + " could not be analyzed for minimization; dependency is probably malformed.");
}

return clazzpathUnit;
Expand Down

0 comments on commit d5d3bd7

Please sign in to comment.