FYI: Patch: java.net.URLStreamHandler

Mark Wielaard mark@klomp.org
Wed Oct 29 22:54:00 GMT 2003


Hi,

On Wed, 2003-10-29 at 12:48, Michael Koch wrote:
> I commited now a slightly different patch to java.net.URLStreamHandler. I 
> hope everyone is okay with it after the discussion yesterday.

No, your original patch was correct. This patch doesn't work correctly
for URLs constructed with a zero port.

As I said in my previous mail Eclipse creates such URLs.
See for example what the following gives with your new patch:
new URL("file", null, 0, "somedir/somefile").toString();

Please change it back to read:
	if (port > 0).

BTW. The above example should also make the comment (that your new patch
now also removes) more clear. Another solution would be to not print the
port number when the host field is null, but we choose not to do this
since we think that is not according to spec (even though some
implementations seem to do it that way).

Cheers,

Mark



More information about the Java-patches mailing list