Skip to content
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

Merged
merged 1 commit into from
Aug 18, 2022

Conversation

Stephan202
Copy link
Member

@Stephan202 Stephan202 commented Aug 11, 2022

Suggested commit message:

Drop various vacuous null checks (#191)

Recent versions of Error Prone guarantee that `ASTHelpers#getSymbol`
never returns `null`.

Recent versions of Error Prone guarantee that `ASTHelpers#getSymbol`
never returns `null`.
@Stephan202 Stephan202 added this to the 0.1.1 milestone Aug 11, 2022
@Stephan202 Stephan202 requested a review from rickie August 11, 2022 18:04
@rickie rickie requested a review from oxkitsune August 17, 2022 19:23
Copy link
Member

@rickie rickie left a 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!

@rickie rickie requested review from ibabiankou and removed request for oxkitsune August 17, 2022 20:07
Copy link

@ibabiankou ibabiankou left a 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))) {

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? 🤔

Copy link
Member Author

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. 🤔

@rickie rickie merged commit ef751ce into master Aug 18, 2022
@rickie rickie deleted the sschroevers/drop-vacuous-null-handling branch August 18, 2022 09:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

3 participants