LUCENE-3969: add missing IAE to WikipediaTokenizer ctor

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/lucene3969@1311294 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-04-09 16:00:41 +00:00
parent 102ece7710
commit d76a03214c
1 changed files with 6 additions and 0 deletions

View File

@ -177,6 +177,12 @@ public final class WikipediaTokenizer extends Tokenizer {
}
private void init(int tokenOutput, Set<String> untokenizedTypes) {
// TODO: cutover to enum
if (tokenOutput != TOKENS_ONLY &&
tokenOutput != UNTOKENIZED_ONLY &&
tokenOutput != BOTH) {
throw new IllegalArgumentException("tokenOutput must be TOKENS_ONLY, UNTOKENIZED_ONLY or BOTH");
}
this.tokenOutput = tokenOutput;
this.untokenizedTypes = untokenizedTypes;
}