src/share/classes/javax/imageio/metadata/IIOMetadata.java

Print this page
rev 9344 : 8034998: Fix raw and unchecked lint warnings in javax.imageio
Reviewed-by: darcy, prr

@@ -393,19 +393,19 @@
         }
         if (formatClassName == null) {
             throw new IllegalArgumentException("Unsupported format name");
         }
         try {
-            Class cls = null;
+            Class<?> cls = null;
             final Object o = this;
 
             // firstly we try to use classloader used for loading
             // the IIOMetadata implemantation for this plugin.
-            ClassLoader loader = (ClassLoader)
+            ClassLoader loader =
                 java.security.AccessController.doPrivileged(
-                    new java.security.PrivilegedAction() {
-                            public Object run() {
+                    new java.security.PrivilegedAction<ClassLoader>() {
+                            public ClassLoader run() {
                                 return o.getClass().getClassLoader();
                             }
                         });
 
             try {

@@ -413,14 +413,14 @@
                                     loader);
             } catch (ClassNotFoundException e) {
                 // we failed to load IIOMetadataFormat class by
                 // using IIOMetadata classloader.Next try is to
                 // use thread context classloader.
-                loader = (ClassLoader)
+                loader =
                     java.security.AccessController.doPrivileged(
-                        new java.security.PrivilegedAction() {
-                                public Object run() {
+                        new java.security.PrivilegedAction<ClassLoader>() {
+                                public ClassLoader run() {
                                     return Thread.currentThread().getContextClassLoader();
                                 }
                         });
                 try {
                     cls = Class.forName(formatClassName, true,