Summary
Deprecate the JDI/JDWP capabilities canUnrestrictedlyRedefineClasses
and canAddMethod
.
Problem
The JDWP/JDI canUnrestrictedlyRedefineClasses
and canAddMethod
capabilities are not compatible with the JVM TI spec as the JVM TI does not allow unrestricted class redefinition. It is why these capabilities are always false in the reference implementation of the JDI.
Solution
Deprecate these capabilities and make it clear that it returns always false in the reference implementation.
Specification
Update the JDWP
VirtualMachine::capabilitiesNew
command spec:Update the description of capabilities
canUnrestrictedlyRedefineClasses
andcanAddMethod
in theReplyData
section of thecapabilitiesNew
command:- add the deprecation annotation before method declaration:
@Deprecated(since="15") A JVM TI based JDWP back-end will never set this capability to true.
- add the deprecation annotation before method declaration:
Update the java-doc for JDI
Updated the
com.sun.jdi.VirtualMachine
spec for methodscanUnrestrictedlyRedefineClasses
andcanAddMethod
:add the deprecation annotation before method declaration:
@Deprecated(since="15")
add a deprecation comment:
@deprecated A JVM TI based JDWP back-end will never set this capability to true.
Webrev:
http://cr.openjdk.java.net/~sspitsyn/webrevs/2020/jdwp-depr.1/src/
Updated JDWP VirtualMachine::capabilitiesNew spec:
Updated JDI com.sun.jdi.VirtualMachine spec:
- csr of
-
JDK-8196450 Deprecate JDWP/JDI canUnrestrictedlyRedefineClasses to match JVM TI capabilities
-
- Resolved
-