This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: class loader fix
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 03 Nov 2002 23:08:55 -0700
- Subject: Patch: FYI: class loader fix
- Reply-to: tromey at redhat dot com
I'm checking this in.
This fixes a class loader bug Anthony found tonight.
Tom
Index: ChangeLog
from Tom Tromey <tromey@redhat.com>
* java/lang/ClassLoader.java (loadClass): Call loadClass on
VMClassLoader, not findClass.
Index: java/lang/ClassLoader.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/ClassLoader.java,v
retrieving revision 1.19
diff -u -r1.19 ClassLoader.java
--- java/lang/ClassLoader.java 19 Sep 2002 17:44:49 -0000 1.19
+++ java/lang/ClassLoader.java 4 Nov 2002 01:35:03 -0000
@@ -177,14 +177,18 @@
if (c == null)
{
- try {
- if (parent != null)
- return parent.loadClass (name, link);
- else
- c = gnu.gcj.runtime.VMClassLoader.instance.findClass (name);
- } catch (ClassNotFoundException ex) {
- /* ignore, we'll try findClass */;
- }
+ try
+ {
+ ClassLoader cl = parent;
+ if (parent == null)
+ cl = gnu.gcj.runtime.VMClassLoader.instance;
+ if (cl != this)
+ c = cl.loadClass (name, link);
+ }
+ catch (ClassNotFoundException ex)
+ {
+ /* ignore, we'll try findClass */;
+ }
}
if (c == null)