RFR: 8261949: fileStream::readln returns incorrect line string [v2]

Daniel D.Daugherty dcubed at openjdk.java.net
Fri Feb 19 02:58:41 UTC 2021


On Fri, 19 Feb 2021 02:08:52 GMT, Yang Yi <github.com+5010047+kelthuzadx at openjdk.org> wrote:

>> When the last line does not contain a NEWLINE character, fileStream::readln would read
>> truncated line string:
>> 
>> $ cat file_content:
>> AA
>> BB
>> CC<EOF>
>> 
>> fileStream::readln result:
>> "AA"
>> "BB"
>> "C"
>> 
>> This patch address this problem, it works for Posix and Windows since the last character
>> of these systems is always '\n'.
>
> Yang Yi has updated the pull request incrementally with one additional commit since the last revision:
> 
>   tweak

I like David's suggestion better than mine.
Thumbs up.

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

Marked as reviewed by dcubed (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/2626


More information about the hotspot-runtime-dev mailing list