This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Absolute URL parsing bug


Thanks to Per's reasoning I have a better patch.  

When creating a URL: if the spec is absolute and a context URL is
supplied, we should inherit the host:port part of the context if its
protocol the same as that of the spec, but we should not inherit its
file path.

Andrew.



2005-07-04  Andrew Haley  <aph@redhat.com>

	* java/net/URL.java (URL): Don't inherit the path component when
	the scheme component of the context matches the scheme component
	of the spec.
 
Index: URL.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/URL.java,v
retrieving revision 1.51
diff -p -2 -c -r1.51 URL.java
*** URL.java	27 Apr 2005 20:10:07 -0000	1.51
--- URL.java	4 Jul 2005 16:45:42 -0000
*************** public final class URL implements Serial
*** 409,413 ****
  	    host = context.host;
  	    port = context.port;
- 	    file = context.file;
              userInfo = context.userInfo;
  	    if (file == null || file.length() == 0)
--- 409,412 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]