Skip to content

Commit

Permalink
Remove redundant calls to String.toString()
Browse files Browse the repository at this point in the history
  • Loading branch information
jbduncan authored and eaftan committed Jul 6, 2017
1 parent 91f625c commit 9aca2c8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
.idea/dataSources.ids
.idea/codeStyleSettings.xml
.idea/compiler.xml
.idea/encodings.xml
.idea/modules.xml
.idea/uiDesigner.xml
.idea/libraries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState
}

private Fix replaceMethodName(MethodInvocationTree tree, VisitorState state, String newName) {
String source = state.getSourceForNode((JCTree) tree.getMethodSelect()).toString();
String source = state.getSourceForNode((JCTree) tree.getMethodSelect());
int idx = source.lastIndexOf("contains");
String replacement =
source.substring(0, idx) + newName + source.substring(idx + "contains".length());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ public boolean processLine(String line) throws IOException {
.put("title", pattern.name)
.put("summary", pattern.summary)
.put("layout", "bugpattern")
.put("category", pattern.category.toString())
.put("category", pattern.category)
.put("severity", pattern.severity.toString())
.build();
DumperOptions options = new DumperOptions();
Expand Down

0 comments on commit 9aca2c8

Please sign in to comment.