United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6444738 Access to method parameter names when processing annotations at runtime
JDK-6444738 : Access to method parameter names when processing annotations at runtime

Details
Type:
Enhancement
Submit Date:
2006-06-28
Status:
Closed
Updated Date:
2014-02-26
Project Name:
JDK
Resolved Date:
2013-12-20
Component:
specification
OS:
Sub-Component:
language
CPU:
Priority:
P3
Resolution:
Fixed
Affected Versions:
5.0
Fixed Versions:
8

Related Reports
Relates:

Sub Tasks

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.
                                     
2013-12-20



Hardware and Software, Engineered to Work Together