You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Tomoko Uchida (JIRA)" <ji...@apache.org> on 2014/12/14 07:32:13 UTC

[jira] [Created] (LUCENE-6112) Compile error with FST package example code

Tomoko Uchida created LUCENE-6112:
-------------------------------------

             Summary: Compile error with FST package example code
                 Key: LUCENE-6112
                 URL: https://issues.apache.org/jira/browse/LUCENE-6112
             Project: Lucene - Core
          Issue Type: Task
          Components: core/FSTs
    Affects Versions: 4.10.2
            Reporter: Tomoko Uchida
            Priority: Minor


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.

{code}
$ 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
{code}

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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org