Summary
Annotations with no @Target
annotation should be applicable to type parameter declarations.
Problem
JLS 9.6.4.1 specifies that annotations without an @Target
annotation are applicable in 'all declaration contexts', which includes type parameter declarations. The implementation does not permit annotations without an @Target
annotation to be applied to type parameter declarations.
Solution
The proposed solution updates the implementation to permit annotations without an @Target
annotation to be applied to type parameter declarations. This change affects -source/--release 14 and higher.
Specification
No specification changes are required.
The change applies to JLS 14 and newer, which was the first version to update JLS 9.6.4.1 to allow annotations without an @Target
annotation on type parameter declarations.
The proposed change to update the implementation to match the specification can be found in https://git.openjdk.java.net/jdk/pull/12914.
- csr of
-
JDK-8303784 no-@Target annotations should be applicable to type parameter declarations
-
- Resolved
-