Storing annotations on exception parameters

Werner Dietl wdietl at gmail.com
Wed Jan 23 00:23:38 PST 2013


Thanks for that suggestion. Maintaining the AnnotatedType through
erasure works and I pushed that change.
I now see the AnnotatedType in Gen/Code and see how I can make the
connection between everything.
However, I need to re-assemble a UnionType once the constituent
AnnotatedTypes have been built. At the moment the UnionType only has
the underlying types. This needs some more work to adapt the UnionType
in the right places.

I've split off the multicatch test cases and disabled them for now. I
will fix the problem ASAP.

cu, WMD.

On Tue, Jan 22, 2013 at 8:56 PM, Jonathan Gibbons
<jonathan.gibbons at oracle.com> wrote:
> On 01/22/2013 08:48 PM, Jonathan Gibbons wrote:
>>
>> On 01/22/2013 08:30 PM, Werner Dietl wrote:
>>>
>>> Do you know what operations happen to the exception type between the end
>>> of
>>> com.sun.tools.javac.comp.Attr.attribClassBody
>>> (where I call TypeAnnotations.organizeTypeAnnotationsBodies and still
>>> have AnnotatedTypes)
>>> and Gen.genCatch where I only see unannotated types?
>>
>>
>> Well, the tree goes through TransTypes and Lower, and in a separate
>> thread, this morning Maurizio warned of the possibility of losing
>> annotations during erasure (TransTypes).
>>
>> And if you follow the supertypes involved in the erasure visitor,
>> Types.java, 2003
>> you end up soon enough at the following couple of lines in
>> Types.defaultTypeVisitor,
>> round about line 4199:
>>
>>         // Pretend annotations don't exist
>>         public R visitAnnotatedType(AnnotatedType t, S s) { return
>> visit(t.underlyingType, s); }
>>
>> -- Jon
>
>
> At a guess, I would suggest trying, in the erasure visitor, override
> visitAnnotatedType,
> separate the type-annotations from the underlying type, then compose new
> AnnotatedType from the erasure of the type annotations and the erasure of
> the
> underlying type.
>
> -- Jon



-- 
http://www.google.com/profiles/wdietl


More information about the type-annotations-dev mailing list