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

Add API note to ToolProvider about being reusable/reentrant

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 19
    • core-libs
    • None
    • minimal
    • Just adding an `@apiNote` about recommend behavior
    • Java API
    • SE

      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.

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

              Created:
              Updated:
              Resolved: