United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-8019826 [Test bug] Test com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java fails with NPE
JDK-8019826 : [Test bug] Test com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java fails with NPE

Details
Type:
Bug
Submit Date:
2013-07-03
Status:
Closed
Updated Date:
2014-02-12
Project Name:
JDK
Resolved Date:
2013-07-11
Component:
core-svc
OS:
generic
Sub-Component:
java.lang.management
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
7u40
Fixed Versions:

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:

Sub Tasks

Description
Test com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java fails with NPE, because it tries to variable mbean when no object assigned to it:

java.lang.NullPointerException
	at SetVMOption.findPrintGCDetailsOption(SetVMOption.java:135)
	at SetVMOption.main(SetVMOption.java:62)
                                    

Comments
Test is obviously broken. Comments mention that:
        // The following test is transitional only and should be removed
        // once build 52 is promoted.
                                     
2013-07-04
Deferring to 8, this test hasn't been run before and we need to know why it was conditionally enabled after build 52.
                                     
2013-07-04
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/a46982a212e0
User:  jbachorik
Date:  2013-07-11 08:31:40 +0000

                                     
2013-07-11
Test bug, SQE approval not needed
                                     
2013-07-11
URL:   http://hg.openjdk.java.net/jdk8/jdk8/jdk/rev/a46982a212e0
User:  lana
Date:  2013-07-23 18:11:27 +0000

                                     
2013-07-23
This tests seems to be broken. Seems to be intended to be run for b52 or greater:
int build = Version.jvmBuildNumber();
if (build > 0 && build < 52) {
  // JVM support is integrated in build 52
  // this test is skipped if running with VM earlier than 52
  return;
}
I'm about to integrate hs24-b52 into 7u40, so this test failed in my JPRT control job
and will fail for everyone after I do the integration. Please exclude and then fix the test 
ASAP to avoid confusion, there are only a few builds left before 7u40 ZBB
                                     
2013-07-09
I've confirmed with the original author and the condition is just an unnecessary remnant from the old times. It can be safely removed. Afterwards the test needs to be fixed to properly initialise the "mbean" attribute to prevent NPE.
                                     
2013-07-10



Hardware and Software, Engineered to Work Together