Lucene - Core
  1. Lucene - Core
  2. LUCENE-6112

Compile error with FST package example code

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 4.10.2
    • Fix Version/s: 5.0, 6.0
    • Component/s: core/FSTs
    • Labels:
      None
    • Lucene Fields:
      New, Patch Available

      Description

      I run the FST construction example guided package.html with lucene 4.10, and found a compile error.
      http://lucene.apache.org/core/4_10_2/core/index.html?org/apache/lucene/util/fst/package-summary.html

      javac claimed as below.
      "FSTTest" is my test class, just copied from javadoc's example.

      $ javac -cp /opt/lucene-4.10.2/core/lucene-core-4.10.2.jar FSTTest.java 
      FSTTest.java:28: error: method toIntsRef in class Util cannot be applied to given types;
            builder.add(Util.toIntsRef(scratchBytes, scratchInts), outputValues[i]);
                            ^
        required: BytesRef,IntsRefBuilder
        found: BytesRef,IntsRef
        reason: actual argument IntsRef cannot be converted to IntsRefBuilder by method invocation conversion
      Note: FSTTest.java uses or overrides a deprecated API.
      Note: Recompile with -Xlint:deprecation for details.
      1 error
      

      I modified scratchInts variable type from IntsRef to IntsRefBuilder, it worked fine. (I checked o.a.l.u.fst.TestFSTs.java TestCase and my modification seems to be correct.)

      Util.toIntsRef() method takes IntsRefBuilder as 2nd argument instead of IntsRef since 4.10, so Javadocs also should be fixed.

      1. LUCENE-6112.patch
        0.8 kB
        Tomoko Uchida

        Activity

        Hide
        Tomoko Uchida added a comment - - edited

        I attached a fix for FSTs package.html

        Show
        Tomoko Uchida added a comment - - edited I attached a fix for FSTs package.html
        Hide
        ASF subversion and git services added a comment -

        Commit 1645548 from Koji Sekiguchi in branch 'dev/trunk'
        [ https://svn.apache.org/r1645548 ]

        LUCENE-6112: Fix compile error in FST package example code

        Show
        ASF subversion and git services added a comment - Commit 1645548 from Koji Sekiguchi in branch 'dev/trunk' [ https://svn.apache.org/r1645548 ] LUCENE-6112 : Fix compile error in FST package example code
        Hide
        ASF subversion and git services added a comment -

        Commit 1645549 from Koji Sekiguchi in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1645549 ]

        LUCENE-6112: Fix compile error in FST package example code

        Show
        ASF subversion and git services added a comment - Commit 1645549 from Koji Sekiguchi in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1645549 ] LUCENE-6112 : Fix compile error in FST package example code
        Hide
        Koji Sekiguchi added a comment -

        Thanks, Uchida-san!

        Show
        Koji Sekiguchi added a comment - Thanks, Uchida-san!
        Hide
        Anshum Gupta added a comment -

        Bulk close after 5.0 release.

        Show
        Anshum Gupta added a comment - Bulk close after 5.0 release.

          People

          • Assignee:
            Koji Sekiguchi
            Reporter:
            Tomoko Uchida
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development