URLStreamHandler.java (toExternalForm): Ignore port if zero or smaller.
* java/net/URLStreamHandler.java (toExternalForm): Ignore port if zero or smaller. From-SVN: r60657
This commit is contained in:
committed by
Mark Wielaard
parent
582f6e6d63
commit
a88c283f0d
@@ -436,7 +436,7 @@ public abstract class URLStreamHandler
|
||||
// ignores a non-default port if host is null or "". That is inconsistent
|
||||
// with the spec since the result of this method is spec'ed so it can be
|
||||
// used to construct a new URL that is equivalent to the original.
|
||||
boolean port_needed = port >= 0 && port != getDefaultPort();
|
||||
boolean port_needed = port > 0 && port != getDefaultPort();
|
||||
if (port_needed)
|
||||
sb.append(':').append(port);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user