This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: fix File.toURL bug
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Subject: Patch: FYI: fix File.toURL bug
- From: Tom Tromey <tromey at redhat dot com>
- Date: 11 Sep 2001 22:41:31 -0600
- Reply-To: tromey at redhat dot com
I'm checking this in. File.toURL didn't comply with the spec. This
patch fixes it.
URL still transforms the URL from `file:///tmp/foo' to `file:/tmp/foo'.
That's too bad (my reading of the URL RFC is that the former is correct).
I'm not planning to look into that.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* java/io/File.java (toURL): Use getAbsolutePath and `file://'.
Index: java/io/File.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/io/File.java,v
retrieving revision 1.20
diff -u -r1.20 File.java
--- java/io/File.java 2001/08/31 22:31:40 1.20
+++ java/io/File.java 2001/09/12 04:27:04
@@ -281,7 +281,8 @@
public URL toURL () throws MalformedURLException
{
- return new URL ("file:" + path + (isDirectory() ? "/" : ""));
+ return new URL ("file://" + getAbsolutePath ()
+ + (isDirectory() ? "/" : ""));
}
private final native boolean performMkdir ();