bug in attribution of annotations in anonymous classes
Werner Dietl
wdietl at gmail.com
Thu Jan 17 11:30:07 PST 2013
Hi Steve,
> First, that test case I attached looks a little suspicious. It may not be
> expected the correct counts.
> However, I do still see extra annotations on anonymous classes.
> I'll have to give that test a better look.
Sorry, I haven't gotten to look at anonymous classes yet.
> Second, should type-annotations in lambda expressions be working?
> I do not see any written to the classfile.
I don't expect anything related to type annotations and lambda to
currently work. I've added very basic support, but the EG is still
discussing the final storage format.
cu, WMD.
> On 1/16/2013 2:40 PM, Steve Sides wrote:
>>
>> Hi Werner,
>> While writing tests, I looking at type-annotations on type usage in
>> anonymous classes and found what looks like a bug.
>> When compiling the code below, the field 'data' has 2
>> RuntimeVisibleTypeAnnotations, while the field in the anonymous class,
>> 'data2', has3 RuntimeVisibleTypeAnnotations.
>> If there are 2 (such as @A @B data2) it has 6 (rather than 4). The same is
>> true for methods. Test cases are attached.
>>
>> Can you check this out?
>>
>> 8<- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>
>> class testclass {
>> @C String data = "test";
>> void mtest( testclass t){ }
>> public void test() {
>> mtest( new testclass() {
>> @D String data2 = "test";
>> });
>> }
>> }
>>
>> @Retention(RUNTIME)
>> @Target({TYPE_USE,FIELD})
>> @interface C { }
>>
>> @Retention(RUNTIME)
>> @Target({TYPE_USE,FIELD})
>> @interface D {
>>
>> 8<- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
>>
>> thanks,
>> steve
>
>
--
http://www.google.com/profiles/wdietl
More information about the type-annotations-dev
mailing list