jpackage's Executor class has a few issues:
1. It doesn't support saving the stderr and stdout of the started subprocess separately. It only supports saving them interleaved into a single stream [1]. This has not caused problems yet because jpackage is not running commands that write to both stderr and stdout. jpackage's test lib Executor supports independent processing of subprocess's output streams, so the jpackage's Executor should too.
2. Both executor classes should use the same code to configure how the output streams of subprocesses are processed. There is no point in having two separate implementations of the same functionality.
[1] https://github.com/openjdk/jdk/blob/4b8eda30474b99a9f1065e5cea9d8c2fb859bab2/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java#L102
1. It doesn't support saving the stderr and stdout of the started subprocess separately. It only supports saving them interleaved into a single stream [1]. This has not caused problems yet because jpackage is not running commands that write to both stderr and stdout. jpackage's test lib Executor supports independent processing of subprocess's output streams, so the jpackage's Executor should too.
2. Both executor classes should use the same code to configure how the output streams of subprocesses are processed. There is no point in having two separate implementations of the same functionality.
[1] https://github.com/openjdk/jdk/blob/4b8eda30474b99a9f1065e5cea9d8c2fb859bab2/src/jdk.jpackage/share/classes/jdk/jpackage/internal/Executor.java#L102