This is the mail archive of the
mailing list for the Java project.
Re: FYI: Patch: java.net.URLStreamHandler
On Oct 30, 2003, at 11:54 AM, Mark Wielaard wrote:
BTW. The above example should also make the comment (that your new
now also removes) more clear. Another solution would be to not print
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).
If we print the port number without a host name, then (I suspect) it
would not be a valid URL. The best solution IMO would be to change it
to something like:
if (hostName.length() == 0)
.. print hostname ...
if (port >= 0)
... print port
This way we can get rid of the comment, and match the JDK behaviour.
(0 actually is a valid TCP port number, iirc, so I guess we should be
able to print it)