Fix unrecognized JSpecify nullable annotation locations - #51555
Merged
wilkinsona merged 1 commit intoSep 4, 2026
Merged
Conversation
Contributor
Author
|
Note: for backward compatibility reasons, the checker will be under "suggestion" severity, so if you like to have those as warnings or errors, you would need to adjust Note: Spring Framework passes the new checker just fine, no changes required. |
Signed-off-by: Vladimir Sitnikov <sitnikov.vladimir@gmail.com> See spring-projectsgh-51555
wilkinsona
force-pushed
the
codex/fix-jspecify-nullable-locations
branch
from
September 4, 2026 08:51
b58f0af to
ff30867
Compare
Member
|
The changes to |
Member
|
Thanks very much, @vlsi. |
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
NullAway’s new
JSpecifyUnrecognizedAnnotationLocationchecker found five@Nullableannotations in locations that JSpecify does not recognize. Those annotations do not express the intended nullness to JSpecify-aware tools.What
Move wildcard annotations onto their bounds, where JSpecify recognizes them, and remove annotations from a cast and a local-variable root type where the enclosing declarations already express or infer the nullable result.
How to verify
compileJavatasks with the NullAway snapshot from Add a check for nullness annotations in locations JSpecify does not recognize uber/NullAway#1787 andJSpecifyUnrecognizedAnnotationLocationconfigured atERRORseverity../gradlew :core:spring-boot:test --tests org.springframework.boot.context.properties.PropertyMapperTests./gradlew :module:spring-boot-jpa:test --tests org.springframework.boot.jpa.EntityManagerFactoryBuilderTests./gradlew :module:spring-boot-webflux:test --tests org.springframework.boot.webflux.actuate.endpoint.web.AbstractWebFluxEndpointHandlerMappingTests