This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: class loader fix


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)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]