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

Add API note to ToolProvider about being reusable/reentrant

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P3
    • Resolution: Approved
    • Fix Version/s: 19
    • Component/s: core-libs
    • Labels:
      None
    • Subcomponent:
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Just adding an `@apiNote` about recommend behavior
    • Interface Kind:
      Java API
    • Scope:
      SE

      Description

      Summary

      Amend the API documentation of ToolProvider SPI with an API note about being reusable/reentrant.

      Problem

      The current API documentation of ToolProvider SPI lacks information about being reusable/reentrant.

      Users of tools implementing ToolProvider can not safely reuse instances of such tools in the same VM as they may maintain static state. Usually each tool must be loaded in a new context (new module layer, new class loader, ...) in order to workaround stateful implementations.

      Solution

      Add an API note to the API documentation of ToolProvider SPI about being reusable/reentrant.

      Specification

      @apiNote
      It is recommended that tools implementing this interface are either reusable and reentrant,
      or should clearly document any limitations and restrictions. In this context, reusable means
      that any one instance of a tool may be a the target of multiple {@code run} method invocations,
      and reentrant means that multiple invocations of {@code run} may occur concurrently.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              cstein Christian Stein
              Reporter:
              jjg Jonathan Gibbons
              Reviewed By:
              Jonathan Gibbons
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: