8073908: Replace hotspot/testlibrary use of sun.management with public API
Use java.lang API's instead of sun.management API's. Reviewed-by: sla, iignatyev, gtriantafill, mchung
This commit is contained in:
parent
26261a9600
commit
01ed1c9ea6
hotspot/test/testlibrary/ctw/src/sun/hotspot/tools/ctw
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* 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
|
||||
@ -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 @@ public class CompileTheWorld {
|
||||
|
||||
try {
|
||||
try {
|
||||
if (ManagementFactoryHelper.getCompilationMXBean() == null) {
|
||||
if (ManagementFactory.getCompilationMXBean() == null) {
|
||||
throw new RuntimeException(
|
||||
"CTW can not work in interpreted mode");
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* 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
|
||||
@ -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 class Utils {
|
||||
public static String getVMOption(String name) {
|
||||
String result;
|
||||
HotSpotDiagnosticMXBean diagnostic
|
||||
= ManagementFactoryHelper.getDiagnosticMXBean();
|
||||
= ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class);
|
||||
result = diagnostic.getVMOption(name).getValue();
|
||||
return result;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user