LUCENE-6213: Revert accidental removal of code from readCommit (bad merge)

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1676650 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Ryan Ernst 2015-04-29 00:23:30 +00:00
parent f59604f885
commit d49fe2fb6d
1 changed files with 5 additions and 0 deletions

View File

@ -344,6 +344,11 @@ public final class SegmentInfos implements Cloneable, Iterable<SegmentCommitInfo
CodecUtil.checkFooter(input);
// LUCENE-6299: check we are in bounds
if (totalDocs > IndexWriter.getActualMaxDocs()) {
throw new CorruptIndexException("Too many documents: an index cannot exceed " + IndexWriter.getActualMaxDocs() + " but readers have total maxDoc=" + totalDocs, input);
}
return infos;
}
}