mirror of
https://github.com/gcc-mirror/gcc.git
synced 2026-05-06 23:25:24 +02:00
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:
committed by
Michael Koch
parent
f921c9c9e0
commit
e055c06770
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user