From: Michael Koch Date: Fri, 24 Sep 2004 06:51:59 +0000 (+0000) Subject: [multiple changes] X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5bb3fc271351cc0e0d99f85bf0a491078352e81f;p=gcc.git [multiple changes] 2004-09-24 Guilhem Lavaux * java/net/URL.java (URL): Delete whitespaces in the protocol string. 2004-09-24 Jeroen Frijters * java/net/URL.java (URL(String,String,int,String,URLStreamHandler): Don't set authority if host isn't specified. From-SVN: r88015 --- diff --git a/libjava/ChangeLog b/libjava/ChangeLog index 1a43194cd23..234a0f3bda3 100644 --- a/libjava/ChangeLog +++ b/libjava/ChangeLog @@ -1,3 +1,12 @@ +2004-09-24 Guilhem Lavaux + + * java/net/URL.java (URL): Delete whitespaces in the protocol string. + +2004-09-24 Jeroen Frijters + + * java/net/URL.java (URL(String,String,int,String,URLStreamHandler): + Don't set authority if host isn't specified. + 2004-09-24 Michael Koch * gnu/java/nio/PipeImpl.java: Use VMPipe for native stuff. diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java index 37ddc0f6cd4..bc891f45344 100644 --- a/libjava/java/net/URL.java +++ b/libjava/java/net/URL.java @@ -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();