< prev index next >

hotspot/test/gc/g1/TestSummarizeRSetStatsTools.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -23,18 +23,15 @@
 
 /*
  * Common helpers for TestSummarizeRSetStats* tests
  */
 
-import sun.management.ManagementFactoryHelper;
 import com.sun.management.HotSpotDiagnosticMXBean;
 import com.sun.management.VMOption;
 
 import com.oracle.java.testlibrary.*;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.lang.Thread;
+import java.lang.management.ManagementFactory;
 import java.util.ArrayList;
 import java.util.Arrays;
 
 class VerifySummaryOutput {
     // 4M size, both are directly allocated into the old gen

@@ -72,11 +69,12 @@
 
 public class TestSummarizeRSetStatsTools {
 
     // the VM is currently run using G1GC, i.e. trying to test G1 functionality.
     public static boolean testingG1GC() {
-        HotSpotDiagnosticMXBean diagnostic = ManagementFactoryHelper.getDiagnosticMXBean();
+        HotSpotDiagnosticMXBean diagnostic = 
+            ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
 
         VMOption option = diagnostic.getVMOption("UseG1GC");
         if (option.getValue().equals("false")) {
           System.out.println("Skipping this test. It is only a G1 test.");
           return false;
< prev index next >