JDK-8341780 : CLONE - Release Note: `TypeMirror` Changed to Provide Annotations for Types Loaded from Bytecode
  • Type: Sub-task
  • Component: tools
  • Sub-Component: javac
  • Affected Version: 22
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-10-08
  • Updated: 2024-10-21
Description
The implementation of `TypeMirror` now provides access to annotations for types loaded from bytecode. Previously type annotations were not associated with types loaded from bytecode.

Annotation processors can access type annotations for elements using `AnnotationMirror#getAnnotationMirrors`, and the annotations will be included in the output of `AnnotationMirror#toString`.

Any programs that relied on annotations being omitted for elements loaded from the classpath should be updated to handle type annotations.