From db9176e470a9534c9d275dfd3063cedcea603cf5 Mon Sep 17 00:00:00 2001 From: mkoch Date: Fri, 24 Sep 2004 06:51:59 +0000 Subject: 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88015 138bc75d-0d04-0410-961f-82ee72b054a4 --- libjava/java/net/URL.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libjava/java/net') 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(); -- cgit v1.2.3