From 5bb3fc271351cc0e0d99f85bf0a491078352e81f Mon Sep 17 00:00:00 2001 From: Michael Koch Date: Fri, 24 Sep 2004 06:51:59 +0000 Subject: [PATCH] [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 --- libjava/ChangeLog | 9 +++++++++ libjava/java/net/URL.java | 4 +++- 2 files changed, 12 insertions(+), 1 deletion(-) 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(); -- 2.30.2