diff options
author | Michael Koch <konqueror@gmx.de> | 2003-06-11 14:47:43 +0000 |
---|---|---|
committer | Michael Koch <konqueror@gmx.de> | 2003-06-11 14:47:43 +0000 |
commit | 8d5ea26b3078d5690c51a35573a3135eccf244d5 (patch) | |
tree | 0eb6e20f53b28bd6117f6906f26343ed5afd4e17 /java/net/URLStreamHandler.java | |
parent | 30ce549cae89af374b3dc2b4f42f52c26d7029cb (diff) | |
download | classpath-8d5ea26b3078d5690c51a35573a3135eccf244d5.tar.gz |
2003-06-11 Michael Koch <konqueror@gmx.de>
* java/net/URL.java,
java/net/URLStreamHandler.java:
New versions from libgcj.
Diffstat (limited to 'java/net/URLStreamHandler.java')
-rw-r--r-- | java/net/URLStreamHandler.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/java/net/URLStreamHandler.java b/java/net/URLStreamHandler.java index 37183b963..604279def 100644 --- a/java/net/URLStreamHandler.java +++ b/java/net/URLStreamHandler.java @@ -265,7 +265,15 @@ public abstract class URLStreamHandler return true; // This comparison is very conservative. It assumes that any // field can be null. - if (url1 == null || url2 == null || url1.getPort() != url2.getPort()) + if (url1 == null || url2 == null) + return false; + int p1 = url1.getPort (); + if (p1 == -1) + p1 = url1.handler.getDefaultPort (); + int p2 = url2.getPort (); + if (p2 == -1) + p2 = url2.handler.getDefaultPort (); + if (p1 != p2) return false; String s1, s2; s1 = url1.getProtocol(); |