The expectation is that these parameter are never null. You should be 
checking for null before calling these methods.  You should not be 
catching NPE. These methods do not explicitly throw an NPE, but rather 
passing null to these methods causes the VM to throw an NPE when the 
method use the parameter.



From:
Ikuo Yamasaki <[email protected]>
To:
OSGi Developer Mail List <[email protected]>
Date:
08/19/2009 09:46 PM
Subject:
[osgi-dev] conf.update(null)
Sent by:
[email protected]



Hi all,

Is the following my understanding correct ?

------------------
The caller of update(Dictionary props) method of Configuraion object
should confirm props is not null in advance or try/catch
NullPointerException.

In other words, the caller Should expect update(null) throws
NullPointerException.

------------------
Similar argument I found before AFAIK was 
BundleContext#getService(ServiceReference reference) is called with the
reference of null(NullPointerException will be thrown).

Generally speaking, the caller should expect NullPointerException in
case that the argument is Object and javadoc doesn't describe anything
in case of null.

Best regards,

---------------------
NTT Cyber Solutions Laboratories

     Ikuo YAMASAKI
        E-mail: [email protected]
TEL +81-46-859-8537  FAX +81-46-855-1282 


_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev


_______________________________________________
OSGi Developer Mail List
[email protected]
https://mail.osgi.org/mailman/listinfo/osgi-dev

Reply via email to