RFR: 8294899: Process.waitFor() throws IllegalThreadStateException when a process on Windows returns an exit code of 259
Roger Riggs
rriggs at openjdk.org
Tue Nov 8 16:04:26 UTC 2022
On Wed, 12 Oct 2022 16:30:07 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
> Process.waitFor() throws IllegalThreadStateException when a process returns an exit code of 259.
> As described in the bug report, `waitFor()` should not be sensitive to the exit value.
> Previously, it erroneously threw IllegalStateException.
> Added a test to verify.
Though `waitForInterruptibly(handle)` doesn't check the handle, the code in the caller `ProcessImpl.waitFor()` calls `Thread.interrupted()` and throws the `InterruptedException` if needed.
So the exit code is returned only if the process had exited.
-------------
PR: https://git.openjdk.org/jdk/pull/10680
More information about the core-libs-dev
mailing list