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:
Uwe Schindler 2012-07-27 00:31:24 +00:00
parent a7cd5f3384
commit 657e0e98ab
1 changed files with 3 additions and 3 deletions

View File

@ -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());