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

Roger Riggs rriggs at openjdk.org
Mon Sep 22 19:04:24 UTC 2025


On Mon, 22 Sep 2025 09:38:49 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Roger Riggs has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   The CSR review prompted the expansion of the description of responsibilities
>>   of subclasses of Process to invoke `super.close()` if overriding the `close()` method.
>
> src/java.base/share/classes/java/lang/Process.java line 180:
> 
>> 178: 
>> 179:     /**
>> 180:      * Close all writer and reader streams and terminate the process.
> 
> Maybe not in this PR but I think we'll have to take a pass over the Process docs so that it uses consistent terminology.  Right now the class description speaks of "Destroying a process" and defines "destroy" methods to "kill" a process.  The "destroyForcibly" method speaks of the process being "forcibly terminated".  The update to the close method means it is specified to "terminate" a process. It just means different terms in the first sentence of method descriptions.  I think we could make "terminate", "terminate forcibly", and "await termination" work.

https://bugs.openjdk.org/browse/JDK-8080772 is an enhancement to improve consistency of terminology around processes. I added a comment on termination there.

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

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


More information about the core-libs-dev mailing list