throw IllegalArgumentException to avoid endless loop

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@154076 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2005-02-16 20:07:38 +00:00
parent 28e712b2ee
commit 52537afdb6
1 changed files with 4 additions and 0 deletions

View File

@ -286,8 +286,12 @@ public class IndexWriter {
* the number of files open in a FSDirectory.
*
* <p> The default value is 10.
*
* @throws IllegalArgumentException if maxBufferedDocs is smaller than 1
*/
public void setMaxBufferedDocs(int maxBufferedDocs) {
if (maxBufferedDocs < 1)
throw new IllegalArgumentException("maxBufferedDocs must at least be 1");
this.minMergeDocs = maxBufferedDocs;
}