RFR: 8303697: ProcessTools doesn't print last line of process output [v2]
David Holmes
dholmes at openjdk.org
Thu Mar 16 04:43:26 UTC 2023
On Wed, 15 Mar 2023 14:23:43 GMT, Leonid Mesnik <lmesnik at openjdk.org> wrote:
>> Leonid Mesnik has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fixed test
>
> test/lib/jdk/test/lib/process/StreamPumper.java line 145:
>
>> 143: }
>> 144: }
>> 145: final String line = lineBos.toString();
>
> The code in 'lastcrlf == -1' as well as in 'lastcrlf < len - 1' writes remaining buf into lineBos. This lineBos is used to make line which is processed in line 127.
> However, if the stream is emptied then the chunk after last '\n' is written in in the lineBos but we never reach line 127 to call processLine for it.
Thanks for the additional offline explanations about this code.
-------------
PR: https://git.openjdk.org/jdk/pull/13034
More information about the core-libs-dev
mailing list