Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8037348

RuntimeInvisibleAnnotations should not be generated for type annotation on anonymous innerclass creation

    Details

    • Subcomponent:
    • Resolved In Build:
      b19
    • Verification:
      Not verified

      Description

      Consider this source code:
      ---
      import java.lang.annotation.*;
      public class AnnotCopiedToAnonymous {
           private Object o = new @Annot Object() { };
      }
      @Target({ElementType.TYPE, ElementType.TYPE_USE})
      @interface Annot { }
      ---

      The generated anonymous innerclass (AnnotCopiedToAnonymous$1) has the Annot annotation as a declaration annotation in its RuntimeInvisibleAnnotations in addition to having it in its RuntimeInvisibleTypeAnnotations with a supertype target.

      The annotation should not be listed in the RuntimeInvisibleAnnotations attribute, see:
      http://mail.openjdk.java.net/pipermail/type-annotations-dev/2014-March/001663.html

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                jlahoda Jan Lahoda
                Reporter:
                jlahoda Jan Lahoda
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: