8218280: LineNumberReader throws "Mark invalid" exception if CRLF straddles buffer.
daniel.fuchs at oracle.com
Fri Apr 26 11:23:06 UTC 2019
I believe this looks good.
I had to convince myself that there was no issue when
'\r' is not followed by '\n' but I couldn't fault the
I wonder if adding a third test case with '\r' not
followed by '\n' would be a good idea?
On 26/04/2019 02:20, Brian Burkhalter wrote:
> For issue  please review the patch .
> The source change merely changes mark() to use a read ahead limit one value larger than the parameter if the most recently read character is a ‘\r’ (carriage return). In this case if the next character in the stream is a ‘\n’ (line feed), the next read() would actually consume two characters instead of one. The incremented read ahead limit compensates for this.
> The two sub-tests of the test both fail without the implementation change and succeed with it.
>  https://bugs.openjdk.java.net/browse/JDK-8218280 <https://bugs.openjdk.java.net/browse/JDK-8218280>
>  http://cr.openjdk.java.net/~bpb/8218280/webrev.00/
More information about the core-libs-dev