re PR libgcj/17623 (URL does not retain userInfo across context constructor.)
PR libgcj/17623 * java/net/URL.java (URL): Copy userInfo from context. (getUserInfo): Return cached userInfo if present. From-SVN: r87909
This commit is contained in:
parent
dfb77e3751
commit
d0259e11e7
2 changed files with 12 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
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.
|
||||||
|
|
||||||
2004-09-22 Tom Tromey <tromey@redhat.com>
|
2004-09-22 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
PR libgcj/6182:
|
PR libgcj/6182:
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
/* URL.java -- Uniform Resource Locator Class
|
/* URL.java -- Uniform Resource Locator Class
|
||||||
Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
|
Copyright (C) 1998, 1999, 2000, 2002, 2003, 2004
|
||||||
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
This file is part of GNU Classpath.
|
This file is part of GNU Classpath.
|
||||||
|
|
||||||
|
@ -401,6 +402,7 @@ public final class URL implements Serializable
|
||||||
host = context.host;
|
host = context.host;
|
||||||
port = context.port;
|
port = context.port;
|
||||||
file = context.file;
|
file = context.file;
|
||||||
|
userInfo = context.userInfo;
|
||||||
if (file == null || file.length() == 0)
|
if (file == null || file.length() == 0)
|
||||||
file = "/";
|
file = "/";
|
||||||
authority = context.authority;
|
authority = context.authority;
|
||||||
|
@ -415,6 +417,7 @@ public final class URL implements Serializable
|
||||||
host = context.host;
|
host = context.host;
|
||||||
port = context.port;
|
port = context.port;
|
||||||
file = context.file;
|
file = context.file;
|
||||||
|
userInfo = context.userInfo;
|
||||||
if (file == null || file.length() == 0)
|
if (file == null || file.length() == 0)
|
||||||
file = "/";
|
file = "/";
|
||||||
authority = context.authority;
|
authority = context.authority;
|
||||||
|
@ -612,6 +615,8 @@ public final class URL implements Serializable
|
||||||
*/
|
*/
|
||||||
public String getUserInfo()
|
public String getUserInfo()
|
||||||
{
|
{
|
||||||
|
if (userInfo != null)
|
||||||
|
return userInfo;
|
||||||
int at = (host == null) ? -1 : host.indexOf('@');
|
int at = (host == null) ? -1 : host.indexOf('@');
|
||||||
return at < 0 ? null : host.substring(0, at);
|
return at < 0 ? null : host.substring(0, at);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue