Navigation Menu

Skip to content
This repository has been archived by the owner on Aug 27, 2022. It is now read-only.

Commit

Permalink
8196450: Deprecate JDWP/JDI canUnrestrictedlyRedefineClasses to match…
Browse files Browse the repository at this point in the history
… 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 be14526
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 7 additions & 3 deletions make/data/jdwp/jdwp.spec
Expand Up @@ -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
Expand Down Expand Up @@ -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 "
Expand Down
4 changes: 4 additions & 0 deletions src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachine.java
Expand Up @@ -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();

/**
Expand Down
Expand Up @@ -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() &&
Expand Down

0 comments on commit be14526

Please sign in to comment.