@Nullable / @Null / @NotNull / @Notnull / @Nonnull / @CheckForNull annotations | just some Java guy
Here is a quick summary of the differences:JSR-303
- Used for runtime bean validation, NOT static code analysis
- javax.validation.constraints.NotNull
- javax.validation.constraints.Null
JSR-305
- Used for Static code analysis - seems to be all but dead
- javax.annotation.Nonnull
- javax.annotation.Nullable
Findbugs
- Used by the Findbugs static code analysis tool
- edu.umd.cs.findbugs.annotations.NonNull
- edu.umd.cs.findbugs.annotations.Nullable (Probably not what you want)
- edu.umd.cs.findbugs.annotations.CheckForNull
Read full article from @Nullable / @Null / @NotNull / @Notnull / @Nonnull / @CheckForNull annotations | just some Java guy
No comments:
Post a Comment