On 10/17/16 5:16 PM, Paul Sandoz wrote:
On 17 Oct 2016, at 16:36, John Rose <john.r.r...@oracle.com> wrote:
On Oct 17, 2016, at 3:38 PM, Paul Sandoz <paul.san...@oracle.com> wrote:
On 17 Oct 2016, at 15:01, Stuart Marks <stuart.ma...@oracle.com> wrote:

Usually I wrinkle my nose at a throw that's caught by a catch clause later on, 
but in this case it's not obvious what would be better. Maybe a comment is 

In addition to the

// See the "Linking Exceptions" section for the invokedynamic
// instruction in JVMS 6.5.

I can add something like:

// Throws a runtime exception defining the cause that is then later wrapped in 

I agree.  Maybe s/later/in the "catch (Throwable ex)" a few lines below"/, to 
be more specific.

Thanks, updated in place.

The revised comment is a bit more verbose than my taste, but it's fine as it is. The main point is to alert the reader that something unusual is going on.

[from John]
I think the throw-to-catch is good here, unusually, because it funnels all 
exceptions through one point.  That may make somebody's day easier when placing 

Agreed. This approach is indeed unusual, but I think the alternatives are worse: either the BSME wrapping can be replicated at the point of the throw, or it could be refactored into a common method. Either seems like a step in the wrong direction. Once you figure out this code, it isn't so bad; it's just unusual.


Reply via email to