diff options
author | Jeroen Frijters <jeroen@sumatra.nl> | 2003-07-19 17:47:56 +0200 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2003-07-19 15:47:56 +0000 |
commit | 35a6c8736ad32b6c47af367c3ce08bb61281eccc (patch) | |
tree | 7f896d9cf996acf8b20cd46f74bc4781e0b2f668 /libjava/java | |
parent | 01482e6dedf200137f9a7aa57d3c585bbc81b1c9 (diff) | |
download | gcc-35a6c8736ad32b6c47af367c3ce08bb61281eccc.zip gcc-35a6c8736ad32b6c47af367c3ce08bb61281eccc.tar.gz gcc-35a6c8736ad32b6c47af367c3ce08bb61281eccc.tar.bz2 |
URLClassLoader.java (addURL): Moved implementation to private addURLImpl() to avoid calling addURL from the...
2003-07-19 Jeroen Frijters <jeroen@sumatra.nl>
* java/net/URLClassLoader.java (addURL): Moved implementation to
private addURLImpl() to avoid calling addURL from the constructor.
(addURLImpl): Contains the code that was previously in addURL.
(addURLs): Call addURLImpl(), not addURL().
From-SVN: r69591
Diffstat (limited to 'libjava/java')
-rw-r--r-- | libjava/java/net/URLClassLoader.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/libjava/java/net/URLClassLoader.java b/libjava/java/net/URLClassLoader.java index 10b6735..9a468bf 100644 --- a/libjava/java/net/URLClassLoader.java +++ b/libjava/java/net/URLClassLoader.java @@ -311,6 +311,9 @@ public class URLClassLoader extends SecureClassLoader if (jarfile == null) return null; + if (name.startsWith("/")) + name = name.substring(1); + JarEntry je = jarfile.getJarEntry(name); if(je != null) return new JarURLResource(this, name, je); @@ -654,6 +657,11 @@ public class URLClassLoader extends SecureClassLoader */ protected void addURL(URL newUrl) { + addURLImpl(newUrl); + } + + private void addURLImpl(URL newUrl) + { synchronized(urlloaders) { if (newUrl == null) @@ -690,7 +698,7 @@ public class URLClassLoader extends SecureClassLoader { for (int i = 0; i < newUrls.length; i++) { - addURL(newUrls[i]); + addURLImpl(newUrls[i]); } } |