Review request for 8058322: Zero name_index item of MethodParameters attribute cause MalformedParameterException

Eric McCorkle eric.mccorkle at oracle.com
Tue Nov 11 00:41:36 UTC 2014


Actually, the webrev script seems to have pulled in both patches.

The change in question is in reflection.cpp.

On 11/10/14 19:39, Eric McCorkle wrote:
> Disregard this.  Apologies; I had the wrong patch.
> 
> On 11/10/14 19:23, Eric McCorkle wrote:
>> I had to make a barely-nontrivial change, to deal with the fact that
>> apparently you can't assign NULL to a Handle on some platforms (an
>> embedded platform).
>>
>> Please re-approve.
>>
>> Thanks.
>>
>> On 10/29/14 12:20, Coleen Phillimore wrote:
>>>
>>> Looks good, Eric.
>>>
>>> thanks,
>>> Coleen
>>>
>>> On 10/29/14, 10:59 AM, Eric McCorkle wrote:
>>>> Hello,
>>>>
>>>> Please review this simple change which addresses a failure condition in
>>>> the method parameter reflection implementation.  In the initial
>>>> implementation of method parameter reflection, a parameter with a
>>>> parameter_name index of 0 denoted a parameter with no name, and the VM
>>>> translated this into the empty string when creating the Parameter object
>>>> to return to Java code.  However, towards the end of the 8 cycle, the
>>>> spec was updated to state that a zero parameter_name index should denote
>>>> a parameter with no name, and should result in Parameter.getName()
>>>> returning an empty string, whereas the empty string /constant/ is
>>>> expressly forbidden as a parameter name, and should result in
>>>> MalformedParametersException.  The reflection API was updated to reflect
>>>> this behavior, but it seems the VM still translates a parameter_name
>>>> index of 0 into the empty string.  This patch removes that, resulting in
>>>> correct behavior of the reflection API for parameters with no name.
>>>>
>>>> The webrev is here:
>>>> http://cr.openjdk.java.net/~emc/8058322/
>>>>
>>>> The bug is here:
>>>> https://bugs.openjdk.java.net/browse/JDK-8058322
>>>


More information about the hotspot-dev mailing list