[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] Absolute URL parsing bug
From: |
Andrew Haley |
Subject: |
[cp-patches] Absolute URL parsing bug |
Date: |
Fri, 1 Jul 2005 17:48:22 +0100 |
This URL is an absolute URL because its path begins with a "/":
"jar:file:/usr/src/redhat/BUILD/jonas-4.3.3/jonas/output/JONAS_4_3_3/examples/webservices/beans/ws/temp/ejbjars/ws.jar!/META-INF/wsdl/ssbEndpoint.wsdl"
[ An absolute file URL can look like:
absoluteURI = "file" ":" abs_path
abs_path = "/" path_segments
That is, there is no need for "//". And indeed, the URL spec in the
SDK docs says 'If the spec's path component begins with a slash
character "/" then the path is treated as absolute...' ]
But we parse the spec looking for "//" to determine if a URL is
absolute, and this is wrong. So, I suggest this patch.
This bug was found because it breaks the JOnAS build.
Andrew.
2005-07-01 Andrew Haley <address@hidden>
* java/net/URL.java: Look only for "/" at the start of an absolute
path, not "//".
Index: java/net/URL.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/URL.java,v
retrieving revision 1.51
diff -p -2 -u -r1.51 URL.java
--- java/net/URL.java 27 Apr 2005 20:10:07 -0000 1.51
+++ java/net/URL.java 1 Jul 2005 16:39:22 -0000
@@ -389,10 +389,11 @@ public final class URL implements Serial
// If this is an absolute URL, then ignore context completely.
- // An absolute URL must have chars prior to "://" but cannot have a colon
- // right after the "://". The second colon is for an optional port value
+ // If this is an absolute URL, then ignore context completely.
+ // An absolute URL must have chars prior to ":/" but cannot have a colon
+ // right after "://". The second colon is for an optional port value
// and implies that the host from the context is used if available.
int colon;
int slash = spec.indexOf('/');
- if ((colon = spec.indexOf("://", 1)) > 0
+ if ((colon = spec.indexOf(":/", 1)) > 0
&& ((colon < slash || slash < 0))
&& ! spec.regionMatches(colon, "://:", 0, 4))
- [cp-patches] Absolute URL parsing bug,
Andrew Haley <=
- [cp-patches] Re: Absolute URL parsing bug, Per Bothner, 2005/07/01
- [cp-patches] Re: Absolute URL parsing bug, Andrew Haley, 2005/07/02
- [cp-patches] Re: Absolute URL parsing bug, Per Bothner, 2005/07/02
- [cp-patches] Re: Absolute URL parsing bug, Andrew Haley, 2005/07/04
- [cp-patches] Re: Absolute URL parsing bug, Andrew Haley, 2005/07/04
- Re: [cp-patches] Re: Absolute URL parsing bug, Mark Wielaard, 2005/07/05
- Re: [cp-patches] Re: Absolute URL parsing bug, Andrew Haley, 2005/07/05
- Re: [cp-patches] Re: Absolute URL parsing bug, Andrew Haley, 2005/07/07
- [cp-patches] Re: Absolute URL parsing bug, Per Bothner, 2005/07/05
- [cp-patches] Re: Absolute URL parsing bug, Tom Tromey, 2005/07/02