Name: js151677 Date: 08/04/2004
A DESCRIPTION OF THE REQUEST :
Until now, the reflection of Java make a great work for the programs that need to call the functions. BUT .. doesn't do so much for the humans that need to read the profile of a method during the execution : The names of the arguments of a method, even if they can be included in the class file with a -g option during the compilation, cannot be accessed via the reflection mecanism.
I am requesting the add of the functions :
String getParameterNames() in the class java.lang.reflect.Method
String getParameterNames() in the class java.lang.reflect.Constructor
This function will help all the programmers of any bean builder or custom IDE.
For example, me :
I am programming a tool to let the user design some specific programs graphically. Actually, my program is limited to display the classes of the arguments of a method and the user have to guess what each argument is for since I have no easy way to obtain their names.
EXPECTED VERSUS ACTUAL BEHAVIOR :
The expected behavior for the 2 functions in java.lang.reflect.Method and class java.lang.reflect.Constructor is the same :
This function will return a null pointer if there is no information about the names in the class where the Method is and will return a array of String if the names are there.
No way to obtain the names of the argument of a method or a constructor by reflection.
CUSTOMER SUBMITTED WORKAROUND :
Doing manually a read of the bytecode of the class.
Not every programmer can afford to lose time to do it since it require to read and understand all the low level structure of a class file and been able to unterpret its bytecode.
(Incident Review ID: 295670)