public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Fwd: Patch: file resources require canonicalized names]
@ 2005-09-16 22:59 Anthony Green
  2005-09-17  0:16 ` Tom Tromey
  0 siblings, 1 reply; 2+ messages in thread
From: Anthony Green @ 2005-09-16 22:59 UTC (permalink / raw)
  To: java-patches

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

I just checked a comparable patch into FSF HEAD for
libgcj/java/net/URLClassLoader.java, but not
libgcj/classpath/java/net/URLClassLoader.java.  I hope that was the
right thing to do.

Thanks,

AG


[-- Attachment #2: Forwarded message - Patch: file resources require canonicalized names --]
[-- Type: message/rfc822, Size: 1548 bytes --]

From: Anthony Green <green@redhat.com>
To: classpath-patches <classpath-patches@gnu.org>
Subject: Patch: file resources require canonicalized names
Date: Fri, 16 Sep 2005 15:51:50 -0700
Message-ID: <1126911109.3011.33.camel@dhcp-172-16-25-146.sfbay.redhat.com>

I just checked in the following patch, which was approved by tromey.

2005-09-15  Anthony Green  <green@redhat.com>

	PR libgcj/20198
	* java/net/URLClassLoader.java (FileURLLoader.getResource): File
	resources should all have canonicalized names.


Index: java/net/URLClassLoader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/net/URLClassLoader.java,v
retrieving revision 1.36
diff -u -r1.36 URLClassLoader.java
--- java/net/URLClassLoader.java	9 Sep 2005 21:42:58 -0000	1.36
+++ java/net/URLClassLoader.java	16 Sep 2005 22:48:33 -0000
@@ -535,9 +535,16 @@
     /** get resource with the name "name" in the file url */
     Resource getResource(String name)
     {
-      File file = new File(dir, name);
-      if (file.exists() && !file.isDirectory())
-        return new FileResource(this, name, file);
+      try 
+	{
+	  File file = new File(dir, name).getCanonicalFile();
+	  if (file.exists() && !file.isDirectory())
+	    return new FileResource(this, file.path(), file);
+	}
+      catch (IOException e)
+	{
+	  // Fall through...
+	}
       return null;
     }
   }


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Fwd: Patch: file resources require canonicalized names]
  2005-09-16 22:59 [Fwd: Patch: file resources require canonicalized names] Anthony Green
@ 2005-09-17  0:16 ` Tom Tromey
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Tromey @ 2005-09-17  0:16 UTC (permalink / raw)
  To: Anthony Green; +Cc: java-patches

Anthony> I just checked a comparable patch into FSF HEAD for
Anthony> libgcj/java/net/URLClassLoader.java, but not
Anthony> libgcj/classpath/java/net/URLClassLoader.java.  I hope that was the
Anthony> right thing to do.

Yes, it was.  A file libjava/foo overrides the corresponding file
libjava/classpath/foo.

Tom

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-09-17  0:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-16 22:59 [Fwd: Patch: file resources require canonicalized names] Anthony Green
2005-09-17  0:16 ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).