Apache Lucene open-source search software
LUCENE-3733: simplier way to test for closed reader...
Uwe Schindler3f99c3c2fdbe
diff --git a/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java b/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.javaindex e9445aceae5..1c5b2f574ad 100644--- a/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java+++ b/modules/facet/src/test/org/apache/lucene/facet/taxonomy/directory/TestIndexClose.java@@ -113,13 +113,9 @@ public class TestIndexClose extends LuceneTestCase {public int nopen() {int ret=0;for (DirectoryReader r: readers) {- try {- // this should throw ex, if already closed!- r.getTopReaderContext();+ if (r.getRefCount() > 0) {System.err.println("reader "+r+" still open");ret++;- } catch (AlreadyClosedException e) {- // fine}}for (int i: openWriters) {