Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8183273

Clarify Instrumentation interface should not be implemented outside java.instrument module

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 13
    • Component/s: core-svc
    • Labels:

      Description

      Java SE 9 adds two abstract methods to java.lang.instrument.Instrumentation. This is a source incompatible change. The assumption at the time was that the Instrumentation implementation is tightly coupled to the VM implementation and it seemed unlikely there would be other implementations (this follows similar additions of abstract methods in Java SE 6).

      The NetBeans project now reports that it implements Instrumentation. The thread on this discussion is here:
        http://mail.openjdk.java.net/pipermail/jigsaw-dev/2017-June/012934.html

      This feedback came too late for Java SE 9. At the same time, the use is a bit dubious because NetBeans doesn't implement it completely, instead it appears to implement the add/removeTransformer methods only.

      This issue tracks an re-examination in some future major release. We could, for example, consider changing methods to be default methods in Java SE 10. Alternatively the Instrumentation class description could include a note to make it clear that the interface is not intended to be implemented outside of the java.instrument module.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                sspitsyn Serguei Spitsyn
                Reporter:
                alanb Alan Bateman
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: