Commit e055c067 by Michael Koch Committed by Michael Koch

URLStreamHandler.java (toExternalForm): Print port only if host is printed too…

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
parent f921c9c9
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.
2003-11-10 Gary Benson <gbenson@redhat.com> 2003-11-10 Gary Benson <gbenson@redhat.com>
* java/sql/Timestamp.java (valueOf): Correctly handle * java/sql/Timestamp.java (valueOf): Correctly handle
......
...@@ -478,11 +478,13 @@ public abstract class URLStreamHandler ...@@ -478,11 +478,13 @@ public abstract class URLStreamHandler
} }
if (host.length() != 0) if (host.length() != 0)
sb.append("//").append(host); {
sb.append("//").append(host);
// Append port if port was in URL spec. // Append port if port was in URL spec.
if (port != -1) if (port >= 0)
sb.append(':').append(port); sb.append(':').append(port);
}
sb.append(file); sb.append(file);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment