RFR: 8364361: [process] java.lang.Process should implement Closeable [v14]

Jason Mehrens duke at openjdk.org
Sat Oct 4 13:15:48 UTC 2025


On Sat, 4 Oct 2025 06:48:18 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>... It puts doubt into the reader's mind that the process may not have terminated and call waitFor after close to be sure.

Process::isAlive may be true or false after Process::destroy.  The API docs shouldn't forbid nor require a call to waitFor after close/destroy. If process is holding a lock on input file (Windows) and that caller want to delete after exit, the caller waitFor after close/destroy before calling File::delete. Destroy/close not waiting on exit is correct behavior.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26649#discussion_r2403969226


More information about the core-libs-dev mailing list