diff options
author | daney <daney@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-23 00:34:09 +0000 |
---|---|---|
committer | daney <daney@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-23 00:34:09 +0000 |
commit | b6d23d1ade75a0eeb78464bf2ed4795efcf8f2b3 (patch) | |
tree | dab349a2a8a7e8e9c0d52ceedeaaf2ee208f2d47 /libjava/java/net/URL.java | |
parent | e5d424c90f4ce7ab804191fdb165f03c179661b7 (diff) | |
download | ppe42-gcc-b6d23d1ade75a0eeb78464bf2ed4795efcf8f2b3.tar.gz ppe42-gcc-b6d23d1ade75a0eeb78464bf2ed4795efcf8f2b3.zip |
PR libgcj/17623
* java/net/URL.java (URL): Copy userInfo from context.
(getUserInfo): Return cached userInfo if present.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87909 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/net/URL.java')
-rw-r--r-- | libjava/java/net/URL.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java index 7357c7529b8..37ddc0f6cd4 100644 --- a/libjava/java/net/URL.java +++ b/libjava/java/net/URL.java @@ -1,5 +1,6 @@ /* 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. @@ -401,6 +402,7 @@ public final class URL implements Serializable host = context.host; port = context.port; file = context.file; + userInfo = context.userInfo; if (file == null || file.length() == 0) file = "/"; authority = context.authority; @@ -415,6 +417,7 @@ public final class URL implements Serializable host = context.host; port = context.port; file = context.file; + userInfo = context.userInfo; if (file == null || file.length() == 0) file = "/"; authority = context.authority; @@ -612,6 +615,8 @@ public final class URL implements Serializable */ public String getUserInfo() { + if (userInfo != null) + return userInfo; int at = (host == null) ? -1 : host.indexOf('@'); return at < 0 ? null : host.substring(0, at); } |