Seems ok with me, but sun/management is not an area I worked in.

Hopefully Mandy can look at this.

-kto


Tomas Hurka wrote:
Hi All,

The NullPointerException is thrown only if the setVMOption() is invoked for HeapDumpPath VM option. Due to CR 6604006, default value for HeapDumpPath flag is now null (instead of an empty string) and therefor flag.getValue() in HotSpotDiagnostic.setVMOption() now returns null. This causes that the type of flag is not recognized and error-reporting code in setVMOption() throws NPE.

Webrev at:
   http://cr.openjdk.java.net/~thurka/6858708/webrev.01/

The fix is simple - convert null to empty string in the sun.management.Flag constructor. This way type of the flag is recognized as String. I also added test. In general it is not very nice that sun.management.Flag uses value of the flag to detect its type so maybe whole code should be rewritten to explicitly specify type of the flag.

Thanks,
--
Tomas Hurka   <mailto:[email protected]>
NetBeans Profiler http://profiler.netbeans.org
VisualVM http://visualvm.dev.java.net
Software Engineer, Developer Platforms Group
Sun Microsystems, Praha Czech Republic

Reply via email to