-
Bug
-
Resolution: Fixed
-
P3
-
14
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8236012 | 15 | Brian Burkhalter | P3 | Resolved | Fixed | b02 |
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.
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.
- backported by
-
JDK-8236012 LineNumberReader#getLineNumber() returns wrong line number (one fewer) in Lucene test
-
- Resolved
-
- relates to
-
JDK-8230342 LineNumberReader.getLineNumber() returns inconsistent results after EOF
-
- Resolved
-
-
JDK-8235792 LineNumberReader.getLineNumber() behavior is inconsistent with respect to EOF
-
- Resolved
-
- links to