-
Enhancement
-
Resolution: Duplicate
-
P4
-
None
-
6u10
-
x86
-
windows_7
A DESCRIPTION OF THE REQUEST :
Add ASSIGNMENT to the the allowed targets (i.e. ElementType) for an annotation.
JUSTIFICATION :
When using SuppresWarnings, it is desirable to use the smallest scope possible. Often, for "unchecked" this occurs on a variable assignment.
Currently, only a DECLARATION target is allowed. There are situations where warning suppression is required for an assignment that is NOT a declaration.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Should be able to associate an annotation with a variable assignment.
ACTUAL -
Can only associate an annotation with an assignment that is part of a declaration.
Add ASSIGNMENT to the the allowed targets (i.e. ElementType) for an annotation.
JUSTIFICATION :
When using SuppresWarnings, it is desirable to use the smallest scope possible. Often, for "unchecked" this occurs on a variable assignment.
Currently, only a DECLARATION target is allowed. There are situations where warning suppression is required for an assignment that is NOT a declaration.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Should be able to associate an annotation with a variable assignment.
ACTUAL -
Can only associate an annotation with an assignment that is part of a declaration.
- duplicates
-
JDK-6350731 Annotation system prohibits certain annotations, drops others
-
- Closed
-