mirror of https://github.com/apache/lucene.git
LUCENE-4259: Improvement to expectedType
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1366247 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a7cd5f3384
commit
657e0e98ab
|
@ -403,11 +403,11 @@ public class SolrResourceLoader implements ResourceLoader
|
|||
final String name = m.group(4);
|
||||
log.trace("Trying to load class from analysis SPI using name='{}'", name);
|
||||
try {
|
||||
if (CharFilterFactory.class == expectedType) {
|
||||
if (CharFilterFactory.class.isAssignableFrom(expectedType)) {
|
||||
return clazz = CharFilterFactory.lookupClass(name).asSubclass(expectedType);
|
||||
} else if (TokenizerFactory.class == expectedType) {
|
||||
} else if (TokenizerFactory.class.isAssignableFrom(expectedType)) {
|
||||
return clazz = TokenizerFactory.lookupClass(name).asSubclass(expectedType);
|
||||
} else if (TokenFilterFactory.class == expectedType) {
|
||||
} else if (TokenFilterFactory.class.isAssignableFrom(expectedType)) {
|
||||
return clazz = TokenFilterFactory.lookupClass(name).asSubclass(expectedType);
|
||||
} else {
|
||||
log.warn("'{}' looks like an analysis factory, but caller requested different class type: {}", cname, expectedType.getName());
|
||||
|
|
Loading…
Reference in New Issue