RFR: 8356438: Update OutputAnalyzer to optionally print process output as it happens
Alice Pellegrini
duke at openjdk.org
Thu Jun 5 09:25:35 UTC 2025
The implemented solution modifies the `OutputBuffer` implementation instead of the `OutputAnalyzer` implementation.
This is because the **OutputBuffer implementation which handles processes** (LazyOutputBuffer) starts a thread in its constructor, so we would need to add a strange additional constructor parameter to the `OutputBuffer.of(Process, Charset)` static method, while the printing through to stdout (and stderr) only makes sense for LazyOutputBuffer.
I believe changing the config option from `outputanalyzer.verbose` to `output buffer.verbose` would make it cleaner, and avoid referencing the OutputAnalyzer in the OutputBuffer implementation.
-------------
Commit messages:
- Update test/lib/jdk/test/lib/process/OutputBuffer.java
- Initial working solution
Changes: https://git.openjdk.org/jdk/pull/25587/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=25587&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8356438
Stats: 8 lines in 1 file changed: 4 ins; 0 del; 4 mod
Patch: https://git.openjdk.org/jdk/pull/25587.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/25587/head:pull/25587
PR: https://git.openjdk.org/jdk/pull/25587
More information about the core-libs-dev
mailing list