Proposal: ARM and SuppressedException
Neal Gafter
neal at gafter.com
Mon Sep 7 10:08:54 PDT 2009
I have a problem with this from a software engineering point of view. While
you've certainly found a place to put these exceptions without adding any
further fields, it's hard to see how making the suppressed exception
masquerade as a cause of some other exception will assist in locating or
diagnosing the problem.
On the other hand, this isn't much worse than the current proposal. It's to
see how the current proposal supports handling of suppressed exceptions,
unless code to check for them are sprinkled liberally throughout (the
exception handlers of) a code base.
2009/9/7 Frédéric Martini <frederic.martini at gmail.com>
> Hello (and sorry for my poor english),
>
>
> I've juste reading the most recent version of the proposal :
> http://docs.google.com/View?id=ddv8ts74_3fs7483dp
> And I've a suggestion about the suppressed's exception.
>
>
> Instead of adding addSuppressedException()/getSuppressedExceptions() to
> throwable, we can use the "initCause" to store the suppressed exception.
> For example by adding a method like this on Throwable :
>
>
>
> public void addInitCause(Throwable suppressedException) {
> Throwable t = this;
> while (t.getCause()!=null) {
> t = t.getCause();
> }
> t.initCause(suppressedException);
> }
>
>
>
> So we have not need to modify the printStackTrace()'s method, the
> suppressed's exception will be added at the end of the initCause...
>
>
> Fred,
>
>
More information about the coin-dev
mailing list