lucene-solr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Glentworth (JIRA)" <>
Subject [jira] Created: (SOLR-1382) TokenizerChain ClassCastException
Date Tue, 25 Aug 2009 15:41:59 GMT
TokenizerChain ClassCastException

                 Key: SOLR-1382
             Project: Solr
          Issue Type: Bug
          Components: Analysis
    Affects Versions: 1.4
            Reporter: Simon Glentworth
             Fix For: 1.4

TokenizerChain casts the result of create method in TokenizerFactory to Tokenizer.

  public TokenStreamInfo getStream(String fieldName, Reader reader) {
    Tokenizer tk = (Tokenizer)tokenizer.create(charStream(reader));

The TokenizerFactory interface specifies a return type of TokenStream not Tokenizer.

  /** Creates a TokenStream of the specified input */
  public TokenStream create(Reader input);

Tokenizer is a subclass of TokenStream and TokenizerChain is luckily working in most cases
since most token factories return a Tokenizer. The following token factories return a TokenStream
and will cause a ClassCastException.


This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message