JDK-8006875 : Correct behavior of parameter reflection with index 0 and empty string parameter names.
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang:reflect
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2013-01-24
  • Updated: 2013-01-25
  • Resolved: 2013-01-25
Related Reports
Relates :  
Description
Under the present implementation of method parameter reflection, parameters whose name index is 0 in the class file (ie parameters that have no name) are treated the same as parameters whose name is "": a name of the form "argI" is synthesized for them.

There needs to be a determination as to whether or not this is the correct behavior, which entail either of 1) updating the spec accordingly if it is, or 2) updating the implementation accordingly if it is not.
Comments
The specification for method parameter reflection has been updated such that a parameter name of "" (ie the empty string) is illegal. The present implementation of hotspot returns "" in the case of a parameter name index of 0, and the core reflection implementation treats such a value as a parameter with no name. Therefore, no code changes are required to maintain conformance.
25-01-2013

Discussion started on core-libs-dev
24-01-2013