JDK-8007072 : Update Core Reflection for Type Annotations to match latest spec
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Affected Version: 8
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2013-01-29
  • Updated: 2017-05-17
  • Resolved: 2013-09-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8 b112Fixed
Related Reports
Cloners :  
Relates :  
Relates :  
Description
1) Javadoc and implementation of j.l.reflect.AnnotatedType and friends needs to be updated and clarified with regard to returned values and null

In general:

- If the Type or Type[] returning methods (getGeneric*, get*Bounds, etc) does not return 'null', the version returning an AnnotatedType (getAnnotated*, getAnnotated*Bounds etc) should not return 'null'.

- There should be a preference for returning "empty" AnnotatedType instances and 0-length AnnotatedType arrays.

2) Additional clarifications in the javadoc may be needed to match the latest spec, such as saying in the interface-level javadoc that:

- AnnotatedType represents the _potentially annotated_use of ...
- AnnotatedArrayType represents the _potentially annotated_ use of ...
- AnnotatedParameterizedType represents the _potentially annotated_ use of ...
- AnnotatedTypeVariable represents the _potentially annotated_ use of ...
- AnnotatedWildcardType represents the _potentially annotated_ use of ...
Comments
Split out the proposed changes to AnnotatedElement to its own issue JDK-8023471
21-08-2013

Additional improvements to consider: * Adding a getType method to the root interface * Changing the multiple of subinterfaces to be nested interfaces of the root interface
29-01-2013