JDK-8174126 : Add Types method to add annotations
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: javax.lang.model
  • Affected Version: 9,10
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2017-02-07
  • Updated: 2023-12-11
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.
Other
tbdUnresolved
Related Reports
Relates :  
Description
As a follow-up to stripping annotations from type mirrors returned by methods in Types (JDK-8042981), it would be helpful to provide methods to add annotations. Sketch of a proposal:

<T extends TypeMirror> T withAnnotations(T typeMirror, List<? extends 
AnnotationMirror> annotations)

<T extends TypeMirror> T withAnnotations(T typeMirror, 
AnnotatedConstruct annotationHost)

http://mail.openjdk.java.net/pipermail/compiler-dev/2014-May/008782.html