Storing annotations on exception parameters

Jonathan Gibbons jonathan.gibbons at
Tue Nov 27 18:26:47 PST 2012

On 11/27/2012 05:49 PM, Werner Dietl wrote:
> As discussed on the type-annotations-spec-experts list (see
> Section 3.3.8 of the JSR 308 specification will stay unchanged.
> For local variables, method:
> determines the necessary information.
> Could somebody point me to a place where I could determine the
> exception table index for an exception parameter?
> I found method
>, Env<GenContext>, int,
> int, List<Integer>)
> but I didn't see an exception table index there.
> Thanks,
> cu, WMD.


I believe the data structure you should be looking at is this one in

     /** A buffer for expression catch data. Each enter is a vector
      *  of four unsigned shorts.
     ListBuffer<char[]> catchInfo = new ListBuffer<char[]>();

And this method:

     /** Add a catch clause to code.
     public void addCatch(
         char startPc, char endPc, char handlerPc, char catchType) {
             catchInfo.append(new char[]{startPc, endPc, handlerPc, 

So, on the face of it, the index in the catchInfo array is the value you 
want. But life is never that simple, since there's this method too:

     public void compressCatchTable() {

which can eliminate some entries. You may need to search catchInfo for 
the handler you need.

-- Jon

More information about the type-annotations-dev mailing list