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

type-annotations in anon classes are written are regular annotations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P2 P2
    • None
    • None
    • tools

      In this case,
      class TestOne<T> { // TestN.class
           Object mtest( TestOne<T> t){ return null; }

          public void test() {
              mtest( new TestOne<T>() { // TestN$1
                      class InnerAnon<U> { // TestN$1$InnerAnon.class
                          @F String ia_m1(){ return null; };
                      }
                      InnerAnon<String> IA = new InnerAnon< String>();
                 });
         }
      }
      @Retention(RUNTIME) @Target(TYPE_USE) @interface F { }

      @F is written to class file as a regular annotation on ia_m1().

            ssides Steve Sides
            ssides Steve Sides
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: