fix more linefiledocs leaks

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1326474 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-04-16 04:01:35 +00:00
parent fffdb569d0
commit 2b07186492
7 changed files with 10 additions and 0 deletions

View File

@ -173,6 +173,8 @@ public class TestReuseDocsEnum extends LuceneTestCase {
for (int i = 0; i < numdocs; i++) { for (int i = 0; i < numdocs; i++) {
writer.addDocument(lineFileDocs.nextDoc()); writer.addDocument(lineFileDocs.nextDoc());
} }
lineFileDocs.close();
} }
} }

View File

@ -92,6 +92,7 @@ public class TestCustomNorms extends LuceneTestCase {
} }
open.close(); open.close();
dir.close(); dir.close();
docs.close();
} }
public void testExceptionOnRandomType() throws IOException { public void testExceptionOnRandomType() throws IOException {
@ -126,6 +127,7 @@ public class TestCustomNorms extends LuceneTestCase {
writer.commit(); writer.commit();
writer.close(); writer.close();
dir.close(); dir.close();
docs.close();
} }

View File

@ -129,6 +129,8 @@ public class TestDuelingCodecs extends LuceneTestCase {
for (int i = 0; i < numdocs; i++) { for (int i = 0; i < numdocs; i++) {
writer.addDocument(lineFileDocs.nextDoc()); writer.addDocument(lineFileDocs.nextDoc());
} }
lineFileDocs.close();
} }
/** /**

View File

@ -100,5 +100,6 @@ public class TestForceMergeForever extends LuceneTestCase {
assertTrue("merge count is " + w.mergeCount.get(), w.mergeCount.get() <= 1); assertTrue("merge count is " + w.mergeCount.get(), w.mergeCount.get() <= 1);
w.close(); w.close();
d.close(); d.close();
docs.close();
} }
} }

View File

@ -197,6 +197,7 @@ public class TestNorms extends LuceneTestCase {
} }
writer.commit(); writer.commit();
writer.close(); writer.close();
docs.close();
} }

View File

@ -153,6 +153,7 @@ public class TestTermsEnum extends LuceneTestCase {
r.close(); r.close();
d.close(); d.close();
docs.close();
} }
private void addDoc(RandomIndexWriter w, Collection<String> terms, Map<BytesRef,Integer> termToID, int id) throws IOException { private void addDoc(RandomIndexWriter w, Collection<String> terms, Map<BytesRef,Integer> termToID, int id) throws IOException {

View File

@ -100,6 +100,7 @@ public class TestNRTCachingDirectory extends LuceneTestCase {
} }
r.close(); r.close();
cachedDir.close(); cachedDir.close();
docs.close();
} }
// NOTE: not a test; just here to make sure the code frag // NOTE: not a test; just here to make sure the code frag