You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by mi...@apache.org on 2011/08/23 00:29:54 UTC
svn commit: r1160477 - in /lucene/dev/branches/branch_3x/lucene:
backwards/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
src/java/org/apache/lucene/index/CompoundFileReader.java
Author: mikemccand
Date: Mon Aug 22 22:29:54 2011
New Revision: 1160477
URL: http://svn.apache.org/viewvc?rev=1160477&view=rev
Log:
LUCENE-3394: fix false test failure
Modified:
lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/CompoundFileReader.java
Modified: lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexFileDeleter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexFileDeleter.java?rev=1160477&r1=1160476&r2=1160477&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexFileDeleter.java (original)
+++ lucene/dev/branches/branch_3x/lucene/backwards/src/test/org/apache/lucene/index/TestIndexFileDeleter.java Mon Aug 22 22:29:54 2011
@@ -152,7 +152,9 @@ public class TestIndexFileDeleter extend
copyFile(dir, "segments_2", "segments_1");
// Create a bogus cfs file shadowing a non-cfs segment:
- copyFile(dir, "_1.cfs", "_2.cfs");
+ assertTrue(dir.fileExists("_3.fdt"));
+ assertTrue(!dir.fileExists("_3.cfs"));
+ copyFile(dir, "_1.cfs", "_3.cfs");
String[] filesPre = dir.listAll();
Modified: lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/CompoundFileReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/CompoundFileReader.java?rev=1160477&r1=1160476&r2=1160477&view=diff
==============================================================================
--- lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/CompoundFileReader.java (original)
+++ lucene/dev/branches/branch_3x/lucene/src/java/org/apache/lucene/index/CompoundFileReader.java Mon Aug 22 22:29:54 2011
@@ -151,8 +151,9 @@ class CompoundFileReader extends Directo
id = IndexFileNames.stripSegmentName(id);
FileEntry entry = entries.get(id);
- if (entry == null)
- throw new IOException("No sub-file with id " + id + " found (files: " + entries.keySet() + ")");
+ if (entry == null) {
+ throw new IOException("No sub-file with id " + id + " found (fileName=" + fileName + " files: " + entries.keySet() + ")");
+ }
return new CSIndexInput(stream, entry.offset, entry.length, readBufferSize);
}