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 16:40:17 UTC 2019


Hi David,


On 5/16/19 05:33, David Holmes wrote:
> On 16/05/2019 7:47 pm, serguei.spitsyn at oracle.com wrote:
>> 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.
>
> Yes and so:
>
> "Can modify (retransform or redefine) any modifiable class."
>
> means
>
> "Can modify (retransform or redefine) any class (except primitive, etc)."
>
> I'm not seeing the problem. ??


The problem is that this statement is confusing:
   "Can modify (retransform or redefine) any modifiable class."

It is because possessing the capability makes ALL the classes (except 
primitive, array, ...) modifiable.
Which means that there can be non-modifiable classes other than 
primitive, array, and some implementation defined classes."

Thanks,
Serguei

>
> David
>
>> 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