From 394867693fa70968ba697c4ea8d4fc8f28e800c0 Mon Sep 17 00:00:00 2001 From: ghm Date: Wed, 24 Jan 2024 05:36:36 -0800 Subject: [PATCH] Resolve a couple of lingering @ResultIgnorabilityUnspecified in EP. PiperOrigin-RevId: 601091889 --- .../bugpatterns/threadsafety/ThreadSafeChecker.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/ThreadSafeChecker.java b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/ThreadSafeChecker.java index 5e91bca5c40c..29c3957eee26 100644 --- a/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/ThreadSafeChecker.java +++ b/core/src/main/java/com/google/errorprone/bugpatterns/threadsafety/ThreadSafeChecker.java @@ -84,15 +84,17 @@ public class ThreadSafeChecker extends BugChecker // check instantiations of `@ThreadSafe`s in method references @Override public Description matchMemberReference(MemberReferenceTree tree, VisitorState state) { - return checkInvocation( + checkInvocation( tree, ((JCMemberReference) tree).referentType, state, ASTHelpers.getSymbol(tree)); + return NO_MATCH; } // check instantiations of `@ThreadSafe`s in method invocations @Override public Description matchMethodInvocation(MethodInvocationTree tree, VisitorState state) { - return checkInvocation( + checkInvocation( tree, ASTHelpers.getType(tree.getMethodSelect()), state, ASTHelpers.getSymbol(tree)); + return NO_MATCH; } @Override @@ -112,14 +114,12 @@ public Description matchNewClass(NewClassTree tree, VisitorState state) { return NO_MATCH; } - private Description checkInvocation( - Tree tree, Type methodType, VisitorState state, Symbol symbol) { + private void checkInvocation(Tree tree, Type methodType, VisitorState state, Symbol symbol) { ThreadSafeAnalysis analysis = new ThreadSafeAnalysis(this, state, wellKnownThreadSafety); Violation info = analysis.checkInvocation(methodType, symbol); if (info.isPresent()) { state.reportMatch(buildDescription(tree).setMessage(info.message()).build()); } - return NO_MATCH; } @Override