URLStreamHandler.java (toExternalForm): Ignore port if zero or smaller.
authorMark Wielaard <mark@klomp.org>
Mon, 30 Dec 2002 22:41:10 +0000 (22:41 +0000)
committerMark Wielaard <mark@gcc.gnu.org>
Mon, 30 Dec 2002 22:41:10 +0000 (22:41 +0000)
* java/net/URLStreamHandler.java (toExternalForm): Ignore port
if zero or smaller.

From-SVN: r60657

libjava/ChangeLog
libjava/java/net/URLStreamHandler.java

index eba4d6b9b1c962801730cea7b5c6edef5ffc1206..9c2bd53281613c6f9311f40d2f494348c94297b3 100644 (file)
@@ -1,3 +1,8 @@
+2002-12-30  Mark Wielaard  <mark@klomp.org>
+
+       * java/net/URLStreamHandler.java (toExternalForm): Ignore port
+       if zero or smaller.
+
 2002-12-30  Mark Wielaard  <mark@klomp.org>
 
        * java/util/Properties (formatForOutput): Don't fall through to
index 128a0d2d3da0bc1b1d8df60ba2e813d4aeb03b5c..7f866440f2f68fe5919ab3bd2e05fbb74f1cfd42 100644 (file)
@@ -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);