RFR: 8374219: Fix issues in jpackage's Executor class [v3]

Alexey Semenyuk asemenyuk at openjdk.org
Thu Jan 8 01:36:52 UTC 2026


> - Move code shared between jpackage's Executor and jpackage's test lib Executor into `jdk.jpackage.internal.util.CommandOutputControl` class using the latter one as the baseline for the new class; [CommandOutputControl class javadoc](https://alexeysemenyukoracle.github.io/jpackage-javadoc/jdk.jpackage/jdk/jpackage/internal/util/CommandOutputControl.html).
> - Place "execute with retries" logic into `jdk.jpackage.internal.util.RetryExecutor` class and use it from both jpackage and jpackage's test lib. Use `jdk.jpackage.internal.RetryExecutor` class as the baseline.
> - Add `ObjectFactory`, `ExecutorFactory`, and `RetryExecutorFactory` interfaces to the "jdk.jpackage.internal" package. They enable the use of command mocks with jpackage.
> - Add `jdk.jpackage.test.mock` package. It facilitates creating command mocks. Use it to test LibProvidersLookup, LinuxSystemEnvironment, LinuxPackageArch, MacDmgSystemEnvironment, and MacDmgPackager classes.
> 
> Supplementary changes:
>  - Make `jdk.jpackage.internal.SystemEnvironment` and all implementing classes package private

Alexey Semenyuk has updated the pull request incrementally with five additional commits since the last revision:

 - Fix review findings
 - internal/Executor: rework capturing of command output
 - CommandOutputControl: rename ExecutableSpec into ExecutableAttributes
 - MockUtils: expose for use from other packages; add JPackageToolProviderBuilder helper class; fix arguments passed in a command mock when it replaces a tool provider
 - JPackageCommand: fix withToolProvider(): 1) reset toolProvider; 2) propagate exceptions from the worker thread to the caller thread; 3) reorder the parameters for better readability.

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/28733/files
  - new: https://git.openjdk.org/jdk/pull/28733/files/0be4bdb9..b5bb8134

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=28733&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=28733&range=01-02

  Stats: 301 lines in 14 files changed: 188 ins; 29 del; 84 mod
  Patch: https://git.openjdk.org/jdk/pull/28733.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/28733/head:pull/28733

PR: https://git.openjdk.org/jdk/pull/28733


More information about the core-libs-dev mailing list