URLStreamHandler.java (toExternalForm): Print port only if host is printed too and port was really given to URL.
2003-11-11 Micheal Koch <konqueror@gmx.de> * java/net/URLStreamHandler.java (toExternalForm): Print port only if host is printed too and port was really given to URL. From-SVN: r73445
This commit is contained in:
parent
f921c9c9e0
commit
e055c06770
2 changed files with 10 additions and 4 deletions
|
@ -478,11 +478,13 @@ public abstract class URLStreamHandler
|
|||
}
|
||||
|
||||
if (host.length() != 0)
|
||||
sb.append("//").append(host);
|
||||
{
|
||||
sb.append("//").append(host);
|
||||
|
||||
// Append port if port was in URL spec.
|
||||
if (port != -1)
|
||||
sb.append(':').append(port);
|
||||
// Append port if port was in URL spec.
|
||||
if (port >= 0)
|
||||
sb.append(':').append(port);
|
||||
}
|
||||
|
||||
sb.append(file);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue