When used javax.annotation.Nullableto designate methods as "potentially returning a value null", where to put the annotation @Nullable? About a method or return type?
javax.annotation.Nullable
null
@Nullable
Is there any technical difference, or is it strictly a style problem?
Style A:
@Nullable public Object blah() { ... }
Style B:
public @Nullable Object blah() { ... }
This is strictly a style issue.
, , . - - @Target javax.annotation.Nullable, javax.annotation.Nullable . , Java , public.
@Target
public
. , , . , .
: Nullable, . Java 8. , , . , Nullable, Eclipse Checker Framework, .
Nullable
. Option , None null.