OSDN Git Service

2004-09-24 Guilhem Lavaux <guilhem@kaffe.org>
authormkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Sep 2004 06:51:59 +0000 (06:51 +0000)
committermkoch <mkoch@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 24 Sep 2004 06:51:59 +0000 (06:51 +0000)
* 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.

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

libjava/ChangeLog
libjava/java/net/URL.java

index 1a43194..234a0f3 100644 (file)
@@ -1,3 +1,12 @@
+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.
+
 2004-09-24  Michael Koch  <konqueror@gmx.de>
 
        * gnu/java/nio/PipeImpl.java: Use VMPipe for native stuff.
index 37ddc0f..bc891f4 100644 (file)
@@ -284,7 +284,7 @@ public final class URL implements Serializable
     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 @@ public final class URL implements Serializable
 
       throw new MalformedURLException("Absolute URL required with null context");
 
+    protocol = protocol.trim();
+
     if (ph != null)
       {
        SecurityManager s = System.getSecurityManager();