[Patch] java.net.URL fixes

Michael Koch konqueror@gmx.de
Sat Sep 25 07:15:00 GMT 2004


Hi list,


I just commited the attached patch to port two fixes for java.net.URL
from GNU classpath.


Michael


2004-09-24  Guilhem Lavaux  <guilhem@kaffe.org>

	* java/net/URL.java (URL): Delete whitespaces in the protocol string.

2004-09-24  Jeroen Frijters  <jeroen@frijters.net>

	* java/net/URL.java (URL(String,String,int,String,URLStreamHandler):
	Don't set authority if host isn't specified.

-------------- next part --------------
Index: java/net/URL.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/URL.java,v
retrieving revision 1.39
diff -u -r1.39 URL.java
--- java/net/URL.java	23 Sep 2004 00:34:09 -0000	1.39
+++ java/net/URL.java	24 Sep 2004 06:50:44 -0000
@@ -284,7 +284,7 @@
     this.host = host;
     this.port = port;
     this.authority = (host != null) ? host : "";
-    if (port >= 0)
+    if (port >= 0 && host != null)
 	this.authority += ":" + port;
 
     int hashAt = file.indexOf('#');
@@ -427,6 +427,8 @@
 
       throw new MalformedURLException("Absolute URL required with null context");
 
+    protocol = protocol.trim();
+
     if (ph != null)
       {
 	SecurityManager s = System.getSecurityManager();


More information about the Java-patches mailing list