bug in attribution of annotations in anonymous classes
Steve Sides
steve.sides at oracle.com
Thu Jan 17 10:08:49 PST 2013
Hi Werner,
Two things.
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.
Second, should type-annotations in lambda expressions be working?
I do not see any written to the classfile.
-steve
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