Lucene has a test to check certain broken input files with patterns (hunspell library). The files are read by LineNumberReader.
The test expects a ParseException which is thrown by Lucene's code. The PraseException is initialized using the LineNumberReader#getLineNumber() method to refer to the line number where the parse error occurs. The test asserts that error occurs on correct line number.
With latest JDK14 EA builds (b24), the line number is one-off (23 instead of 24).
Code:
https://github.com/apache/lucene-solr/blob/53064e46ddfc94a0b0e1d9c9f3e94786fb6701cd/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/TestDictionary.java#L127-L142
The code to read the file is in Dictionary:
https://github.com/apache/lucene-solr/blob/78d5cfefe2453345c498984bf0e405d254a9d5bc/lucene/analysis/common/src/java/org/apache/lucene/analysis/hunspell/Dictionary.java#L320-L394
Test file:
https://github.com/apache/lucene-solr/blob/master/lucene/analysis/common/src/test/org/apache/lucene/analysis/hunspell/broken.aff#L24
To reproduce check out Lucene/Solr from Github, run "ant bootstrap" from checkout root and then run "ant test" inside lucene/analysis/common.
With JDK 11, 12, 13 it works (also Java 8 in previous Lucene release branch), but fails with 14 b24.