You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Jeremy Daggett <je...@RACKSPACE.COM> on 2014/04/30 21:23:09 UTC

@Nullable Annotation

Can anyone explain the background/history of this annotation?  Other than marking a parameter or return value to indicate that something can be null, is there any code that does something special with it at compile time?

If you know the history here, can you please respond, and also add it to the Annotations [1] page? Thanks!

/jd

[1] https://wiki.apache.org/jclouds/Annotations

Re: @Nullable Annotation

Posted by Jasdeep Hundal <ja...@gmail.com>.
I was once curious why the JSR-305 @Nullable wasn't being used and located
this thread:
https://groups.google.com/forum/#!msg/jclouds-dev/tQc4QtOU_BI/0UGUYTgNjX0J

Jasdeep


On Wed, Apr 30, 2014 at 12:23 PM, Jeremy Daggett <
jeremy.daggett@rackspace.com> wrote:

> Can anyone explain the background/history of this annotation?  Other than
> marking a parameter or return value to indicate that something can be null,
> is there any code that does something special with it at compile time?
>
> If you know the history here, can you please respond, and also add it to
> the Annotations [1] page? Thanks!
>
> /jd
>
> [1] https://wiki.apache.org/jclouds/Annotations
>

Re: @Nullable Annotation

Posted by Andrew Phillips <ap...@qrmedia.com>.
> Can anyone explain the background/history of this annotation?  Other  
>  than marking a parameter or return value to indicate that something  
>  can be null, is there any code that does something special with it   
> at compile time?

Not as far as I am aware. It's intended as a user and developer  
"hint": any parameter or field *not* annotated with @Nullable is  
assumed to always be non-null. So you should never need to check it  
for null etc. in your code.

ap