--- a/hotspot/src/share/vm/prims/jvmti.xml Thu Apr 06 17:01:01 2017 +0000
+++ b/hotspot/src/share/vm/prims/jvmti.xml Fri Apr 07 08:04:46 2017 +0000
@@ -6516,7 +6516,7 @@
<function id="GetNamedModule" num="40" since="9">
<synopsis>Get Named Module</synopsis>
<description>
- Return the <code>java.lang.reflect.Module</code> object for a named
+ Return the <code>java.lang.Module</code> object for a named
module defined to a class loader that contains a given package.
The module is returned via <code>module_ptr</code>.
<p/>
@@ -6554,7 +6554,7 @@
<param id="module_ptr">
<outptr><jobject/></outptr>
<description>
- On return, points to a <code>java.lang.reflect.Module</code> object
+ On return, points to a <code>java.lang.Module</code> object
or points to <code>NULL</code>.
</description>
</param>
@@ -6599,6 +6599,10 @@
<error id="JVMTI_ERROR_INVALID_MODULE">
If <paramlink id="to_module"></paramlink> is not a module object.
</error>
+ <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+ if the module cannot be modified.
+ See <functionlink id="IsModifiableModule"/>.
+ </error>
</errors>
</function>
@@ -6633,7 +6637,7 @@
<description>
The module the package is exported to.
If the <code>to_module</code> is not a subclass of
- <code>java.lang.reflect.Module</code> this function returns
+ <code>java.lang.Module</code> this function returns
<errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
</description>
</param>
@@ -6649,6 +6653,10 @@
If the package <paramlink id="pkg_name"></paramlink>
does not belong to the module.
</error>
+ <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+ if the module cannot be modified.
+ See <functionlink id="IsModifiableModule"/>.
+ </error>
</errors>
</function>
@@ -6684,7 +6692,7 @@
<description>
The module with the package to open.
If the <code>to_module</code> is not a subclass of
- <code>java.lang.reflect.Module</code> this function returns
+ <code>java.lang.Module</code> this function returns
<errorlink id="JVMTI_ERROR_INVALID_MODULE"></errorlink>.
</description>
</param>
@@ -6700,6 +6708,10 @@
If the package <paramlink id="pkg_name"></paramlink>
does not belong to the module.
</error>
+ <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+ if the module cannot be modified.
+ See <functionlink id="IsModifiableModule"/>.
+ </error>
</errors>
</function>
@@ -6737,6 +6749,10 @@
<error id="JVMTI_ERROR_INVALID_CLASS">
If <paramlink id="service"></paramlink> is not a class object.
</error>
+ <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+ if the module cannot be modified.
+ See <functionlink id="IsModifiableModule"/>.
+ </error>
</errors>
</function>
@@ -6783,6 +6799,44 @@
<error id="JVMTI_ERROR_INVALID_CLASS">
If <paramlink id="impl_class"></paramlink> is not a class object.
</error>
+ <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+ if the module cannot be modified.
+ See <functionlink id="IsModifiableModule"/>.
+ </error>
+ </errors>
+ </function>
+
+ <function id="IsModifiableModule" num="99" since="9">
+ <synopsis>Is Modifiable Module</synopsis>
+ <description>
+ Determines whether a module is modifiable.
+ If a module is modifiable then this module can be updated with
+ <functionlink id="AddModuleReads"/>, <functionlink id="AddModuleExports"/>,
+ <functionlink id="AddModuleOpens"/>, <functionlink id="AddModuleUses"/>,
+ and <functionlink id="AddModuleProvides"/>. If a module is not modifiable
+ then the module can not be updated with these functions.
+ </description>
+ <origin>new</origin>
+ <capabilities>
+ </capabilities>
+ <parameters>
+ <param id="module">
+ <ptrtype><jobject/></ptrtype>
+ <description>
+ The module to query.
+ </description>
+ </param>
+ <param id="is_modifiable_module_ptr">
+ <outptr><jboolean/></outptr>
+ <description>
+ On return, points to the boolean result of this function.
+ </description>
+ </param>
+ </parameters>
+ <errors>
+ <error id="JVMTI_ERROR_INVALID_MODULE">
+ If <paramlink id="module"></paramlink> is not a module object.
+ </error>
</errors>
</function>
@@ -7803,6 +7857,10 @@
A method in the new class version has different modifiers
than its counterpart in the old class version.
</error>
+ <error id="JVMTI_ERROR_UNMODIFIABLE_MODULE">
+ A module cannot be modified.
+ See <functionlink id="IsModifiableModule"/>.
+ </error>
</errors>
</function>
@@ -11567,6 +11625,9 @@
<errorid id="JVMTI_ERROR_UNMODIFIABLE_CLASS" num="79">
The class cannot be modified.
</errorid>
+ <errorid id="JVMTI_ERROR_UNMODIFIABLE_MODULE" num="80">
+ The module cannot be modified.
+ </errorid>
<errorid id="JVMTI_ERROR_NOT_AVAILABLE" num="98">
The functionality is not available in this virtual machine.
</errorid>
@@ -14736,6 +14797,7 @@
- Add new functions:
- GetAllModules
- AddModuleReads, AddModuleExports, AddModuleOpens, AddModuleUses, AddModuleProvides
+ - IsModifiableModule
Clarified can_redefine_any_classes, can_retransform_any_classes and IsModifiableClass API to
disallow some implementation defined classes.
</change>