URLClassLoader.java (addURL): Moved implementation to private addURLImpl() to avoid...
authorJeroen Frijters <jeroen@sumatra.nl>
Sat, 19 Jul 2003 15:47:56 +0000 (17:47 +0200)
committerMichael Koch <mkoch@gcc.gnu.org>
Sat, 19 Jul 2003 15:47:56 +0000 (15:47 +0000)
2003-07-19  Jeroen Frijters <jeroen@sumatra.nl>

* java/net/URLClassLoader.java (addURL): Moved implementation to
private addURLImpl() to avoid calling addURL from the constructor.
(addURLImpl): Contains the code that was previously in addURL.
(addURLs): Call addURLImpl(), not addURL().

From-SVN: r69591

libjava/ChangeLog
libjava/java/net/URLClassLoader.java

index 94cb464fcf8f4d137c8e19fa392df49be84c3c1e..e7c86ed7ff23360e2b58175070b3d6d07bfd0d72 100644 (file)
@@ -1,3 +1,10 @@
+2003-07-19  Jeroen Frijters <jeroen@sumatra.nl>
+
+       * java/net/URLClassLoader.java (addURL): Moved implementation to
+       private addURLImpl() to avoid calling addURL from the constructor.
+       (addURLImpl): Contains the code that was previously in addURL.
+       (addURLs): Call addURLImpl(), not addURL().
+
 2003-07-18  Graydon Hoare  <graydon@redhat.com>
 
        * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c: 
index 10b67352f044b4a99e2c1548bac20981c51693db..9a468bf71af33f46f221db19fdeb943c50cbf014 100644 (file)
@@ -311,6 +311,9 @@ public class URLClassLoader extends SecureClassLoader
       if (jarfile == null)
        return null;
 
+      if (name.startsWith("/"))
+        name = name.substring(1);
+
       JarEntry je = jarfile.getJarEntry(name);
       if(je != null)
        return new JarURLResource(this, name, je);
@@ -653,6 +656,11 @@ public class URLClassLoader extends SecureClassLoader
    * @param newUrl the location to add
    */
   protected void addURL(URL newUrl)
+  {
+    addURLImpl(newUrl);
+  }
+
+  private void addURLImpl(URL newUrl)
   {
     synchronized(urlloaders)
       {
@@ -690,7 +698,7 @@ public class URLClassLoader extends SecureClassLoader
   {
     for (int i = 0; i < newUrls.length; i++)
     {
-      addURL(newUrls[i]);
+      addURLImpl(newUrls[i]);
     }
   }