Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8196450: Deprecate JDWP/JDI canUnrestrictedlyRedefineClasses to match…
… JVM TI capabilities

Deprecate capabilities unsupported in JVM TI

Reviewed-by: dholmes, cjplummer
  • Loading branch information
Serguei Spitsyn committed Jun 6, 2020
1 parent ff8c6d5 commit be145265691aeb70d7f8f4c28ff334500bb4fdd2
@@ -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 "
@@ -578,25 +578,29 @@ default List<ModuleReference> allModules() {
* 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();

/**
* Determines if the target VM supports
* 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();

/**
@@ -742,12 +742,14 @@ public boolean canRedefineClasses() {
capabilitiesNew().canRedefineClasses;
}

@Deprecated(since="15")
public boolean canAddMethod() {
validateVM();
return hasNewCapabilities() &&
capabilitiesNew().canAddMethod;
}

@Deprecated(since="15")
public boolean canUnrestrictedlyRedefineClasses() {
validateVM();
return hasNewCapabilities() &&

0 comments on commit be14526

Please sign in to comment.