Is there a way to denote nullability using javadoc...
# announcements
b
Is there a way to denote nullability using javadoc? I have to ship only one jar due to enterprise madness and annotations seem to have deps as well
b
@Stephan Schroeder that's because @Nullable has the @Documented annotation: https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/lang/Nullable.html
s
and this disqualifies it for you??
b
I can't have a dependency on the jar
the one that ships the nullability annotations
jsr305 is unfortunately not shipped with the java stdlib
s
you could simply write for each @param and @return if null is allowed.
b
yep
s
or maybe create a fat-jar that contains jsr305??
b
does that create collisions if they have the same dep?
s
if you have conflicting versions of jsr305 (is that a thing?), than yes
d
You do not need a hard-dependency on the annotations jar. You can include it in your build process, but your library will be usable without clients also depending on the annotations jar.
b
@diesieben07 as long as the annotations are on the classpath right?
d
No.
b
thanks