RFR: 8336479: Provide Process.waitFor(Duration) [v2]

Jaikiran Pai jpai at openjdk.org
Thu Jul 18 05:19:31 UTC 2024


On Wed, 17 Jul 2024 21:41:16 GMT, Naoto Sato <naoto at openjdk.org> wrote:

>> Proposing a new overload method for `Process#waitFor()` which takes a `Duration` for the timeout value. This will reduce the possibility for making mistakes with the `TimeUnit` in the other overload method. A corresponding CSR has also been drafted.
>
> Naoto Sato has updated the pull request incrementally with one additional commit since the last revision:
> 
>   ProcessTools overriding one-arg waitFor()

src/java.base/share/classes/java/lang/Process.java line 499:

> 497:         Objects.requireNonNull(duration, "duration"); // throw NPE before other conditions
> 498: 
> 499:         if (hasExited())

For clarity, the javadoc on the private internal `hasExited()` method might need an update - it currently states that the method will be invoked from `waitFor(long, TimeUnit)`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20220#discussion_r1682133588


More information about the core-libs-dev mailing list