7117585: Eliminate java.lang.instrument, java.lang.management warnings
Reviewed-by: mchung
This commit is contained in:
parent
689ccf050d
commit
d69cbad3f9
@ -40,12 +40,12 @@ public final class ClassDefinition {
|
|||||||
/**
|
/**
|
||||||
* The class to redefine
|
* The class to redefine
|
||||||
*/
|
*/
|
||||||
private final Class mClass;
|
private final Class<?> mClass;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The replacement class file bytes
|
* The replacement class file bytes
|
||||||
*/
|
*/
|
||||||
private final byte[] mClassFile;
|
private final byte[] mClassFile;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates a new <code>ClassDefinition</code> binding using the supplied
|
* Creates a new <code>ClassDefinition</code> binding using the supplied
|
||||||
|
@ -576,7 +576,7 @@ public class ManagementFactory {
|
|||||||
Class<T> mxbeanInterface)
|
Class<T> mxbeanInterface)
|
||||||
throws java.io.IOException {
|
throws java.io.IOException {
|
||||||
|
|
||||||
final Class interfaceClass = mxbeanInterface;
|
final Class<?> interfaceClass = mxbeanInterface;
|
||||||
// Only allow MXBean interfaces from rt.jar loaded by the
|
// Only allow MXBean interfaces from rt.jar loaded by the
|
||||||
// bootstrap class loader
|
// bootstrap class loader
|
||||||
final ClassLoader loader =
|
final ClassLoader loader =
|
||||||
|
@ -314,7 +314,7 @@ enum PlatformComponent {
|
|||||||
private final String domain;
|
private final String domain;
|
||||||
private final String type;
|
private final String type;
|
||||||
private final Set<String> keyProperties;
|
private final Set<String> keyProperties;
|
||||||
private final MXBeanFetcher fetcher;
|
private final MXBeanFetcher<?> fetcher;
|
||||||
private final PlatformComponent[] subComponents;
|
private final PlatformComponent[] subComponents;
|
||||||
private final boolean singleton;
|
private final boolean singleton;
|
||||||
|
|
||||||
@ -322,7 +322,7 @@ enum PlatformComponent {
|
|||||||
String domain, String type,
|
String domain, String type,
|
||||||
Set<String> keyProperties,
|
Set<String> keyProperties,
|
||||||
boolean singleton,
|
boolean singleton,
|
||||||
MXBeanFetcher fetcher,
|
MXBeanFetcher<?> fetcher,
|
||||||
PlatformComponent... subComponents) {
|
PlatformComponent... subComponents) {
|
||||||
this.mxbeanInterfaceName = intfName;
|
this.mxbeanInterfaceName = intfName;
|
||||||
this.domain = domain;
|
this.domain = domain;
|
||||||
@ -373,7 +373,7 @@ enum PlatformComponent {
|
|||||||
<T extends PlatformManagedObject>
|
<T extends PlatformManagedObject>
|
||||||
List<T> getMXBeans(Class<T> mxbeanInterface)
|
List<T> getMXBeans(Class<T> mxbeanInterface)
|
||||||
{
|
{
|
||||||
return fetcher.getMXBeans();
|
return (List<T>) fetcher.getMXBeans();
|
||||||
}
|
}
|
||||||
|
|
||||||
<T extends PlatformManagedObject> T getSingletonMXBean(Class<T> mxbeanInterface)
|
<T extends PlatformManagedObject> T getSingletonMXBean(Class<T> mxbeanInterface)
|
||||||
@ -382,7 +382,7 @@ enum PlatformComponent {
|
|||||||
throw new IllegalArgumentException(mxbeanInterfaceName +
|
throw new IllegalArgumentException(mxbeanInterfaceName +
|
||||||
" can have zero or more than one instances");
|
" can have zero or more than one instances");
|
||||||
|
|
||||||
List<T> list = fetcher.getMXBeans();
|
List<T> list = getMXBeans(mxbeanInterface);
|
||||||
assert list.size() == 1;
|
assert list.size() == 1;
|
||||||
return list.isEmpty() ? null : list.get(0);
|
return list.isEmpty() ? null : list.get(0);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user