Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-6112

Compile error with FST package example code

    Details

    • Type: Task
    • Status: Closed
    • Priority: 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.

        Attachments

        1. LUCENE-6112.patch
          0.8 kB
          Tomoko Uchida

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: