You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-dev@lucene.apache.org by "Simon Glentworth (JIRA)" <ji...@apache.org> on 2009/08/25 17:41:59 UTC

[jira] Created: (SOLR-1382) TokenizerChain ClassCastException

TokenizerChain ClassCastException
---------------------------------

                 Key: SOLR-1382
                 URL: https://issues.apache.org/jira/browse/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.

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

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

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

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.

HTMLStripWhitespaceTokenizerFactory
HTMLStripStandardTokenizerFactory
PatternTokenizerFactory
TrieTokenizerFactory





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


[jira] Commented: (SOLR-1382) TokenizerChain ClassCastException

Posted by "Yonik Seeley (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/SOLR-1382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12747465#action_12747465 ] 

Yonik Seeley commented on SOLR-1382:
------------------------------------

I think these should all be fixed in trunk?  See SOLR-1377

> TokenizerChain ClassCastException
> ---------------------------------
>
>                 Key: SOLR-1382
>                 URL: https://issues.apache.org/jira/browse/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.
> {noformat}
>   public TokenStreamInfo getStream(String fieldName, Reader reader) {
>     Tokenizer tk = (Tokenizer)tokenizer.create(charStream(reader));
> {noformat}
> The TokenizerFactory interface specifies a return type of TokenStream not Tokenizer.
> {noformat}
>   /** Creates a TokenStream of the specified input */
>   public TokenStream create(Reader input);
> {noformat}
> 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.
> HTMLStripWhitespaceTokenizerFactory
> HTMLStripStandardTokenizerFactory
> PatternTokenizerFactory
> TrieTokenizerFactory

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


[jira] Closed: (SOLR-1382) TokenizerChain ClassCastException

Posted by "Simon Glentworth (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/SOLR-1382?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Simon Glentworth closed SOLR-1382.
----------------------------------

    Resolution: Duplicate

Ooops sorry - missed the earlier issue (and fix).

> TokenizerChain ClassCastException
> ---------------------------------
>
>                 Key: SOLR-1382
>                 URL: https://issues.apache.org/jira/browse/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.
> {noformat}
>   public TokenStreamInfo getStream(String fieldName, Reader reader) {
>     Tokenizer tk = (Tokenizer)tokenizer.create(charStream(reader));
> {noformat}
> The TokenizerFactory interface specifies a return type of TokenStream not Tokenizer.
> {noformat}
>   /** Creates a TokenStream of the specified input */
>   public TokenStream create(Reader input);
> {noformat}
> 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.
> HTMLStripWhitespaceTokenizerFactory
> HTMLStripStandardTokenizerFactory
> PatternTokenizerFactory
> TrieTokenizerFactory

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