LUCENE-6039: add another null check

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1637541 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2014-11-08 11:18:51 +00:00
parent ca8681a449
commit f7e6d2f177
1 changed files with 3 additions and 0 deletions

View File

@ -140,6 +140,9 @@ public final class FieldInfo {
}
void setDocValuesType(DocValuesType type) {
if (type == null) {
throw new NullPointerException("DocValuesType cannot be null (field: \"" + name + "\")");
}
if (docValuesType != DocValuesType.NONE && type != DocValuesType.NONE && docValuesType != type) {
throw new IllegalArgumentException("cannot change DocValues type from " + docValuesType + " to " + type + " for field \"" + name + "\"");
}