JDK-8008769 : Repeated type-annotation on type parameter of local variable
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 8
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-02-23
  • Updated: 2014-02-06
  • Resolved: 2013-05-15
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b91Fixed
Related Reports
Relates :  
Description
Repeated type-annotations on type parameter of local variable are not written to classfile.

import java.lang.annotation.*;
import static java.lang.annotation.RetentionPolicy.*;
import static java.lang.annotation.ElementType.*;

class Test<T> {
    Test<@A @A @A String> t = new Test<>(); //ok

    public void test() {
        Test<@B String> t1 = new Test<>(); //ok
        Test<@A @A @A String> t2 = new Test<>(); //not ok
   }
}

@Target(TYPE_USE)  @Repeatable( AC.class ) @interface A { }
@Target(TYPE_USE)  @interface AC { A[] value(); }
@Target(TYPE_USE)  @Repeatable( BC.class ) @interface B { }
@Target(TYPE_USE)  @interface BC { B[] value(); }

Comments
verified in jdk8 b92
06-06-2013

Fix in tl/langtools through commit for JDK-8013852
15-05-2013

Original commit: hg.openjdk.java.net/type-annotations/type-annotations/langtools/rev/ac33d03e35b8
15-05-2013

Fixed in type-annotations forest
29-04-2013

Currently in type-annotations repository: tools/javac/annotations/typeAnnotations/classfile/T8008769.java
18-03-2013