-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Safety analysis detects annotations on superclasses and their interfaces #2271
Safety analysis detects annotations on superclasses and their interfaces #2271
Conversation
Previously it would detect direct interfaces and supertypes, but not interfaces on supertypes.
Generate changelog in
|
@@ -122,6 +124,30 @@ public static Safety getSafety(@Nullable Type type, VisitorState state) { | |||
return Safety.UNKNOWN; | |||
} | |||
|
|||
public static Safety getDirectSafety(@Nullable Symbol symbol, VisitorState state) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Extracted to avoid duplicating effort between ASTHelpers.hasAnnotation
and our annotation search. ASTHelpers.hasAnnotation
searches supertypes, but not their interfaces, and there's no sense doing it twice.
I took the opportunity to use an error-prone supplier for names, which should reduce overhead a bit.
Released 4.135.0 |
###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/latest-baseline-oss check. # Release Notes ## 4.135.0 | Type | Description | Link | | ---- | ----------- | ---- | | Improvement | Safety analysis detects annotations on superclasses and their interfaces | palantir/gradle-baseline#2271 | To enable or disable this check, please contact the maintainers of Excavator.
Previously it would detect direct interfaces and supertypes, but
not interfaces on supertypes.
After this PR
==COMMIT_MSG==
Safety analysis detects annotations on superclasses and their interfaces
==COMMIT_MSG==
Possible downsides?
More work at build time!