lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r1365219 - /lucene/dev/branches/lucene2510/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
Date Tue, 24 Jul 2012 18:50:31 GMT
Author: uschindler
Date: Tue Jul 24 18:50:31 2012
New Revision: 1365219

URL: http://svn.apache.org/viewvc?rev=1365219&view=rev
Log:
LUCENE-2510: Slightly less stupid generics - arrrrgh

Modified:
    lucene/dev/branches/lucene2510/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java

Modified: lucene/dev/branches/lucene2510/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene2510/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java?rev=1365219&r1=1365218&r2=1365219&view=diff
==============================================================================
--- lucene/dev/branches/lucene2510/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
(original)
+++ lucene/dev/branches/lucene2510/solr/core/src/java/org/apache/solr/core/SolrResourceLoader.java
Tue Jul 24 18:50:31 2012
@@ -420,13 +420,12 @@ public class SolrResourceLoader implemen
         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
         }



Mime
View raw message