This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
JDK 1.4 Exceptions merge from classpath
- From: Andrew Haley <aph at cambridge dot redhat dot com>
- To: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Cc: java-patches at gcc dot gnu dot org
- Date: Fri, 24 May 2002 13:45:13 +0100 (BST)
- Subject: JDK 1.4 Exceptions merge from classpath
- References: <3CEE17F3.7030502@waitaki.otago.ac.nz>
Bryce McKinlay writes:
> This patch merges in most of the JDK 1.4-style exception chaining
> support that Mark Wielaard and Eric Blake implemented in classpath.
> Throwable isn't completely merged, the "cause" property is there but
> printStackTrace() doesn't use it yet. The next step will be to refactor
> fillInStackTrace() to fill out StackTraceElements and for
> printStackTrace() to use them.
There's a slight problem with this.
fillInStackTrace() is called by Throwable's constructor. At the
moment, fillInStackTrace() is very efficient because extracting
filenames and so on is only done when converting to text form. IMO
it'd be better to fill in the members of StackTraceElement lazily. I
think this can be done without breaking any standard interfaces.
Andrew.