mirror of https://github.com/apache/lucene.git
SOLR-822: avoid ClassCastException when CharStreamAware*TokenizerFactory is used without CharFilter
git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@758137 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
96a3f027ce
commit
82965b7fa1
|
@ -30,6 +30,10 @@ import org.apache.lucene.analysis.TokenStream;
|
|||
public class CharStreamAwareCJKTokenizerFactory extends BaseTokenizerFactory {
|
||||
|
||||
public CharStreamAwareCJKTokenizer create(Reader input) {
|
||||
return new CharStreamAwareCJKTokenizer( (CharStream)input );
|
||||
return new CharStreamAwareCJKTokenizer(
|
||||
input instanceof CharStream ?
|
||||
(CharStream)input :
|
||||
new CharReader(input)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,6 +30,10 @@ import org.apache.lucene.analysis.TokenStream;
|
|||
public class CharStreamAwareWhitespaceTokenizerFactory extends BaseTokenizerFactory {
|
||||
|
||||
public CharStreamAwareWhitespaceTokenizer create(Reader input) {
|
||||
return new CharStreamAwareWhitespaceTokenizer( (CharStream)input );
|
||||
return new CharStreamAwareWhitespaceTokenizer(
|
||||
input instanceof CharStream ?
|
||||
(CharStream)input :
|
||||
new CharReader(input)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue