RFC: 8223915: JVMTI Spec: can_redefine_any_class capability spec is inconsistent

serguei.spitsyn at oracle.com serguei.spitsyn at oracle.com
Thu May 16 09:47:43 UTC 2019


On 5/16/19 02:25, David Holmes wrote:
> Hi Serguei,
>
> On 16/05/2019 5:22 pm, serguei.spitsyn at oracle.com wrote:
>> **Note #2*
>>
>> Just realized there is an incorrectness in current spec of this 
>> capability an_redefine_any_class.
>>
>> This section
>> https://docs.oracle.com/en/java/javase/11/docs/specs/jvmti.html#jvmtiCapabilities.can_redefine_any_class 
>>
>>
>> tells:
>>   "Can modify (retransform or redefine) any modifiable class."
>>
>> It is just wrong. Instead, it should tell:
>>   "Can modify (retransform or redefine) any class except primitive, 
>> array,
>>    and some implementation defined classes."
>
> But that's what it does say by saying "any modifiable class".

I understand your confusion as I have it as well. :)

The problem is that in the IsModifiableClass spec the affect of 
capability is explained as:
   "If possessed then all classes (except primitive, array, and some 
implementation
    defined classes) are modifiable (redefine or retransform)."

So that successful possession of this capability makes all classes
(except primitive, etc.) to be modifiable.

Thanks,
Serguei


> David
> -----
>
>> In another place it is defined as:
>>   "If possessed then all classes (except primitive, array, and some 
>> implementation
>>    defined classes) are modifiable (redefine or retransform). "
>>
>> For reference, see the section "Optional Features" here:
>> https://docs.oracle.com/en/java/javase/11/docs/specs/jvmti.html#IsModifiableClass 
>>
>>
>> I'll update the CSR to fix this issue.
>>
>> Thanks,
>> Serguei
>>
>>>
>>> -Alan
>>



More information about the serviceability-dev mailing list