RFR: 8294899: Process.waitFor() throws IllegalThreadStateException when a process on Windows returns an exit code of 259

Alan Bateman alanb at openjdk.org
Sun Oct 16 06:51:59 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.

Marked as reviewed by alanb (Reviewer).

test/jdk/java/lang/ProcessBuilder/WindowsExitValue.java line 46:

> 44:             assertEquals(exitValue, 259);
> 45:         } catch (InterruptedException ie) {
> 46:             org.junit.Assert.fail("InterruptedException not expected");

Not important but I assume you can use fail("...") here, or just drop the try-finally so that the test fails if waitFor throws.

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

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


More information about the core-libs-dev mailing list