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

Brian Burkhalter brian.burkhalter at oracle.com
Tue Sep 10 14:40:15 UTC 2019


Hi Roger,

> On Sep 10, 2019, at 7:33 AM, Roger Riggs <Roger.Riggs at oracle.com> wrote:
> 
> Reconsidering...
> 
> If the current line number starts at zero and is incremented only by CR/LF
> then my example program is wrong.  It called getLineNumber *after* reading
> the line and it should have called it *before*.

After the previous exchange I actually wondered about that and tested it.

> So I can support your original patch (modulo not using AtomicBoolean).

I’ll change that.

> (Though my suggestion about doing all the work of keeping track of the line number in BufferedReader
> is still a valid though separate suggestion).

I’ll look into this before reposting anything.

Thanks,

Brian


More information about the core-libs-dev mailing list