Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

LUCENE-720: added a few missing close's

Michael McCandlessa01711b2454e
diff --git a/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index ea75f0a09d8..4ccf1b348cb 100644
--- a/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -311,6 +311,7 @@ public class TestBackwardsCompatibility extends TestCase
break;
}
}
+ cfsReader.close();
assertTrue("could not locate the 'content' field number in the _2.cfs segment", contentFieldIndex != -1);
// Now verify file names:
@@ -329,6 +330,7 @@ public class TestBackwardsCompatibility extends TestCase
if (!Arrays.equals(expected, actual)) {
fail("incorrect filenames in index: expected:\n " + asString(expected) + "\n actual:\n " + asString(actual));
}
+ dir.close();
rmDir(outputDir);
}
diff --git a/src/test/org/apache/lucene/index/TestIndexFileDeleter.java b/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
index ca0ff764a29..5b924d23661 100644
--- a/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
+++ b/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
@@ -75,6 +75,7 @@ public class TestIndexFileDeleter extends TestCase
break;
}
}
+ cfsReader.close();
assertTrue("could not locate the 'content' field number in the _2.cfs segment", contentFieldIndex != -1);
String normSuffix = "s" + contentFieldIndex;
@@ -132,6 +133,7 @@ public class TestIndexFileDeleter extends TestCase
writer.close();
String[] files2 = dir.list();
+ dir.close();
Arrays.sort(files);
Arrays.sort(files2);