jmx-dev Codereview request: 8023529 OpenMBeanInfoSupport.equals/hashCode throw NPE

Jaroslav Bachorik jaroslav.bachorik at oracle.com
Thu Sep 5 03:59:01 PDT 2013


On 09/05/2013 10:37 AM, shanliang wrote:
> I have added 2 tasts to make sure that call
> OpenMBean*InfoSupport.equals/hashCode do not throw NPE
> The unit tests and JCK tests are passed.
> 
> Webrev: http://cr.openjdk.java.net/~sjiang/JDK-8023529/00/
> Bug: https://bugs.openjdk.java.net/browse/JDK-8023529

javax/management/openmbean/OpenMBeanInfoEqualsNPETest.java

* rename the "obj1", "obj2" parameters to something more explicit - eg.
"referenceInfo" and "nullValueinfo" or something similar
* when testing "obj.equals(null);" the messages should not contain
reference to the parameter since you are not, in fact, testing the null
value of the given parameter but rather a null info object
* the message "got NPE if null paramer" should read "got NPE for null
paramter"
* "Thread.sleep(100);" on line 153 is necessary?
-----

javax/management/openmbean/OpenMBeanInfoHashCodeNPETest.java

* the message "got NPE if null paramer" should read "got NPE for null
paramter"
* "Thread.sleep(100);" on line 143 is necessary?


-JB-

> 
> Thanks,
> 
> Shanliang



More information about the jmx-dev mailing list