On Tue, 13 Jan 2026 20:04:49 GMT, Roger Riggs <[email protected]> wrote:

>> Ioi Lam has updated the pull request incrementally with one additional 
>> commit since the last revision:
>> 
>>   Review comments from @RogerRiggs
>
> src/java.base/windows/classes/java/lang/ProcessImpl.java line 125:
> 
>> 123:                     if (stdHandles[1] == -1L) {
>> 124:                         // FileDescriptor.out has been closed.
>> 125:                         file1 = Redirect.DISCARD;
> 
> Suggestion:
> 
>                         // FileDescriptor.out has been closed.
>                         f1 = newFileOutputStream(Redirect.DISCARD.file(),
>                                 Redirect.DISCARD.append());
>                         stdHandles[1] = fdAccess.getHandle(f1.getFD());
> 
> Inline the change and avoid extra local state variable

To avoid cut-and-pasting the same code 4 times, I refactored the code into a 
separate function, `setFileOutput()`.

> test/jdk/java/lang/ProcessBuilder/InheritIOClosed.java line 52:
> 
>> 50:                               "1234567890" +
>> 51:                               "1234567890" +
>> 52:                               "1234567890";
> 
> Suggestion:
> 
>     private final static Path JAVA_EXE =
>             Path.of(System.getProperty("java.home"), "bin", "java");
> 
>     private static final String s = "1234567890".repeat(10);
> 
> Path is more compact.

Fixed as suggested.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/29198#discussion_r2688783638
PR Review Comment: https://git.openjdk.org/jdk/pull/29198#discussion_r2688784628

Reply via email to