8196450: Deprecate JDWP/JDI canUnrestrictedlyRedefineClasses to match JVM TI capabilities

Deprecate capabilities unsupported in JVM TI

Reviewed-by: dholmes, cjplummer
This commit is contained in:
Serguei Spitsyn 2020-06-06 08:13:40 +00:00
parent ff8c6d5deb
commit be14526569
3 changed files with 13 additions and 3 deletions

View File

@ -393,11 +393,14 @@ JDWP "Java(tm) Debug Wire Protocol"
(boolean canRedefineClasses
"Can the VM redefine classes?")
(boolean canAddMethod
"Can the VM add methods when redefining "
"classes?")
"Can the VM add methods when redefining classes? "
"<p>@Deprecated(since=\"15\") A JVM TI based JDWP back-end "
"will never set this capability to true.")
(boolean canUnrestrictedlyRedefineClasses
"Can the VM redefine classes "
"in ways that are normally restricted?")
"in ways that are normally restricted?"
"<p>@Deprecated(since=\"15\") A JVM TI based JDWP back-end "
"will never set this capability to true.")
(boolean canPopFrames
"Can the VM pop stack frames?")
(boolean canUseInstanceFilters
@ -467,6 +470,7 @@ JDWP "Java(tm) Debug Wire Protocol"
"<p>"
"Requires canRedefineClasses capability - see "
"<a href=\"#JDWP_VirtualMachine_CapabilitiesNew\">CapabilitiesNew</a>. "
"<p>@Deprecated(since=\"15\") "
"In addition to the canRedefineClasses capability, the target VM must "
"have the canAddMethod capability to add methods when redefining classes, "
"or the canUnrestrictedlyRedefineClasses capability to redefine classes in ways "

View File

@ -578,12 +578,14 @@ public interface VirtualMachine extends Mirror {
* Determines if the target VM supports the addition
* of methods when performing class redefinition.
* @see #redefineClasses
* @deprecated A JVM TI based JDWP back-end will never set this capability to true.
*
* @return <code>true</code> if the feature is supported,
* <code>false</code> otherwise.
*
* @since 1.4
*/
@Deprecated(since="15")
boolean canAddMethod();
/**
@ -591,12 +593,14 @@ public interface VirtualMachine extends Mirror {
* changes when performing class redefinition that are
* otherwise restricted by {@link #redefineClasses}.
* @see #redefineClasses
* @deprecated A JVM TI based JDWP back-end will never set this capability to true.
*
* @return <code>true</code> if the feature is supported,
* <code>false</code> otherwise.
*
* @since 1.4
*/
@Deprecated(since="15")
boolean canUnrestrictedlyRedefineClasses();
/**

View File

@ -742,12 +742,14 @@ class VirtualMachineImpl extends MirrorImpl
capabilitiesNew().canRedefineClasses;
}
@Deprecated(since="15")
public boolean canAddMethod() {
validateVM();
return hasNewCapabilities() &&
capabilitiesNew().canAddMethod;
}
@Deprecated(since="15")
public boolean canUnrestrictedlyRedefineClasses() {
validateVM();
return hasNewCapabilities() &&