Hi,

I committed the attached patch to fix a regression introduced in the
previous URLClassLoader change.

Regards,
Jeroen

2005-10-01  Jeroen Frijters  <[EMAIL PROTECTED]>

        * java/net/URLClassLoader.java
        (Resource.name): Removed field.
        (JarURLResource.name): Added field.
        (FileResource.getURL): Use File.toURL() instead of doing it in
        a way that breaks on Windows.
Index: java/net/URLClassLoader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/URLClassLoader.java,v
retrieving revision 1.38
diff -u -r1.38 URLClassLoader.java
--- java/net/URLClassLoader.java        17 Sep 2005 04:22:08 -0000      1.38
+++ java/net/URLClassLoader.java        1 Oct 2005 10:57:09 -0000
@@ -235,12 +235,10 @@
   abstract static class Resource
   {
     final URLLoader loader;
-    final String name;
 
-    Resource(URLLoader loader, String name)
+    Resource(URLLoader loader)
     {
       this.loader = loader;
-      this.name = name;
     }
 
     /**
@@ -391,11 +389,13 @@
   static final class JarURLResource extends Resource
   {
     private final JarEntry entry;
+    private final String name;
 
     JarURLResource(JarURLLoader loader, String name, JarEntry entry)
     {
-      super(loader, name);
+      super(loader);
       this.entry = entry;
+      this.name = name;
     }
 
     InputStream getInputStream() throws IOException
@@ -496,7 +496,7 @@
     RemoteResource(RemoteURLLoader loader, String name, URL url,
                    InputStream stream, int length)
     {
-      super(loader, name);
+      super(loader);
       this.url = url;
       this.stream = stream;
       this.length = length;
@@ -539,7 +539,7 @@
        {
          File file = new File(dir, name).getCanonicalFile();
          if (file.exists() && !file.isDirectory())
-           return new FileResource(this, file.getPath(), file);
+           return new FileResource(this, file);
        }
       catch (IOException e)
        {
@@ -553,9 +553,9 @@
   {
     final File file;
 
-    FileResource(FileURLLoader loader, String name, File file)
+    FileResource(FileURLLoader loader, File file)
     {
-      super(loader, name);
+      super(loader);
       this.file = file;
     }
 
@@ -573,8 +573,7 @@
     {
       try
         {
-          return new URL(loader.baseURL, name,
-                         loader.classloader.getURLStreamHandler("file"));
+          return file.toURL();
         }
       catch (MalformedURLException e)
         {
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to