Proposal: Elvis and Other Null-Safe Operators (original) (raw)
Joseph D. Darcy Joe.Darcy at Sun.COM
Tue Mar 3 18:28:26 PST 2009
- Previous message: Proposal: Elvis and Other Null-Safe Operators
- Next message: Proposal: Elvis and Other Null-Safe Operators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
cadenza at paradise.net.nz wrote:
This will be very confusing when you use Foo from another part of your application and expect the value to be non-null and get a NPE. In fact the @Nonnull is positvely misleading.
Basically, you can't rely on JSR-305. The information needs to be rechecked. Thus, whats the point in using it at all?!! Documentation perhaps? Annotations are not suitable for handling language level issues like nulls. An annotation processor visible to javac could perform the @nonNull check and cause the compilation to fail.
[snip]
... and such checking is done with the Checkers framework associated with JSR 308 that is built on top of annotation processing:
http://groups.csail.mit.edu/pag/jsr308/
-Joe
- Previous message: Proposal: Elvis and Other Null-Safe Operators
- Next message: Proposal: Elvis and Other Null-Safe Operators
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]