JDK-8223740 : Clarify Instrumentation interface should not be implemented outside java.instrument module
  • Type: CSR
  • Component: core-svc
  • Sub-Component: java.lang.instrument
  • Priority: P3
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 13
  • Submitted: 2019-05-11
  • Updated: 2019-05-16
  • Resolved: 2019-05-16
Related Reports
CSR :  
Description
Summary
-------

Add a note to the java.lang.instrument.Instrumentation interface to make it clear that it is not intended to be implemented outside of the java.instrument module.

Problem
-------

Customers attempt to implement the interface outside of the java.instrument module.

Solution
--------

Add a note to the java.lang.instrument.Instrumentation interface to make it clear that it is not intended to be implemented outside of the java.instrument module.

Specification
-------------

Add the following note to the Instrumentation spec:

  "Note: The interface is not intended to be implemented outside of the java.instrument module."

The suggested patch is:
<pre>
--- a/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java	Fri May 10 13:37:00 2019 -0700
+++ b/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java	Fri May 10 17:48:45 2019 -0700
@@ -65,6 +65,9 @@
  * &lt;p&gt;
  * Once an agent acquires an <code>Instrumentation</code> instance,
  * the agent may call methods on the instance at any time.
+ * &lt;p&gt;
+ * @apiNote This interface is not intended to be implemented outside of
+ * the java.instrument module.
  *
  * @since   1.5
  */
</pre>

Comments
Moving to Approved.
16-05-2019

This seems like a good use of the apiNote tag.
14-05-2019