-
Enhancement
-
Resolution: Duplicate
-
P3
-
None
-
5.0
-
generic
-
generic
Name: siR10004 Date: 12/02/2003
Removing default value of an annotation member leads to incompatible
change in API. For example, let us consider the following example from
the JSR 175 specification :
--------------------------------------------------------------------------
// Annotation type declaration with defaults on some members
public @interface RequestForEnhancement {
int id(); // No default - must be specified in each annotation
String synopsis(); // No default - must be specified in each annotation
String engineer() default "[unassigned]";
String date() default "[unimplemented]";
}
...
// Normal annotation with default values
@RequestForEnhancement(
id = 4561414,
synopsis = "Balance the federal budget"
)
public static void balanceFederalBudget() {
throw new UnsupportedOperationException("Not implemented");
}
...
--------------------------------------------------------------------------
If default value of 'engineer' (or 'date') is removed from the definition
of 'RequestForEnhancement' this example could not be compiled without error.
However, reflection support for metadata (CCC 4891872) is missing
the feature to recognize an annotation members with (without) default value.
This feature is important for the new jck sigtest for Tiger.
======================================================================
- duplicates
-
JDK-4986770 Bring JSR-175 up to date with preliminary public draft
- Resolved