From 0e8612512489d4101655950618f7442e9ce66d50 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Mon, 28 Feb 2011 17:38:33 +0000 Subject: [PATCH] LUCENE-2918: fix thread safety bug w/ assert statement git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1075443 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/src/java/org/apache/lucene/index/IndexWriter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lucene/src/java/org/apache/lucene/index/IndexWriter.java b/lucene/src/java/org/apache/lucene/index/IndexWriter.java index 12459f3cd21..3b2d7603ccc 100644 --- a/lucene/src/java/org/apache/lucene/index/IndexWriter.java +++ b/lucene/src/java/org/apache/lucene/index/IndexWriter.java @@ -3199,10 +3199,10 @@ public class IndexWriter implements Closeable { final SegmentReader clone = (SegmentReader) reader.clone(true); merge.readerClones.add(clone); - if (reader.numDocs() > 0) { + if (clone.numDocs() > 0) { merger.add(clone); + totDocCount += clone.numDocs(); } - totDocCount += clone.numDocs(); segUpto++; }