jmx-dev 8060166: javax/management/MBeanInfo/NotificationInfoTest.java fails with modular image
Alan Bateman
Alan.Bateman at oracle.com
Mon Oct 13 16:52:27 UTC 2014
On 13/10/2014 15:35, Daniel Fuchs wrote:
> On 13/10/14 16:19, Alan Bateman wrote:
>> URL codeBase =
>> ClassLoader.getSystemResource("javax/management/MBeanServer.class");
>
> Interesting simplification. This looks good to me :-)
>
> I was intrigued by the difference so I tried the following:
>
> System.out.println(ClassLoader.getSystemResource(
> "javax/management/MBeanServer.class"));
>
> System.out.println(javax.management.MBeanServer.class
> .getProtectionDomain().getCodeSource().getLocation());
>
>
> the second line throws a NPE - which was most probably
> the reason for trying to locate rt.jar from java.home in
> the first place...
You may be right and the original author didn't think of
getSystemResource. Thanks for the review.
-Alan
More information about the jmx-dev
mailing list