-
Type: New Feature
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: None
-
Component/s: API
-
None
Annotating the public API with NonNull annotations will allow tools like IntelliJ and other JVM languages like Kotlin to enforce constraints on application code that uses the driver.
See for an example the recent support for null-safety added to Spring Framework 5.0 here.
A couple of strange things about JSR-305 that need to be considered:
- It was never actually approved and incorporated into the JDK. Rather, it's available at the following Maven coordinates: com.google.code.findbugs:jsr305:3.0.2
- The package javax.annotation is exported by the java.xml.ws.annotation module in Java 9, and, though it's deprecated and slated for removal, I think that will conflict with any other module that also contains classes in the same package (like the JSR-305 one). However, this doesn't appear to affect Spring, perhaps because the JSR-305 jar file is a compileOnly dependency.