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
This commit is contained in:
Uwe Schindler 2012-02-01 01:00:03 +00:00
parent 25ad7daa58
commit 3f99c3c2fd
1 changed files with 1 additions and 5 deletions

View File

@ -113,13 +113,9 @@ public class TestIndexClose extends LuceneTestCase {
public int nopen() { public int nopen() {
int ret=0; int ret=0;
for (DirectoryReader r: readers) { for (DirectoryReader r: readers) {
try { if (r.getRefCount() > 0) {
// this should throw ex, if already closed!
r.getTopReaderContext();
System.err.println("reader "+r+" still open"); System.err.println("reader "+r+" still open");
ret++; ret++;
} catch (AlreadyClosedException e) {
// fine
} }
} }
for (int i: openWriters) { for (int i: openWriters) {