@Null / @NotNull

John Mazzitelli mazz at redhat.com
Thu Nov 28 14:16:38 UTC 2013


Get rid of the JetBrains annotations!!! They are useless for those that don't use IntelliJ anyway (as you say, we cant' trust them anyway).

I beleive JDK7 introduced similar annotations (or I remember reading SOME JDK is going to introduce them) - I'd be ok if we use those.

But those JetBrains ones have got to go.

----- Original Message -----
> Hey,
> 
> as I just got bitten again by trusting on @NotNull:
> 
> We should decide if we want to keep those annotations and enforce them
> or remove them. The way it is right now just creates confusion.
> 
> Personally I am for keeping + enforcing.
> 
> Perhaps there is a more official variant from a JSR than the Jetbrains
> counterpart, so that tooling that uses JSR annotations (Findbugs?) can
> work with them.
> 
> There may be libraries out there that do not honor @NotNull so that
> we may need to change our code then:
> 
> Caused by: com.google.gwt.user.client.rpc.SerializationException:
> java.lang.NullPointerException
>         at
>         com.google.gwt.user.server.rpc.impl.ServerSerializationStreamReader.deserialize(ServerSerializationStreamReader.java:691)
>         [gwt-servlet-2.5.0.jar:]
> [..]
> Caused by: java.lang.NullPointerException
>         at
>         org.rhq.core.domain.configuration.definition.ConfigurationDefinition.setName(ConfigurationDefinition.java:139)
>         [
> 
> (this NPEd because I made a change to setName() -- but still the getter for
> the name also says @NotNull, and the
> behavior that GWT is setting the name to null violates this contract on
> retrieval ).
> 
> 
>   Heiko
> 
> 
> --
> Reg. Adresse: Red Hat GmbH, Technopark II, Haus C,
> Werner-von-Siemens-Ring 14, D-85630 Grasbrunn
> Handelsregister: Amtsgericht München HRB 153243
> Geschäftsführer: Charles Cachera, Michael Cunningham, Paul Hickey, Charlie
> Peters
> 
> _______________________________________________
> rhq-devel mailing list
> rhq-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/rhq-devel
> 


More information about the rhq-devel mailing list