Patch: File.toURL() and URLStreamHandler.parseURL() fixes

Tom Tromey tromey@redhat.com
Sun Mar 2 00:27:00 GMT 2003


>>>>> "Ranjit" == Ranjit Mathew <rmathew@hotmail.com> writes:

Ranjit> As promised earlier, this is a fuller patch for the URL
Ranjit> parsing problems in libgcj w.r.t. Win32.

Thanks.

Ranjit> After this patch, the output of GCJ matches that of
Ranjit> Sun's JDK for a large number of cases, at least on 
Ranjit> Win98 and with Sun's JDK 1.4.1.

Nice, thanks.  Any chance of writing some Mauve tests?

I'm putting this in 3.3 and the trunk.


One question about File.getAbsolutePath().  What if the file name is
something like "C:foo"?  Does this even make sense?  And if so, won't
this canonicalize (using the new code) to something like "A:\C:foo",
which is incorrect?

FYI there is still a POSIX-ism in File.getParent().
This method needs to be Windows-aware, I think.

Ranjit> * java/net/URLStreamHandler.java (parseURL): Correct minor typo.
Ranjit> Be prepared to handle either '/' or '\\' in the file path for
Ranjit> Windows if using the "file" protocol.
Ranjit> Canonicalise the file path if using a relative path in the given
Ranjit> context and the "file" protocol.

I wonder if this fixes PR 9124.

Tom



More information about the Java-patches mailing list