On Thu, 30 Apr 2026 14:23:08 GMT, ExE Boss <[email protected]> wrote:

>> Michael McMahon has updated the pull request incrementally with two 
>> additional commits since the last revision:
>> 
>>  - patch from rriggs (modified slightly)
>>  - patch contributed by rriggs
>
> src/java.base/share/classes/java/lang/ProcessHandleImpl.java line 317:
> 
>> 315:     public Optional<ProcessHandle> parent() {
>> 316:         long ppid = parent0(pid, startTime);
>> 317:         if (ppid <= 0) {
> 
> Note that `ProcessHandleImpl​::parent()` also needs to correctly handle a 
> parent PID of `0`:
> Suggestion:
> 
>         if (ppid < 0 || ppid == pid) {
> 
> 
> Refs: 
> https://github.com/openjdk/jdk/pull/30923/files/4cb921490631363188d75a84810b6150fc827aa1..9f1f6e72e9a5ba96e9cad416dfe402081ef0fdf0

> Note that `ProcessHandleImpl​::parent()` also needs to correctly handle a 
> parent PID of `0`:
> 
> Refs: 
> https://github.com/openjdk/jdk/pull/30923/files/4cb921490631363188d75a84810b6150fc827aa1..9f1f6e72e9a5ba96e9cad416dfe402081ef0fdf0

Thanks. I'll take the suggestion. I'll also update the return doc comment to 
say an empty Optional is returned rather than null.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/30763#discussion_r3169050263

Reply via email to