JDK 8 code review request for 8005832: Remove java.lang.annotation.{ContainedBy, ContainerFor} annotation types (original) (raw)

Alex Buckley alex.buckley at oracle.com
Wed Feb 6 02:14:44 UTC 2013


This changeset was committed on 1/31 despite a) having inaccurate javadoc and b) reducing even further the clarity of a probably unnecessary type in the java.lang hierarchy.

Again, I request that the nature of when core reflection throws AnnotationFormatError be raised on enhanced-metadata-spec-discuss, since it needs to correspond with compile-time constraints.

Alex

On 1/31/2013 12:13 PM, Alex Buckley wrote:

On 1/31/2013 9:45 AM, Joe Darcy wrote:

With Joel's recent push of 8005712, the repeating annotations feature has now transitioned from using the pair of annotation types {ContainedBy, ContainerFor} to the single Repeatable annotation.

Please review the removal of the pair of old types: 8005832: Remove java.lang.annotation.{ContainedBy, ContainerFor} annotation types http://cr.openjdk.java.net/~darcy/8005832.0/ The type-level javadoc for InvalidContainerAnnotationError is: "Thrown to indicate that an annotation type expected to act as a container for another annotation type by virture of an @Repeatable annotation, does not act as a container." An annotation type never acts as a container; an annotation acts as a container. Also, it is preferable to avoid @Repeatable and instead defer to the JLS 9.6 concept of "repeatable annotation type". To be honest, I've never understood how InvalidContainerAnnotationError differs from AnnotationFormatError. The spec has precisely one paragraph calling for an AnnotationFormatError; if the implementation broke it down into multiple cases, that should be added back to the spec and the AFE subtype documented. (Please do that on enhanced-metadata-spec-discuss, not a -dev list.) Alex



More information about the core-libs-dev mailing list