JDK-6937011 : com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java fails with NPE
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 6u21
  • Priority: P1
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 2010-03-22
  • Updated: 2010-04-02
  • Resolved: 2010-03-22
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6
6-poolResolved
Related Reports
Duplicate :  
Description
Testsuite name: regression

Test: com/sun/management/HotSpotDiagnosticMXBean/GetDiagnosticOptions.java fails on 6u20b01, but passed on 6u19b03, 6u19b04, 6 fcs b105.

JDK/JRE tested: jdk 6u20b01

OS/architecture: x86-ubuntu, sun4u-solaris10

Reproducible: Always

Reproducible on machine: stt-89.russia, stt-64.russia, withblade.russia, spellweaver

Is it a platform specific regression: N

Is it a Regression: Y

[If yes] Regression introduced in release/build: 6u20b01

Test result on FCS: Passed, Passed on 6u19b03, 6u19b04

Steps to reproduce: 

ik217385@ik217385-desktop:/export/jqa/regression/6u20b01$ /export/jdk/6u20b01/jdk1.6.0_20/bin/javac GetDiagnosticOptions.java 
GetDiagnosticOptions.java:22: warning: sun.management.ManagementFactory is Sun proprietary API and may be removed in a future release
            sun.management.ManagementFactory.getDiagnosticMXBean();
                          ^
1 warning
ik217385@ik217385-desktop:/export/jqa/regression/6u20b01$ /export/jdk/6u20b01/jdk1.6.0_20/bin/java GetDiagnosticOptions
Exception in thread "main" java.lang.NullPointerException
	at sun.management.HotSpotDiagnostic.getDiagnosticOptions(HotSpotDiagnostic.java:29)
	at GetDiagnosticOptions.checkDiagnosticOptions(GetDiagnosticOptions.java:33)
	at GetDiagnosticOptions.main(GetDiagnosticOptions.java:23)

/java/re/jdk/6u20/promoted/ea/b01/j4b/ws/j2se/src/share/classes/sun/management/HotSpotDiagnostic.java


eugene@eugened:~> head -35 /java/re/jdk/6u20/promoted/ea/b01/j4b/ws/j2se/src/share/classes/sun/management/HotSpotDiagnostic.java | tail -10
        List<Flag> allFlags = Flag.getAllFlags();
        List<VMOption> result = new ArrayList<VMOption>();
        for (Flag flag : allFlags) {
            if (flag.isWriteable() && flag.isExternal()) {
                result.add(flag.getVMOption());
            }
        }
        return result;
    }

It seems that some flag is Null, and NPE at string "if (flag.isWriteable() && flag.isExternal()) "

Comments
EVALUATION Yes, it's a dup of 6924497. - Mandy
22-03-2010