JDK-8007681 : negative type annotation tests do not test type annotations
  • Type: Bug
  • Component: tools
  • Sub-Component: javac
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2013-02-06
  • Updated: 2014-12-16
  • Resolved: 2013-03-18
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
8Fixed
Related Reports
Relates :  
Relates :  
Description
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.
Comments
The test noted was fixed, http://hg.openjdk.java.net/type-annotations/type-annotations/langtools/rev/b097763b974a See JDK-8010225 for complete list.
18-03-2013