Commit 35a6c873 by Jeroen Frijters Committed by Michael Koch

URLClassLoader.java (addURL): Moved implementation to private addURLImpl() to…

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
parent 01482e6d
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().
2003-07-18 Graydon Hoare <graydon@redhat.com> 2003-07-18 Graydon Hoare <graydon@redhat.com>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c: * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c:
......
...@@ -311,6 +311,9 @@ public class URLClassLoader extends SecureClassLoader ...@@ -311,6 +311,9 @@ public class URLClassLoader extends SecureClassLoader
if (jarfile == null) if (jarfile == null)
return null; return null;
if (name.startsWith("/"))
name = name.substring(1);
JarEntry je = jarfile.getJarEntry(name); JarEntry je = jarfile.getJarEntry(name);
if(je != null) if(je != null)
return new JarURLResource(this, name, je); return new JarURLResource(this, name, je);
...@@ -654,6 +657,11 @@ public class URLClassLoader extends SecureClassLoader ...@@ -654,6 +657,11 @@ public class URLClassLoader extends SecureClassLoader
*/ */
protected void addURL(URL newUrl) protected void addURL(URL newUrl)
{ {
addURLImpl(newUrl);
}
private void addURLImpl(URL newUrl)
{
synchronized(urlloaders) synchronized(urlloaders)
{ {
if (newUrl == null) if (newUrl == null)
...@@ -690,7 +698,7 @@ public class URLClassLoader extends SecureClassLoader ...@@ -690,7 +698,7 @@ public class URLClassLoader extends SecureClassLoader
{ {
for (int i = 0; i < newUrls.length; i++) for (int i = 0; i < newUrls.length; i++)
{ {
addURL(newUrls[i]); addURLImpl(newUrls[i]);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment