Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8235668

LineNumberReader#getLineNumber() returns wrong line number (one fewer) in Lucene test

    XMLWordPrintable

Details

    • 14
    • b28
    • generic
    • generic
    • Not verified

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

                bpb Brian Burkhalter
                uschindler Uwe Schindler
                Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: