David,

The last two paragraphs of Throwable.addSuppressed cover this.  The first is 
your argument bellow and does not forbid anything it claims.  The last 
paragraph explicitly enables this patch.

Jason

> Date: Mon, 15 Apr 2013 12:56:42 +1000
> From: david.hol...@oracle.com
> To: joe.da...@oracle.com
> CC: jason_mehr...@hotmail.com; core-libs-dev@openjdk.java.net
> Subject: Re: Code review request for 8012044: Give more information about 
> self-suppression from Throwable.addSuppressed
> 
> On 13/04/2013 5:08 AM, Joe Darcy wrote:
> > On 04/12/2013 11:22 AM, Jason Mehrens wrote:
> >> The landmines are the retrofitted exception classes as shown here
> >> https://netbeans.org/bugzilla/show_bug.cgi?id=150969 and
> >> https://issues.jboss.org/browse/JBREM-552. Really, if the ISE or IAE
> >> is thrown it is going to suppress 'this' and 'cause'. It would be
> >> nice to see the given 'cause' show up in a log file when tracking down
> >> this type of bug.
> >
> > Okay; fair enough. Updated webrev covering initCause too at
> >
> > http://cr.openjdk.java.net/~darcy/8012044.1/
> >
> > New patch below.
> >
> > (It is a bit of stretch to have this in initiCause by listed as the
> > "cause" of the IllegalStateException; as an alternative, the
> > IllegalStateException could have both this and the cause as suppressed
> > exceptions.)
> 
> I don't think that is valid for initCause. If I call initCause twice in 
> succession there need not even be any exception propagation in progress. 
> The ISE that gets thrown is not suppressing anything.
> 
> For setSuppressed this might make sense for the compiler generated 
> sequences, but again if I just called setSuppressed with an invalid 
> value, the ISE is not suppressing any existing exception.
> 
> David                                           

Reply via email to