Hi Robert, On Mon, 2005-10-10 at 02:55 +0200, Robert Schuster wrote: > 2005-10-07 Robert Schuster <[EMAIL PROTECTED]> > > * java/net/URLStreamHandler.java: > (toExternalForm): Remove superfluous leading slashes from URL > paths.
I think this is the wrong approach. You are trying to change the URL by
removing slashes, which might change the semantics. The real bug seems
to be that the leading // for the authority (host) part is not added
when there is no or an empty authority and URL.getFile() does return the
separator '/' between URL-authority and URL-path if constructed through
new URL(String), but not when constructed by giving the separate
components to the constructor. But if getFile() returns a file part that
starts with a slash then whether the leading // for the authority part
are given or not is significant.
So maybe the solution is to change the test for when to include the
authority part (plus "//") to:
if (authority.length() != 0 || file.startsWith("/"))
{
sb.append("//").append(authority);
}
Not tested.
Cheers,
Mark
signature.asc
Description: This is a digitally signed message part
_______________________________________________ Classpath-patches mailing list [email protected] http://lists.gnu.org/mailman/listinfo/classpath-patches
