Skip to content

Apache Lucene open-source search software

It was no longer possible to create the backwards test indexes, because they were automatically deleted directly after test and also their name was unreadable. The method to create backwards indexes is never called for normal test runs, only when you explicitly enable the commented-out code

Uwe Schindler350cafab80ee
diff --git a/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java b/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
index efee37fce32..e467499f4a2 100644
--- a/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
+++ b/lucene/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java
@@ -446,8 +446,8 @@ public class TestBackwardsCompatibility extends LuceneTestCase {
}
public File createIndex(Random random, String dirName, boolean doCFS) throws IOException {
-
- File indexDir = _TestUtil.getTempDir(dirName);
+ // we use a real directory name that is not cleaned up, because this method is only used to create backwards indexes:
+ File indexDir = new File(LuceneTestCase.TEMP_DIR, dirName);
_TestUtil.rmDir(indexDir);
Directory dir = newFSDirectory(indexDir);