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

Don't suggest @Nullable on implementations of methods like Map.put if those implementations always throw or they are @DoNotCall. #3325

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

copybara-service[bot]
Copy link
Contributor

Don't suggest @Nullable on implementations of methods like Map.put if those implementations always throw or they are @DoNotCall.

Also, provide a different error message for this "implementations of well-known methods" case, one that is different from the usual "Method returns a definitely null value" message.

(I considered continuing the make the suggestion in "aggressive" mode, but I'm not sure if it's worth the trouble even then, since it may lead to a discussion every time the suggestion appears.)

Fixes #2910

…` if those implementations always throw or they are `@DoNotCall`.

Also, provide a different error message for this "implementations of well-known methods" case, one that is different from the usual "Method returns a definitely null value" message.

(I considered continuing the make the suggestion in "aggressive" mode, but I'm not sure if it's worth the trouble even then, since it may lead to a discussion every time the suggestion appears.)

Fixes #2910

PiperOrigin-RevId: 460772102
@copybara-service copybara-service bot merged commit 49e4b34 into master Jul 13, 2022
@copybara-service copybara-service bot deleted the test_460746537 branch July 13, 2022 19:01
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.

ReturnMissingNullable should ignore @DoNotCall and always throwing methods
1 participant