Jooby does not have package-info.java and I noticed this when I did the upgrade of findbugs to spotbugs for the modularization in 3.0.
If we add package-info.java to all the packages then we can add the annotation:
edu.umd.cs.findbugs.annotations.ReturnValuesAreNonnullByDefault to the packages themselves (there are also a bunch of ones called DefaultXXX where you set the default annotation but in practice I find the null analysis tool don't work as well with those).
This will make the return values default to @NonNull if no annotation is present. This should work fine with Kotlin.
See #3458 (this is why Spring does not have the @NonNull annotations on return as they use something similar to the above).
Also package-info.java makes javadoc look prettier.
Jooby does not have
package-info.java
and I noticed this when I did the upgrade of findbugs to spotbugs for the modularization in 3.0.If we add
package-info.java
to all the packages then we can add the annotation:edu.umd.cs.findbugs.annotations.ReturnValuesAreNonnullByDefault
to the packages themselves (there are also a bunch of ones calledDefaultXXX
where you set the default annotation but in practice I find the null analysis tool don't work as well with those).This will make the return values default to
@NonNull
if no annotation is present. This should work fine with Kotlin.See #3458 (this is why Spring does not have the
@NonNull
annotations on return as they use something similar to the above).Also
package-info.java
makes javadoc look prettier.