https://kotlinlang.org logo
Title
b

Bernhard

05/13/2019, 10:15 AM
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

Bernhard

05/13/2019, 10:35 AM
@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

Stephan Schroeder

05/13/2019, 10:37 AM
and this disqualifies it for you??
b

Bernhard

05/13/2019, 10:38 AM
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

Stephan Schroeder

05/13/2019, 10:40 AM
you could simply write for each @param and @return if null is allowed.
b

Bernhard

05/13/2019, 10:40 AM
yep
s

Stephan Schroeder

05/13/2019, 10:41 AM
or maybe create a fat-jar that contains jsr305??
b

Bernhard

05/13/2019, 10:41 AM
does that create collisions if they have the same dep?
s

Stephan Schroeder

05/13/2019, 10:43 AM
if you have conflicting versions of jsr305 (is that a thing?), than yes
d

diesieben07

05/13/2019, 10:45 AM
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

Bernhard

05/13/2019, 10:49 AM
@diesieben07 as long as the annotations are on the classpath right?
d

diesieben07

05/13/2019, 10:49 AM
No.
b

Bernhard

05/13/2019, 10:51 AM
thanks