This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: java.net.URLStreamHandler
- From: Michael Koch <konqueror at gmx dot de>
- To: java-patches at gcc dot gnu dot org
- Date: Tue, 28 Oct 2003 20:11:01 +0100
- Subject: Patch: java.net.URLStreamHandler
Hi list,
The attached patch fixes a mauve failure. JDK prints the port number always
if it was present in the URL spec, even if its equal to the default port.
This patch fixes this.
Please review and comment.
Michael
Index: ChangeLog
===================================================================
RCS file: /cvs/gcc/gcc/libjava/ChangeLog,v
retrieving revision 1.2302
diff -u -b -B -r1.2302 ChangeLog
--- ChangeLog 27 Oct 2003 11:02:42 -0000 1.2302
+++ ChangeLog 28 Oct 2003 18:02:59 -0000
@@ -1,3 +1,8 @@
+2003-10-28 Michael Koch <konqueror@gmx.de>
+
+ * java/net/URLStreamHandler.java
+ (toExternalForm): Show port if not -1.
+
2003-10-26 Mark Wielaard <mark@klomp.org>
Reported by Helmer Kraemer <hkraemer@freenet.de>
Index: java/net/URLStreamHandler.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/URLStreamHandler.java,v
retrieving revision 1.21
diff -u -b -B -r1.21 URLStreamHandler.java
--- java/net/URLStreamHandler.java 12 Sep 2003 01:08:18 -0000 1.21
+++ java/net/URLStreamHandler.java 28 Oct 2003 18:02:59 -0000
@@ -484,8 +484,7 @@
// 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)
+ if (port > 0)
sb.append(':').append(port);
sb.append(file);