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

add Throwable.getCause to nullableReturns #717

Merged
merged 1 commit into from
Jan 20, 2023

Conversation

XN137
Copy link
Contributor

@XN137 XN137 commented Jan 18, 2023

reasoning:

  • in its default implementation getLocalizedMessage() calls getMessage(), so should be treated in the same way
  • not every throwable was created with a cause, so getCause() will often return null, as indicated by its javadoc

@CLAassistant
Copy link

CLAassistant commented Jan 18, 2023

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@msridhar msridhar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the contribution! This will cause NullAway to report new errors in the next release but I think it's worth it. @lazaroclapp PTAL in case I missed something. I'll hold off on landing until then. @XN137 may take a couple of days due to other deadlines

Copy link
Collaborator

@lazaroclapp lazaroclapp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me. Thanks for the contribution! 🚀

Agree with @msridhar this will likely cause new errors for existing NullAway enrolled codebases, but a) they very well could be true positives, b) we can always (say, internally, at Uber) override these models for a bit if we need to.

@lazaroclapp lazaroclapp merged commit c4c7c4b into uber:master Jan 20, 2023
@XN137 XN137 deleted the nullable-returns-Throwable.getCause branch January 22, 2023 11:54
msridhar added a commit to msridhar/NullAway that referenced this pull request Jul 18, 2023
msridhar added a commit to msridhar/NullAway that referenced this pull request Jul 19, 2023
msridhar added a commit to msridhar/NullAway that referenced this pull request Jul 19, 2023
msridhar added a commit to msridhar/NullAway that referenced this pull request Jul 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants