< prev index next >

src/share/classes/java/net/URLClassLoader.java

Print this page
rev 1564 : 7090158: Networking Libraries don't build with javac -Werror
7125055: ContentHandler.getContent API changed in error
Summary: Minor changes to networking java files to remove warnings
Reviewed-by: chegar, weijun, hawtin, alanb
Contributed-by: kurchi.subhra.hazra@oracle.com, sasha_bu@hotmail.com

@@ -23,19 +23,14 @@
  * questions.
  */
 
 package java.net;
 
-import java.lang.reflect.Method;
-import java.lang.reflect.Modifier;
 import java.io.File;
 import java.io.FilePermission;
 import java.io.InputStream;
 import java.io.IOException;
-import java.net.URL;
-import java.net.URLConnection;
-import java.net.URLStreamHandlerFactory;
 import java.util.Enumeration;
 import java.util.NoSuchElementException;
 import java.util.StringTokenizer;
 import java.util.jar.Manifest;
 import java.util.jar.Attributes;

@@ -201,12 +196,12 @@
     protected Class<?> findClass(final String name)
          throws ClassNotFoundException
     {
         try {
             return AccessController.doPrivileged(
-                new PrivilegedExceptionAction<Class>() {
-                    public Class run() throws ClassNotFoundException {
+                new PrivilegedExceptionAction<Class<?>>() {
+                    public Class<?> run() throws ClassNotFoundException {
                         String path = name.replace('.', '/').concat(".class");
                         Resource res = ucp.getResource(path, false);
                         if (res != null) {
                             try {
                                 return defineClass(name, res);

@@ -226,11 +221,11 @@
     /*
      * Defines a Class using the class bytes obtained from the specified
      * Resource. The resulting Class must be resolved before it can be
      * used.
      */
-    private Class defineClass(String name, Resource res) throws IOException {
+    private Class<?> defineClass(String name, Resource res) throws IOException {
         int i = name.lastIndexOf('.');
         URL url = res.getCodeSourceURL();
         if (i != -1) {
             String pkgname = name.substring(0, i);
             // Check if package already loaded.

@@ -602,11 +597,11 @@
 
     FactoryURLClassLoader(URL[] urls) {
         super(urls);
     }
 
-    public final synchronized Class loadClass(String name, boolean resolve)
+    public final synchronized Class<?> loadClass(String name, boolean resolve)
         throws ClassNotFoundException
     {
         // First check if we have permission to access the package. This
         // should go away once we've added support for exported packages.
         SecurityManager sm = System.getSecurityManager();
< prev index next >