bug in attribution of annotations in anonymous classes

Steve Sides steve.sides at oracle.com
Thu Jan 17 11:42:31 PST 2013


On 1/17/2013 11:30 AM, Werner Dietl wrote:
> 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.
Good. Gives me more time to fix that test.
>
>
>> 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.
Yep.  Currently, I can put them there, and it all compiles, but they are 
otherwise ignored.

thx,
-steve

>
> 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
>>
>
>



More information about the type-annotations-dev mailing list