mirror of https://github.com/apache/lucene.git
LUCENE-2510: remove unchecked cast :-) It's much easier!
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene2510@1365030 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6e966079b1
commit
75b3fe9c81
|
@ -56,9 +56,7 @@ public final class AnalysisSPILoader<S extends AbstractAnalysisFactory> {
|
|||
// them used instead of others
|
||||
if (!services.containsKey(name)) {
|
||||
assert checkServiceName(name);
|
||||
@SuppressWarnings("unchecked")
|
||||
final Class<? extends S> sclazz = (Class<? extends S>) service.getClass();
|
||||
services.put(name, sclazz);
|
||||
services.put(name, service.getClass().asSubclass(clazz));
|
||||
}
|
||||
}
|
||||
this.services = Collections.unmodifiableMap(services);
|
||||
|
|
Loading…
Reference in New Issue