summaryrefslogtreecommitdiffstats
path: root/libjava/java/lang/ExceptionInInitializerError.java
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-12 07:40:17 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2001-03-12 07:40:17 +0000
commit6b6cc52d60b3de64f4106210649903319b5a5ebe (patch)
treeea1cde64a91671a886ba0332dcbc3874ff477611 /libjava/java/lang/ExceptionInInitializerError.java
parentaab9bda6498c0c9344edf5e5822c9f190c3d2dc0 (diff)
downloadppe42-gcc-6b6cc52d60b3de64f4106210649903319b5a5ebe.tar.gz
ppe42-gcc-6b6cc52d60b3de64f4106210649903319b5a5ebe.zip
2001-03-12 Bryce McKinlay <bryce@albatross.co.nz>
* java/lang/Runtime.java (_exit): Declare new package-private native. * java/lang/natRuntime.cc (_exit): Implemented. Same as exit() but without a security manager check. (exit): Call _exit after security check. * prims.cc (JvRunMain): Call Runtime._exit to shutdown the runtime "naturally". * java/lang/System.java (setSecurityManager): If a security manager is already in place, call checkPermission. * java/lang/ThreadGroup.java (uncaughtException): If printStackTrace() throws an exception, try to deal with it gracefully. * java/lang/ExceptionInInitializerError.java (printStackTrace): Only try to print the subordinate stack trace if "exception" is set. Print our class name first. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@40401 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/java/lang/ExceptionInInitializerError.java')
-rw-r--r--libjava/java/lang/ExceptionInInitializerError.java28
1 files changed, 23 insertions, 5 deletions
diff --git a/libjava/java/lang/ExceptionInInitializerError.java b/libjava/java/lang/ExceptionInInitializerError.java
index 0aad2fc89ea..95b4311c174 100644
--- a/libjava/java/lang/ExceptionInInitializerError.java
+++ b/libjava/java/lang/ExceptionInInitializerError.java
@@ -1,6 +1,6 @@
// ExceptionInInitializerError.java
-/* Copyright (C) 1998, 1999, 2000 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
This file is part of libgcj.
@@ -38,7 +38,7 @@ public class ExceptionInInitializerError extends LinkageError
public ExceptionInInitializerError (Throwable e)
{
- super ();
+ super (e.toString());
exception = e;
}
@@ -49,17 +49,35 @@ public class ExceptionInInitializerError extends LinkageError
public void printStackTrace ()
{
- exception.printStackTrace ();
+ if (exception != null)
+ {
+ System.err.print (this.getClass() + ": ");
+ exception.printStackTrace ();
+ }
+ else
+ super.printStackTrace ();
}
public void printStackTrace (PrintStream ps)
{
- exception.printStackTrace (ps);
+ if (exception != null)
+ {
+ ps.print (this.getClass() + ": ");
+ exception.printStackTrace (ps);
+ }
+ else
+ super.printStackTrace (ps);
}
public void printStackTrace (PrintWriter pw)
{
- exception.printStackTrace (pw);
+ if (exception != null)
+ {
+ pw.print (this.getClass() + ": ");
+ exception.printStackTrace (pw);
+ }
+ else
+ super.printStackTrace (pw);
}
// The exception that caused this error.
OpenPOWER on IntegriCloud