-
Notifications
You must be signed in to change notification settings - Fork 38.2k
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
Refine null-safety with NullAway build-time checks #32475
Comments
This commit introduces null-safety checks for spring-core at build-time in order to validate the consistency of Spring null-safety annotations and generate errors when inconsistencies are detected during a build (similar to what is done with Checkstyle). In order to make that possible, this commit also introduces a new org.springframework.lang.Contract annotation inspired from org.jetbrains.annotations.Contract, which allows to specify semantics of methods like Assert#notNull in order to prevent artificial additional null checks in Spring Framework code base. This commit only checks org.springframework.core package, follow-up commits will also extend the analysis to other modules, after related null-safety refinements. See spring-projectsgh-32475
Also in spring-websocket. See spring-projectsgh-32475
This commit refines the null-safety in: - spring-jdbc - spring-r2dbc - spring-orm - spring-beans - spring-aop See spring-projectsgh-32475
This commit enables null-safety build-time checks in: - spring-jdbc - spring-r2dbc - spring-orm - spring-beans - spring-aop See spring-projectsgh-32475
This commit refines the null-safety in all remaining modules except spring-test. See spring-projectsgh-32475
This commit enables null-safety build-time checks in all remaining modules except spring-test. See spring-projectsgh-32475
This commit reverts some null-safety changes which make sense on main but are too impactful for 6.1.x for Kotlin developers using -Xjsr305=strict. See spring-projectsgh-32475
Hi. Is there a specific reason why for example the method I'm often using only |
Hi @leikingo, This issue was closed 6 months ago for 6.2 M1. Can you please create a new issue to address your concerns about missing Thanks |
As discussed with the JSpecify working group, the goal of this issue is to introduce null-safety checks at build-time using NullAway and the related Error Prone Gradle plugin and refine Spring null-safety annotations accordingly.
Unlike #28797, the purpose of this issue is to continue to leverage JSR 305 annotations. That said, such formal build-time checks will likely ease a potential transition to a different null-safety mechanism (JSpecify or at Java platform level) in the future.
See this draft commit that enables those null-checks on
spring-core
and generates 41 errors that will likely to lead null-safety refinements.The text was updated successfully, but these errors were encountered: