|
Hi Alan,
Thank you for looking at this CSR. On 5/15/19 00:27, Alan Bateman wrote: On 14/05/2019 21:20, [email protected] wrote: Not sure, if I understand you correctly because there can be a confusion here. Is it about the IsModifiableModule? : https://docs.oracle.com/en/java/javase/11/docs/specs/jvmti.html#IsModifiableModule If so, then it tells if a module can be updated with AddModule{Reads|Exports|Opens|Uses|Provides}. But, most likely, you are talking about modules which classes can be made not redefined in the future. > Can you summarize how this capability is used The potential capability can_redefine_any_class is always set to true in our implementation. It can be possessed but is never checked. In most cases, the capabilities are checked in the auto-generated jvmtiEnter.cpp. For instance, there is a check of can_redefine_classes capability in the RedefineClasses wrapper. If we introduce some modules which classes can not be redefined then the potential can_redefine_any_class capability should return false in a case such classes exist. Please, let me know if you have more questions. Side notes Note #1 Then we could consider to introduce new JVMTI function, something like: AreModuleClassesModifiable(). In current implementation IsModifableClass returns false for primitive, array and unsafe anonymous classes (must be invisible). 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." 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
|
- RFC: 8223915: JVMTI Spec: can_redefine_any_clas... serguei . spitsyn
- Re: RFC: 8223915: JVMTI Spec: can_redefine... Alan Bateman
- Re: RFC: 8223915: JVMTI Spec: can_rede... [email protected]
