@Null / @NotNull

John Mazzitelli mazz at redhat.com
Thu Nov 28 15:57:19 UTC 2013


> I would not say they're useless. Those annotations are @Documented and as
> such
> appear in the javadoc. So you might say they at least are a form of hint to
> the callers (even if we don't get the runtime validation that only IntelliJ
> can provide in a non-portable way).

They are useless because, as Heiko mentioned, our code doesn't match the annotations. I assume this means Heiko say an instance where we had something like @Null but the code actually didn't check for null and caused an NPE. In that sense I use the term "useless" because it adds a false sense of security that will lead to bugs ("I passed in null because the signature was annotated with @Null so I thought that was safe - but it still threw an NPE").


More information about the rhq-devel mailing list