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

jpackage ToolProvider is not thread-safe

XMLWordPrintable

      This was discovered during the code review:

      Roger Riggs wrote:
      -----------------------------------------------
      Having support for the ToolProvider is great.
      However, there is no indication about whether it is valid to use it from multiple threads.
      The implementation is structured to be deliberately single thread use only
      with the invocation being via a static method and the logging being via static methods.
      There will need to be a disclaimer and perhaps an exception should be thrown.

      A future improvement:
      The implementation should be methods on the instance created by the ToolProvider
      and the logging relative to that instance/delegated where needed.
      Main can then be a simple lookup of the tool provider and invoke.
      -----------------------------------------------

      For JDK 13, we either need to document the current limitation (e.g., in an @implNote) or we need to serialize access by synchronizing the static Main::run methods.

      I filed JDK-8223322 to track the suggested future improvement.

            kcr Kevin Rushforth
            kcr Kevin Rushforth
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: