@NotNull

Heiko W.Rupp hrupp at redhat.com
Wed Jun 22 13:55:42 UTC 2011


So I am seeing those errors in server log a lot when e.g. scheduling operations:

Caused by: java.lang.IllegalArgumentException: Argument 0 for @NotNull 
   parameter of org/rhq/core/domain/resource/Resource.setName must not 
   be null
        at org.rhq.core.domain.resource.Resource.setName(Resource.java)

While I am not sure who or what is adding that crazy check to my classes,
from the following code:

    public void setName(@NotNull String name) {
        this.name = name;
    }

I think as we do obviously have code parts in the Configuration world that seem
to call this setter with a null argument, we should either

- remove that annotation, as reality has proven that it is wrong
or
- fix the code that is calling this setter with a null argument

-- 
Reg. Adresse: Red Hat GmbH, Technopark II, Haus C, 
Werner-von-Siemens-Ring 14, D-85630 Grasbrunn
Handelsregister: Amtsgericht München HRB 153243
Geschaeftsführer: Brendan Lane, Charlie Peters, Michael Cunningham, Charles Cachera



More information about the rhq-devel mailing list