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

javac allows the ElementType.TYPE for annotation

XMLWordPrintable

    • b44
    • generic
    • generic
    • Verified



      Name: viR10068 Date: 03/03/2004


      The jdk1.5.0-b40 allows to use the annotation marked as
      @Target(ElementType.TYPE) to annotate an annotation but
      according to the spec (Final Draft Specification 2) the
      @Target(ElementType.ANNOTATION_TYPE) should be used for it.

      The affected new JCK 1.5 test is:
      lang/ANNOT/annot049/annot04909m1/annot04909m1.html

      The test source:
      --------------------------- test.java -----------------------------------
      import java.io.PrintStream;
      import java.lang.annotation.*;

      @Target(ElementType.TYPE) @interface iMark{}

      @iMark @interface Annot {
          int m();
      }
      -------------------------------------------------------------------------

      Execution log (no errors):
      % jdk1.5.0-b40/solaris-sparc/bin/javac -version -source 1.5 test.java
      javac 1.5.0-beta2
      %

      ======================================================================

            jjb Josh Bloch
            vivsunw Viv Viv (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: