|Re: @NonNull Lists [message #896899 is a reply to message #896835]
||Fri, 20 July 2012 10:59
| Stephan Herrmann
Registered: July 2009
Hi Ed, |
thanks for asking.
Ed Willink wrote on Fri, 20 July 2012 06:40
I've just started using the Juno @NonNull annotations. Great for deblurring APIs.
But as with any good facility, I want more.
I want more, too
I see that @NonNull fields are imminent (and essential).
That's currently in beta status (available for early access), please have a look at http://wiki.eclipse.org/JDT_Core/Null_Analysis/Beta
Null variable arguments
@NonNull String... seems to mean a non-null array of arguments rather
than an array of @NonNull arguments.
We went back and forth here, but decided that a full solution has to wait for JSR 308, at what time we'll be able to say things like
@Nullable String @Nonnull args; // array can be null, elements cannot
Lists of @NonNull.
I want to do List<@NonNull String> so that I don't need to null-check
With JSR 308 this will be possible. Today that's just not valid Java syntax.
And is there a way to import an auxiliary set of declarations for
unannotated code such as
@NonNull String String.trim();
Here I don't have an excuse other than: not enough time. Please see https://bugs.eclipse.org/331651 for our plans in this regard.
Your list is right on, exactly the things that are in our pipe line. Regarding null annotations for fields we are explicitly asking for feedback regarding the current beta. The wiki page links to a bugzilla, please add your comments when you try it.
Powered by FUDForum
. Page generated in 0.02799 seconds