Skip to content

Commit

Permalink
Post-rebase cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan202 committed Apr 7, 2023
1 parent af12e86 commit 485594e
Showing 1 changed file with 1 addition and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import static com.google.errorprone.matchers.Matchers.not;
import static com.google.errorprone.matchers.Matchers.staticMethod;
import static com.google.errorprone.matchers.Matchers.toType;
import static java.util.stream.Collectors.joining;
import static tech.picnic.errorprone.bugpatterns.util.Documentation.BUG_PATTERNS_BASE_URL;

import com.google.auto.service.AutoService;
Expand Down Expand Up @@ -73,7 +72,7 @@ public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState
fix.merge(
invocation.getArguments().isEmpty()
? SuggestedFixes.removeElement(arg, tree.getArguments(), state)
: unwrapMethodInvocation(invocation, state));
: SourceCode.unwrapMethodInvocation(invocation, state));
}
}

Expand All @@ -84,16 +83,6 @@ public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState
return Description.NO_MATCH;
}

// XXX: Test this code with comments.
private static SuggestedFix unwrapMethodInvocation(
MethodInvocationTree tree, VisitorState state) {
return SuggestedFix.replace(
tree,
tree.getArguments().stream()
.map(arg -> SourceCode.treeToString(arg, state))
.collect(joining(", ")));
}

private static Matcher<MethodInvocationTree> hasArgumentOfType(Supplier<Type> type) {
return (tree, state) ->
tree.getArguments().stream()
Expand Down

0 comments on commit 485594e

Please sign in to comment.