-
Bug
-
Resolution: Fixed
-
P3
-
9
-
b55
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8082977 | emb-9 | Harold Seigel | P3 | Resolved | Fixed | team |
hotspot/testlibrary references to sun.management.ManagementFactoryHelper that can easily be replaced with java.lang.management.ManagementFactory.
This will avoid any hotspot tests depending on testlibrary to include
@modules java.management/sun.management
--- old/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java 2015-02-25 10:14:17.812658441 -0800
+++ new/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java 2015-02-25 10:14:17.720658440 -0800
@@ -23,7 +23,7 @@
package sun.hotspot.tools.ctw;
-import sun.management.ManagementFactoryHelper;
+import java.lang.management.ManagementFactory;
import java.io.*;
import java.nio.file.Files;
@@ -55,7 +55,7 @@
try {
try {
- if (ManagementFactoryHelper.getCompilationMXBean() == null) {
+ if (ManagementFactory.getCompilationMXBean() == null) {
throw new RuntimeException(
"CTW can not work in interpreted mode");
}
--- old/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java 2015-02-25 10:14:18.180658447 -0800
+++ new/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java 2015-02-25 10:14:18.088658445 -0800
@@ -24,7 +24,7 @@
package sun.hotspot.tools.ctw;
import com.sun.management.HotSpotDiagnosticMXBean;
-import sun.management.ManagementFactoryHelper;
+import java.lang.management.ManagementFactory;
import java.io.File;
import java.util.regex.Pattern;
@@ -160,7 +160,7 @@
public static String getVMOption(String name) {
String result;
HotSpotDiagnosticMXBean diagnostic
- = ManagementFactoryHelper.getDiagnosticMXBean();
+ = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
result = diagnostic.getVMOption(name).getValue();
return result;
}
This will avoid any hotspot tests depending on testlibrary to include
@modules java.management/sun.management
--- old/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java 2015-02-25 10:14:17.812658441 -0800
+++ new/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/CompileTheWorld.java 2015-02-25 10:14:17.720658440 -0800
@@ -23,7 +23,7 @@
package sun.hotspot.tools.ctw;
-import sun.management.ManagementFactoryHelper;
+import java.lang.management.ManagementFactory;
import java.io.*;
import java.nio.file.Files;
@@ -55,7 +55,7 @@
try {
try {
- if (ManagementFactoryHelper.getCompilationMXBean() == null) {
+ if (ManagementFactory.getCompilationMXBean() == null) {
throw new RuntimeException(
"CTW can not work in interpreted mode");
}
--- old/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java 2015-02-25 10:14:18.180658447 -0800
+++ new/test/testlibrary/ctw/src/sun/hotspot/tools/ctw/Utils.java 2015-02-25 10:14:18.088658445 -0800
@@ -24,7 +24,7 @@
package sun.hotspot.tools.ctw;
import com.sun.management.HotSpotDiagnosticMXBean;
-import sun.management.ManagementFactoryHelper;
+import java.lang.management.ManagementFactory;
import java.io.File;
import java.util.regex.Pattern;
@@ -160,7 +160,7 @@
public static String getVMOption(String name) {
String result;
HotSpotDiagnosticMXBean diagnostic
- = ManagementFactoryHelper.getDiagnosticMXBean();
+ = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
result = diagnostic.getVMOption(name).getValue();
return result;
}
- backported by
-
JDK-8082977 Replace hotspot/testlibrary use of sun.management with public API
-
- Resolved
-