When there is a parsing exception, we read ahead to show up to 20 characters of context. Previously, if that read-ahead included newlines we would include those in the computed line number. Now we show the line number where the parse error occurred, which is more accurate.
This showed up as a test failure with JDK ≥ 16, because this commit changed the behaviour of LineNumberReader such that an EOF without an immediately-preceding newline is treated as if there were an implicit newline there.
Improve line numbers in exception messages.
When there is a parsing exception, we read ahead to show up to 20 characters of context. Previously, if that read-ahead included newlines we would include those in the computed line number. Now we show the line number where the parse error occurred, which is more accurate.
This showed up as a test failure with JDK ≥ 16, because this commit changed the behaviour of
LineNumberReader
such that an EOF without an immediately-preceding newline is treated as if there were an implicit newline there.RELNOTES=n/a