This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: RFA: Fix PR libgcj/17623
- From: David Daney <ddaney at avtrex dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Wed, 22 Sep 2004 15:14:23 -0700
- Subject: Patch: RFA: Fix PR libgcj/17623
As it says in the PR, currently the URL(URL, String, URLStreamHandler)
constructor does not preserve the userInfo from the context URL.
This patch fixes the problem and is necessary (but not sufficient) for
jcifs to run. Patches to follow will fix remaining problems.
See: http://jcifs.samba.org/
Currently testing with a make -k check in libjava on i686-pc-linux-gnu.
OK to commit if no regressions?
David Daney.
2004-09-22 David Daney <ddaney@avtrex.com>
PR libgcj/17623
* java/net/URL.java (URL): Copy userInfo from context.
(getUserInfo): Return cached userInfo if present.
Index: java/net/URL.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/net/URL.java,v
retrieving revision 1.38
diff -c -p -r1.38 URL.java
*** java/net/URL.java 4 Jul 2004 02:12:58 -0000 1.38
--- java/net/URL.java 22 Sep 2004 21:55:47 -0000
***************
*** 1,5 ****
/* URL.java -- Uniform Resource Locator Class
! Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
--- 1,6 ----
/* URL.java -- Uniform Resource Locator Class
! Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
! Free Software Foundation, Inc.
This file is part of GNU Classpath.
*************** public final class URL implements Serial
*** 401,406 ****
--- 402,408 ----
host = context.host;
port = context.port;
file = context.file;
+ userInfo = context.userInfo;
if (file == null || file.length() == 0)
file = "/";
authority = context.authority;
*************** public final class URL implements Serial
*** 415,420 ****
--- 417,423 ----
host = context.host;
port = context.port;
file = context.file;
+ userInfo = context.userInfo;
if (file == null || file.length() == 0)
file = "/";
authority = context.authority;
*************** public final class URL implements Serial
*** 612,617 ****
--- 615,622 ----
*/
public String getUserInfo()
{
+ if(userInfo != null)
+ return userInfo;
int at = (host == null) ? -1 : host.indexOf('@');
return at < 0 ? null : host.substring(0, at);
}