7117585: Eliminate java.lang.instrument, java.lang.management warnings
authormchung
Fri, 02 Dec 2011 16:29:19 -0800
changeset 11128 ffb869e392cf
parent 11127 6d29e4d16530
child 11129 f9ad1aadf3fa
7117585: Eliminate java.lang.instrument, java.lang.management warnings Reviewed-by: mchung Contributed-by: Jon VanAlten <jon.vanalten@redhat.com>
jdk/src/share/classes/java/lang/instrument/ClassDefinition.java
jdk/src/share/classes/java/lang/management/ManagementFactory.java
jdk/src/share/classes/java/lang/management/PlatformComponent.java
--- a/jdk/src/share/classes/java/lang/instrument/ClassDefinition.java	Fri Dec 02 16:25:35 2011 -0800
+++ b/jdk/src/share/classes/java/lang/instrument/ClassDefinition.java	Fri Dec 02 16:29:19 2011 -0800
@@ -40,12 +40,12 @@
     /**
      *  The class to redefine
      */
-    private final   Class   mClass;
+    private final Class<?> mClass;
 
     /**
      *  The replacement class file bytes
      */
-    private final   byte[]  mClassFile;
+    private final byte[]   mClassFile;
 
     /**
      *  Creates a new <code>ClassDefinition</code> binding using the supplied
--- a/jdk/src/share/classes/java/lang/management/ManagementFactory.java	Fri Dec 02 16:25:35 2011 -0800
+++ b/jdk/src/share/classes/java/lang/management/ManagementFactory.java	Fri Dec 02 16:29:19 2011 -0800
@@ -576,7 +576,7 @@
                                Class<T> mxbeanInterface)
             throws java.io.IOException {
 
-        final Class interfaceClass = mxbeanInterface;
+        final Class<?> interfaceClass = mxbeanInterface;
         // Only allow MXBean interfaces from rt.jar loaded by the
         // bootstrap class loader
         final ClassLoader loader =
--- a/jdk/src/share/classes/java/lang/management/PlatformComponent.java	Fri Dec 02 16:25:35 2011 -0800
+++ b/jdk/src/share/classes/java/lang/management/PlatformComponent.java	Fri Dec 02 16:29:19 2011 -0800
@@ -314,7 +314,7 @@
     private final String domain;
     private final String type;
     private final Set<String> keyProperties;
-    private final MXBeanFetcher fetcher;
+    private final MXBeanFetcher<?> fetcher;
     private final PlatformComponent[] subComponents;
     private final boolean singleton;
 
@@ -322,7 +322,7 @@
                               String domain, String type,
                               Set<String> keyProperties,
                               boolean singleton,
-                              MXBeanFetcher fetcher,
+                              MXBeanFetcher<?> fetcher,
                               PlatformComponent... subComponents) {
         this.mxbeanInterfaceName = intfName;
         this.domain = domain;
@@ -373,7 +373,7 @@
     <T extends PlatformManagedObject>
         List<T> getMXBeans(Class<T> mxbeanInterface)
     {
-        return fetcher.getMXBeans();
+        return (List<T>) fetcher.getMXBeans();
     }
 
     <T extends PlatformManagedObject> T getSingletonMXBean(Class<T> mxbeanInterface)
@@ -382,7 +382,7 @@
             throw new IllegalArgumentException(mxbeanInterfaceName +
                 " can have zero or more than one instances");
 
-        List<T> list = fetcher.getMXBeans();
+        List<T> list = getMXBeans(mxbeanInterface);
         assert list.size() == 1;
         return list.isEmpty() ? null : list.get(0);
     }