JDK-6444738 : Access to method parameter names when processing annotations at runtime
  • Type: Enhancement
  • Component: specification
  • Sub-Component: language
  • Affected Version: 5.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2006-06-28
  • Updated: 2014-02-26
  • Resolved: 2013-12-20
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
8Fixed
Related Reports
Relates :  
Description
With some of the uses of annotations in Java EE we would like to be able
to discover the names of parameters for methods.  Of course we can get
this information if we compile with appropriate debugging flags, but we
don't want to be limited to that.  And there are hacks with annotation
processors to discover this information and save it for runtime (when we
need it).  But we'd really like a simple way to get this via reflection.
Best would be to just get it all the time, but I understand that will
unnecessarily increase the size of class files in most cases.

An alternative would be to have a way to tell the compiler to save this
information in certain cases.  An annotation on a class or method could
do this, but better would be a meta-annotation on another annotation so
that when that other annotation (e.g., @WebService) is used, parameter
name information will be saved.

Comments
In Java SE 8, it is possible to store parameter names in class files and retrieve them via the Core Reflection API and the Language Model API.
20-12-2013