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: MainThread -vs- class loader


I'm checking this in on the trunk and the 4.0 branch.

While implementing java.endorsed.dirs, I discovered that MainThread
tries to load the main class using its own class loader.  However, it
is probable that MainThread is loaded by the bootstrap loader, while
it needs to load the main class using the system class loader.  (At
the moment libgcj incorrect conflates these.)

This patch fixes the problem.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* gnu/java/lang/MainThread.java (run): Load main class using
	system class loader.

Index: gnu/java/lang/MainThread.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/java/lang/MainThread.java,v
retrieving revision 1.3
diff -u -r1.3 MainThread.java
--- gnu/java/lang/MainThread.java 12 Feb 2005 13:51:10 -0000 1.3
+++ gnu/java/lang/MainThread.java 16 Mar 2005 23:26:41 -0000
@@ -1,5 +1,5 @@
 /* gnu.java.lang.MainThread
-   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004
+   Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
    Free Software Foundation, Inc.
 
 This file is part of GNU Classpath.
@@ -91,7 +91,8 @@
       {
         try
 	  {
-	    klass = Class.forName(klass_name);
+	    klass = Class.forName(klass_name, true,
+				  ClassLoader.getSystemClassLoader());
 	  }
 	catch (ClassNotFoundException x)
 	  {


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