Interesting.

How likely is it that there will be more than one tool of a given name
available? The method name findFirst() seems relatively odd for the
lookup operation.

I'd also note that the name string to pass in are "magic". There are
no constants defined for callers to use. Since there is no obvious way
in the API to find the vendor, this could get tricky across JDKs. Plus
how would a caller know what arguments to pass if each vendors tool
differs?

Just being cautious about the use case being solved.

Stephen

On 5 October 2016 at 00:39, Jonathan Gibbons
<jonathan.gibb...@oracle.com> wrote:
> Core-libs folk,
>
> Please review the following change to add a new service provider class
>     java.util.spi.ToolProvider
>
> which can be used provide simple "command-line" access to select JDK
> tools, without starting a new JVM.
>
> The following tools are updated to provide access through the new SPI:
>     javac, javadoc, javap, jdeps
>
> It is expected that additional tools will also be updated to provide access,
> but that will be done separately.
>
> Compiler-dev folk may wish to review the changes to the langtools
> repository.
>
> JBS: https://bugs.openjdk.java.net/browse/JDK-8159855
> Webrev: http://cr.openjdk.java.net/~jjg/8159855/webrev.03/
> API:
> http://cr.openjdk.java.net/~jjg/8159855/api.02/java/util/spi/ToolProvider.html
>
> -- Jon

Reply via email to