Skip to content

Commit

Permalink
Resolve a couple of lingering @ResultIgnorabilityUnspecified in EP.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 601091889
  • Loading branch information
graememorgan authored and Error Prone Team committed Jan 26, 2024
1 parent 0be7a89 commit 3948676
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3948676

Please sign in to comment.