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.
- csr of
-
JDK-8279031 Add API note to ToolProvider about being reusable/reentrant
- Resolved