[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] Patch: FYI: MainThread -vs- class loader
From: |
Tom Tromey |
Subject: |
[cp-patches] Patch: FYI: MainThread -vs- class loader |
Date: |
16 Mar 2005 16:41:30 -0700 |
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 <address@hidden>
* 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 -0000 1.6
+++ gnu/java/lang/MainThread.java 16 Mar 2005 23:41:43 -0000
@@ -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);
- [cp-patches] Patch: FYI: MainThread -vs- class loader,
Tom Tromey <=