changeset 6485:4b43dd02fca4

8019826: Test com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java fails with NPE Reviewed-by: sjiang, dholmes, mchung
author jbachorik
date Thu, 11 Jul 2013 09:21:09 +0200
parents 93ff09de1ad8
children 66a28466b569
files test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java
diffstat 1 files changed, 3 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java	Tue Jul 16 19:15:12 2013 +0400
+++ b/test/com/sun/management/HotSpotDiagnosticMXBean/SetVMOption.java	Thu Jul 11 09:21:09 2013 +0200
@@ -27,6 +27,7 @@
  * @summary Basic Test for HotSpotDiagnosticMXBean.setVMOption()
  *          and getDiagnosticOptions().
  * @author  Mandy Chung
+ * @author  Jaroslav Bachorik
  *
  * @run main/othervm -XX:+PrintGCDetails SetVMOption
  */
@@ -36,7 +37,6 @@
 import com.sun.management.HotSpotDiagnosticMXBean;
 import com.sun.management.VMOption;
 import com.sun.management.VMOption.Origin;
-import sun.misc.Version;
 
 public class SetVMOption {
     private static String PRINT_GC_DETAILS = "PrintGCDetails";
@@ -47,17 +47,8 @@
     private static HotSpotDiagnosticMXBean mbean;
 
     public static void main(String[] args) throws Exception {
-        List<HotSpotDiagnosticMXBean> list =
-            ManagementFactory.getPlatformMXBeans(HotSpotDiagnosticMXBean.class);
-
-        // The following test is transitional only and should be removed
-        // once build 52 is promoted.
-        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;
-        }
+        mbean =
+            ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
 
         VMOption option = findPrintGCDetailsOption();
         if (!option.getValue().equalsIgnoreCase(EXPECTED_VALUE)) {