aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/net/URL.java
diff options
context:
space:
mode:
authorMichael Koch <mkoch@gcc.gnu.org>2004-09-24 06:51:59 +0000
committerMichael Koch <mkoch@gcc.gnu.org>2004-09-24 06:51:59 +0000
commit5bb3fc271351cc0e0d99f85bf0a491078352e81f (patch)
tree493475f4231f981378d82dc0ffb1b3154b99c857 /libjava/java/net/URL.java
parent9e54846fac74773abd332da983f911334baa2c41 (diff)
downloadgcc-5bb3fc271351cc0e0d99f85bf0a491078352e81f.zip
gcc-5bb3fc271351cc0e0d99f85bf0a491078352e81f.tar.gz
gcc-5bb3fc271351cc0e0d99f85bf0a491078352e81f.tar.bz2
[multiple changes]
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. From-SVN: r88015
Diffstat (limited to 'libjava/java/net/URL.java')
-rw-r--r--libjava/java/net/URL.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java
index 37ddc0f..bc891f4 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();