This is the mail archive of the
java-patches@sourceware.cygnus.com
mailing list for the Java project.
Patch: minor FirstThread cleanup
- To: Java Patch List <java-patches at sourceware dot cygnus dot com>
- Subject: Patch: minor FirstThread cleanup
- From: Tom Tromey <tromey at cygnus dot com>
- Date: 23 Sep 1999 13:04:24 -0600
- Reply-To: tromey at cygnus dot com
I'm checking in the appended patch. It removes the `run0' and the
exception catching code from FirstThread. This code shouldn't be
needed -- any uncaught exception should be caught be Thread.run_ and
passed to the ThreadGroup. If this doesn't happen, then we should fix
the bug where it actually occurs (wherever that might be). (I don't
see the bug myself.)
1999-09-23 Tom Tromey <tromey@cygnus.com>
* java/lang/natFirstThread.cc (run): Renamed from `run0'. Removed
dead code.
* java/lang/FirstThread.java (run0): Renamed to `run'.
(run): Removed.
Tom
Index: java/lang/FirstThread.java
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/FirstThread.java,v
retrieving revision 1.2
diff -u -r1.2 FirstThread.java
--- FirstThread.java 1999/08/08 14:06:22 1.2
+++ FirstThread.java 1999/09/23 19:00:20
@@ -19,16 +19,7 @@
final class FirstThread extends Thread
{
- public native void run0 ();
- public void run ()
- {
- try {
- run0 ();
- } catch (Throwable ex) {
- System.err.println ("uncaught exception at top level");
- ex.printStackTrace ();
- }
- }
+ public native void run ();
public FirstThread (ThreadGroup g, Class k, Object o)
{
Index: java/lang/natFirstThread.cc
===================================================================
RCS file: /cvs/java/libgcj/libjava/java/lang/natFirstThread.cc,v
retrieving revision 1.3
diff -u -r1.3 natFirstThread.cc
--- natFirstThread.cc 1999/09/10 22:03:08 1.3
+++ natFirstThread.cc 1999/09/23 19:00:20
@@ -27,19 +27,10 @@
typedef void main_func (jobject);
void
-java::lang::FirstThread::run0 (void)
+java::lang::FirstThread::run (void)
{
Utf8Const* main_signature = _Jv_makeUtf8Const ("([Ljava.lang.String;)V", 22);
Utf8Const* main_name = _Jv_makeUtf8Const ("main", 4);
-
-#if 0
- // Note: this turns out to be more painful than useful. Apparently
- // many people rely on being able to have main in a non-public
- // class.
- // This is based on my reading of 12.3.3.
- if (! java::lang::reflect::Modifier::isPublic(klass->getModifiers()))
- DIE ("class must be public");
-#endif
if (klass == NULL)
{