Re: [cp-patches] Patch: FYI: MainThread -vs- class loader

2005-03-17 Thread Tom Tromey
> "Michael" == Michael Koch <[EMAIL PROTECTED]> writes:

>> While implementing java.endorsed.dirs, I discovered that MainThread
>> tries to load the main class using its own class loader.

Michael> Can you put a mauve testcase of this into CVS? I know some
Michael> VMs dont use gnu.java.lang.MainThread yet.

With this bug in place, on a non-buggy VM using MainThread, Mauve will
fail to start at all, because SimpleTestHarness will not be found.  So
in a sense there is already a test case.

Tom


___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


Re: [cp-patches] Patch: FYI: MainThread -vs- class loader

2005-03-16 Thread Michael Koch
On Wed, Mar 16, 2005 at 04:41:30PM -0700, Tom Tromey wrote:
> I'm checking this in.
> I'm going to put something similar in libgcj shortly.
> 
> 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.
> 
> This patch fixes the problem.

Can you put a mauve testcase of this into CVS? I know some VMs dont use
gnu.java.lang.MainThread yet.


Michael
-- 
Java Trap: http://www.gnu.org/philosophy/java-trap.html


___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches


[cp-patches] Patch: FYI: MainThread -vs- class loader

2005-03-16 Thread Tom Tromey
I'm checking this in.
I'm going to put something similar in libgcj shortly.

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.

This patch fixes the problem.

Tom

Index: ChangeLog
from  Tom Tromey  <[EMAIL PROTECTED]>

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

Index: gnu/java/lang/MainThread.java
===
RCS file: /cvsroot/classpath/classpath/gnu/java/lang/MainThread.java,v
retrieving revision 1.6
diff -u -r1.6 MainThread.java
--- gnu/java/lang/MainThread.java 2 Mar 2005 17:29:08 - 1.6
+++ gnu/java/lang/MainThread.java 16 Mar 2005 23:41:43 -
@@ -57,7 +57,8 @@
   public MainThread(String classname, String[] args)
 throws ClassNotFoundException, NoSuchMethodException
   {
-Class found = Class.forName(classname);
+Class found = Class.forName(classname, true,
+   ClassLoader.getSystemClassLoader());
 Class[] argTypes = new Class[1];
 argTypes[0] = args.getClass();
 mainMethod = found.getMethod("main", argTypes);


___
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches