mirror of https://github.com/apache/lucene.git
Generics Policeman ticket
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@948234 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a0c72afb31
commit
9e61dd591f
|
@ -63,8 +63,9 @@ public final class SnowballFilter extends TokenFilter {
|
|||
public SnowballFilter(TokenStream in, String name) {
|
||||
super(in);
|
||||
try {
|
||||
Class<?> stemClass = Class.forName("org.tartarus.snowball.ext." + name + "Stemmer");
|
||||
stemmer = (SnowballProgram) stemClass.newInstance();
|
||||
Class<? extends SnowballProgram> stemClass =
|
||||
Class.forName("org.tartarus.snowball.ext." + name + "Stemmer").asSubclass(SnowballProgram.class);
|
||||
stemmer = stemClass.newInstance();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e.toString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue