This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: FYI: MainThread -vs- class loader
- From: Tom Tromey <tromey at redhat dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: 16 Mar 2005 16:49:41 -0700
- Subject: Patch: FYI: MainThread -vs- class loader
- Reply-to: tromey at redhat dot com
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)
{