LUCENE-2510: Slightly less stupid generics - arrrrgh

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene2510@1365219 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-07-24 18:50:31 +00:00
parent d1ad745f53
commit 2a6a024fd5
1 changed files with 3 additions and 4 deletions

View File

@ -420,13 +420,12 @@ public class SolrResourceLoader implements ResourceLoader
spiLoaders.put(TokenFilterFactory.class, TokenFilterFactory.getSPILoader(classLoader));
expectedTypesSPILoaders.put(classLoader, spiLoaders);
}
AnalysisSPILoader<? extends AbstractAnalysisFactory> loader = spiLoaders.get(expectedType);
@SuppressWarnings("unchecked") final AnalysisSPILoader<? extends T> loader =
(AnalysisSPILoader<? extends T>) spiLoaders.get(expectedType);
if (loader != null) {
// it's a correct expected type for analysis! Let's go on!
try {
@SuppressWarnings("unchecked")
final Class<? extends T> cl = (Class<? extends T>) loader.lookupClass(m.group(4));
return clazz = cl;
return clazz = loader.lookupClass(m.group(4));
} catch (IllegalArgumentException ex) {
// ok, we fall back to legacy loading
}