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
findbugs:NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE does not consider null validation #651
Comments
Problem: Also if validated using java assert spotbugs still complains NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE Affected version: 3.1.5 (SpotBugs) assert entity.getId() != null;
final long id = entity.getId().longValue(); |
I'm not sure that the |
Problem: Same problem with Google Guava Namely on the two checks:
Seen in: Gradle build with SpotBugs plugin:
Affected Version: 3.1.12 |
Same issue with |
+1 for supporting |
Same issue with custom method that is annotated with @contract("null -> false") |
I'm trying to add a reproducer in the SpotBugs project but I keep getting:
even after adding the dependency to the spotbugs-tests module 😕 |
Any updates on this issue? |
@ThrawnCA any news on that? |
There's a database of hardcoded method parameter annotations in https://github.com/spotbugs/spotbugs/blob/master/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/DefaultNullnessAnnotations.java#L406 At the given line, the first argument of The same holds true for other implementations, for example |
any news on that and #456 ? |
SpotBugs has a bug: spotbugs/spotbugs#651 IntelliJ has better built-in null warnings anyway.
SpotBugs has a bug: spotbugs/spotbugs#651 IntelliJ has better built-in null warnings anyway.
SpotBugs has a bug: spotbugs/spotbugs#651 IntelliJ has better built-in null warnings anyway.
SpotBugs has a bug: spotbugs/spotbugs#651 IntelliJ has better built-in null warnings anyway.
Fixed by #2709 |
Problem: A violation is triggered at the last line, saying that args may be null. This is clearly validated the line before (using org.apache.commons.lang3.Validate)
Affected version: 3.1.2 (SpotBugs)
Seen in: SonarQube (FindBugs plugin 3.7)
Reproducible code example (from an Android app):
The text was updated successfully, but these errors were encountered: