-
Notifications
You must be signed in to change notification settings - Fork 39
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
Drop various vacuous null checks #191
Conversation
Recent versions of Error Prone guarantee that `ASTHelpers#getSymbol` never returns `null`.
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.
Nice improvements 😄. Suggested commit message LGTM!
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.
LGTM
@@ -47,8 +46,7 @@ public Description matchMethod(MethodTree tree, VisitorState state) { | |||
return Description.NO_MATCH; | |||
} | |||
|
|||
MethodSymbol sym = ASTHelpers.getSymbol(tree); | |||
if (sym == null || ASTHelpers.methodCanBeOverridden(sym)) { | |||
if (ASTHelpers.methodCanBeOverridden(ASTHelpers.getSymbol(tree))) { |
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.
Just curious: why not static import the methods of ASTHelpers
? 🤔
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.
Yeah, I've been on the fence about that for a while. I guess I've held off so far that ASTHelpers
provides a rather heterogeneous set of operations, that can not always be distinguished from local helper methods. 🤔
Suggested commit message: