Skip to content

Commit

Permalink
return switch conversion
Browse files Browse the repository at this point in the history
FUTURE_COPYBARA_INTEGRATE_REVIEW=#3690 from msridhar:make-memoizeconstantvisitorstatelookups-suppressible 0adb67b
PiperOrigin-RevId: 496418664
  • Loading branch information
java-team-github-bot authored and Error Prone Team committed Jan 5, 2023
1 parent bb2563e commit 56744a3
Show file tree
Hide file tree
Showing 4 changed files with 1,430 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
import com.sun.source.tree.CompilationUnitTree;
import com.sun.source.tree.ExpressionTree;
import com.sun.source.tree.MethodInvocationTree;
import com.sun.source.util.TreeScanner;
import com.sun.tools.javac.code.Symbol.MethodSymbol;
import com.sun.tools.javac.code.Symbol.TypeSymbol;
import com.sun.tools.javac.tree.JCTree.JCFieldAccess;
Expand Down Expand Up @@ -157,9 +156,9 @@ private static final class CallSite {
}
}

private static ImmutableList<CallSite> findConstantLookups(ClassTree tree, VisitorState state) {
private ImmutableList<CallSite> findConstantLookups(ClassTree tree, VisitorState state) {
ImmutableList.Builder<CallSite> result = ImmutableList.builder();
new TreeScanner<Void, Void>() {
new SuppressibleTreePathScanner<Void, Void>(state) {
@Override
public Void visitMethodInvocation(MethodInvocationTree tree, Void unused) {
if (CONSTANT_LOOKUP.matches(tree, state)) {
Expand All @@ -186,7 +185,7 @@ private void handleConstantLookup(MethodInvocationTree tree) {
}
}
}
}.scan(tree, null);
}.scan(state.getPath(), null);
return result.build();
}

Expand Down
Loading

0 comments on commit 56744a3

Please sign in to comment.