From 3f99c3c2fdbe2eee1f0155140d2e3be5f808e41c Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Wed, 1 Feb 2012 01:00:03 +0000 Subject: [PATCH] LUCENE-3733: simplier way to test for closed reader... git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1238892 13f79535-47bb-0310-9956-ffa450edef68 --- .../lucene/facet/taxonomy/directory/TestIndexClose.java | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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.java index 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) {