Somehow this didnt got commited due to full hard disk.
authorMichael Koch <mkoch@gcc.gnu.org>
Wed, 29 Oct 2003 14:44:51 +0000 (14:44 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Wed, 29 Oct 2003 14:44:51 +0000 (14:44 +0000)
From-SVN: r73040

libjava/java/net/URLStreamHandler.java

index 61b466cce6d5d4e1ff60827394c1fddcb8e7209c..9198370d7ad793486733830a5f3f1c36d40f60d3 100644 (file)
@@ -480,12 +480,8 @@ public abstract class URLStreamHandler
     if (host.length() != 0)
       sb.append("//").append(host);
 
-    // Note that this produces different results from JDK 1.2 as JDK 1.2
-    // 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();
-    if (port_needed)
+    // Append port if port was in URL spec.
+    if (port != -1)
       sb.append(':').append(port);
 
     sb.append(file);