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

negative type annotation tests do not test type annotations

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • None
    • tools

      Many of the tests in typeAnnotations/failures use jdk7 target set and not TYPE_USE.

      /*
       * @test
       * @bug 6843077 8006775
       * @summary test type annotation on void generic methods
       * @author Mahmood Ali
       * @compile/fail VoidGenericMethod.java
       */
      class VoidGenericMethod {
        public <T> @A void method() { }
      }

      @interface A { }


      For instance, the above from VoidGenericMethod.java says it tests "type annotation on void generic methods" but tests a regular annotation.
      I'm guessing these tests were written for a build in which TYPE_USE (and TYPE_PARAMETER) were included in the default set(???).

      @Target(TYPE_USE)
      @interface A { }

      So these don't really test negative uses of type annotations but regular uses.
      These should be corrected to use type annotations.

      Other older tests should be reviewed for use of jdk7 anotations vs. type annotations.

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

              Created:
              Updated:
              Resolved: