mirror of https://github.com/apache/lucene.git
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:
parent
25ad7daa58
commit
3f99c3c2fd
|
@ -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) {
|
||||||
|
|
Loading…
Reference in New Issue