-
Bug
-
Resolution: Fixed
-
P4
-
9
-
b61
-
Verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085484 | emb-9 | Andreas Lundblad | P4 | Resolved | Fixed | team |
In the program below, the annotation is attached to the use of a type. This is strictly speaking not a declaration.
import java.lang.annotation.*;
@Target(ElementType.METHOD)
@interface A { }
class NonDeclaration extends java.util.ArrayList<@A String> { }
Currently java reports the following error:
NonDeclaration.java:4: error: annotation type not applicable to this kind of declaration
class NonDeclaration extends java.util.ArrayList<@A String> { }
^
1 error
The error message should be reformulated.
import java.lang.annotation.*;
@Target(ElementType.METHOD)
@interface A { }
class NonDeclaration extends java.util.ArrayList<@A String> { }
Currently java reports the following error:
NonDeclaration.java:4: error: annotation type not applicable to this kind of declaration
class NonDeclaration extends java.util.ArrayList<@A String> { }
^
1 error
The error message should be reformulated.
- backported by
-
JDK-8085484 Confusing / incorrect error message regarding annotations on non-declarations
-
- Resolved
-
- relates to
-
JDK-8043984 Confusing (incorrect) error message on repeatable annotations
-
- Closed
-