javac in at least JDK 11 misinterprets the applicability of an annotation type T whose declaration has no @Target meta-annotation. For example, T should be applicable to module declarations, yet javac disallows @T in that context. (ecj allows it, correctly.)
SeeJDK-8231435 for a simple clarifying spec change in this area.
See
- relates to
-
JDK-8261088 Repeatable annotations without @Target cannot have containers that target module declarations
-
- Resolved
-
-
JDK-8261610 9.6.4.1: Refine no-@Target to mean "applicable in all declaration contexts"
-
- Resolved
-
-
JDK-8231435 9.6.4.1: Expand no-@Target to mean "applicable in all contexts"
-
- Resolved
-
- links to
-
Review openjdk/jdk/2303