* java/net/URLStreamHandler.java (toExternalForm): Ignore port
authormark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Dec 2002 22:41:10 +0000 (22:41 +0000)
committermark <mark@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 30 Dec 2002 22:41:10 +0000 (22:41 +0000)
if zero or smaller.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@60657 138bc75d-0d04-0410-961f-82ee72b054a4

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

index eba4d6b..9c2bd53 100644 (file)
@@ -1,5 +1,10 @@
 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
        default case after escaping character.
 
index 128a0d2..7f86644 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);