PROPOSAL : Specify nullable argument

Neal Gafter neal at gafter.com
Tue Mar 17 13:41:45 PDT 2009


Did you intend this to be a complete proposal?

Do you like this better than @NonNull, which will probably be included
in Java 7 under jsr 305?

On Tue, Mar 17, 2009 at 1:25 PM, Olivier Chorier <lapsus63 at gmail.com> wrote:
> Example :
>
> public void getListOfProducts(Company owner, !String facultativeName)
> {
> ....
> }
>
> The '!' should prevent the developper that the argument is able to be null.
> Invoking getListOfProducts(null, "name") could throw a compilation
> error/warning.
>
> Or maybe better :
>
> public void getListOfProducts(!Company owner, String facultativeName)
> {
> ....
> }
>
> Here, the '!' indicates a mandatory argument (not null).
>
>
> However, I don't know if the '!' marker could be the most appropriate.
>
>



More information about the coin-dev mailing list