title: Lucene exception NoSuchMethodError with version 6.4.0
body: <p>I am relatively new to Lucene and playing with the latest version 6.4.0.</p>
  
  <p>I have written a cutom analyzer class for doing synonyms,</p>
  
  <pre><code>public class MySynonymAnalyzer extends Analyzer {
  
  @Override
  protected TokenStreamComponents createComponents(String fieldName) {
      Tokenizer source = new ClassicTokenizer();
      TokenStream filter = new StandardFilter(source);
      filter = new LowerCaseFilter(filter);
      filter = new SynonymGraphFilter(filter, getSynonymsMap(), false);
      filter = new FlattenGraphFilter(filter);
      return new TokenStreamComponents(source, filter);
  }
  
  private SynonymMap getSynonymsMap() {
      try {
          SynonymMap.Builder builder = new SynonymMap.Builder(true);
          builder.add(new CharsRef("work"), new CharsRef("labor"), true);
          builder.add(new CharsRef("work"), new CharsRef("effort"), true);
          SynonymMap mySynonymMap = builder.build();
          return mySynonymMap;
      } catch (Exception ex) {
          return null;
      }
  }
  </code></pre>
  
  <p>In the line where I call <code>getSynonymsMap()</code>, I get the following exception:</p>
  
  <blockquote>
    <p>Exception in thread "main" java.lang.NoSuchMethodError: org.apache.lucene.util.UnicodeUtil.UTF16toUTF8WithHash([CIILorg/apache/lucene/util/BytesRef;)I
        at org.apache.lucene.analysis.synonym.SynonymMap$Builder.add(SynonymMap.java:192)
        at org.apache.lucene.analysis.synonym.SynonymMap$Builder.add(SynonymMap.java:239)
        at m2_lab4.MySynonymAnalyzer.getSynonymsMap(MySynonymAnalyzer.java:37)
        at m2_lab4.MySynonymAnalyzer.createComponents(MySynonymAnalyzer.java:28)
        at org.apache.lucene.analysis.Analyzer.tokenStream(Analyzer.java:162)
        at org.apache.lucene.document.Field.tokenStream(Field.java:568)</p>
  </blockquote>
  
  <p>Version 6.4.0 doesn't seem to have method <code>UTF16toUTF8WithHash</code> in class <code>UnicodeUtil</code>. I am using everything from lucene 6.4.0 and there doesn't seem to be any old versioned jar in my classpath. This is how my maven dependendies look like:</p>
  
  <pre><code>&lt;properties&gt;
      &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
      &lt;maven.compiler.source&gt;1.8&lt;/maven.compiler.source&gt;
      &lt;maven.compiler.target&gt;1.8&lt;/maven.compiler.target&gt;
      &lt;lucene.version&gt;6.4.0&lt;/lucene.version&gt;
  &lt;/properties&gt;
  &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.lucene&lt;/groupId&gt;
          &lt;artifactId&gt;lucene-core&lt;/artifactId&gt;
          &lt;version&gt;${lucene.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.lucene&lt;/groupId&gt;
          &lt;artifactId&gt;lucene-analyzers-common&lt;/artifactId&gt;
          &lt;version&gt;${lucene.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.lucene&lt;/groupId&gt;
          &lt;artifactId&gt;lucene-queryparser&lt;/artifactId&gt;
          &lt;version&gt;${lucene.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.lucene&lt;/groupId&gt;
          &lt;artifactId&gt;lucene-queries&lt;/artifactId&gt;
          &lt;version&gt;${lucene.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.lucene&lt;/groupId&gt;
          &lt;artifactId&gt;lucene-analyzers&lt;/artifactId&gt;
          &lt;version&gt;3.6.2&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.lucene&lt;/groupId&gt;
          &lt;artifactId&gt;lucene-facet&lt;/artifactId&gt;
          &lt;version&gt;${lucene.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
          &lt;groupId&gt;org.apache.lucene&lt;/groupId&gt;
          &lt;artifactId&gt;lucene-spatial&lt;/artifactId&gt;
          &lt;version&gt;${lucene.version}&lt;/version&gt;
      &lt;/dependency&gt;
  
      &lt;dependency&gt;
              &lt;groupId&gt;com.spatial4j&lt;/groupId&gt;
              &lt;artifactId&gt;spatial4j&lt;/artifactId&gt;
              &lt;version&gt;0.4.1&lt;/version&gt;
      &lt;/dependency&gt;
  
  
      &lt;dependency&gt;
              &lt;groupId&gt;org.json&lt;/groupId&gt;
              &lt;artifactId&gt;json&lt;/artifactId&gt;
              &lt;version&gt;20090211&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
              &lt;groupId&gt;org.apache.commons&lt;/groupId&gt;
              &lt;artifactId&gt;commons-io&lt;/artifactId&gt;
              &lt;version&gt;1.3.2&lt;/version&gt;
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  </code></pre>
  
  <p>Any idea what's going on? I am specially puzzled by the <code>[CIILorg/apache/lucene/util/BytesRef</code> text inside the exception description.</p>