[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
This commit is contained in:
Michael Koch 2004-09-24 06:51:59 +00:00
parent 9e54846fac
commit 5bb3fc2713
2 changed files with 12 additions and 1 deletions

View 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();