8230342: LineNumberReader.getLineNumber() returns inconsistent results after EOF

Brian Burkhalter brian.burkhalter at oracle.com
Thu Sep 5 15:11:43 UTC 2019


https://bugs.openjdk.java.net/browse/JDK-8230342
http://cr.openjdk.java.net/~bpb/8230342/webrev.00/

When the last line is read by readLine() the line number is incremented due to the EOF but not when read() or read(char[]) is used. The specification states it is incremented on line terminators only. The alternative solution would be to change the specification to state that the line number is also incremented on EOF even if there is no line terminator at the end of the stream. That would entail a different implementation change.

Thanks,

Brian


More information about the core-libs-dev mailing list