Skip to content

Apache Lucene open-source search software

LUCENE-3661: remove duplciate delete-file-handling

Robert Muirf6c6f5dd4cfb
diff --git a/lucene/src/java/org/apache/lucene/codecs/lucene40/Lucene40LiveDocsFormat.java b/lucene/src/java/org/apache/lucene/codecs/lucene40/Lucene40LiveDocsFormat.java
index 7e5f6f09a3e..57ba73fac06 100644
--- a/lucene/src/java/org/apache/lucene/codecs/lucene40/Lucene40LiveDocsFormat.java
+++ b/lucene/src/java/org/apache/lucene/codecs/lucene40/Lucene40LiveDocsFormat.java
@@ -9,7 +9,6 @@ import org.apache.lucene.index.SegmentInfo;
import org.apache.lucene.store.Directory;
import org.apache.lucene.store.IOContext;
import org.apache.lucene.util.Bits;
-import org.apache.lucene.util.IOUtils;
import org.apache.lucene.util.MutableBits;
public class Lucene40LiveDocsFormat extends LiveDocsFormat {
@@ -34,17 +33,7 @@ public class Lucene40LiveDocsFormat extends LiveDocsFormat {
public void writeLiveDocs(MutableBits bits, Directory dir, SegmentInfo info, IOContext context) throws IOException {
// nocommit: this api is ugly...
String filename = IndexFileNames.fileNameFromGeneration(info.name, DELETES_EXTENSION, info.getDelGen());
-
- // nocommit: test if we really need this
- boolean success = false;
- try {
- ((BitVector)bits).write(dir, filename, context);
- success = true;
- } finally {
- if (!success) {
- IOUtils.deleteFilesIgnoringExceptions(dir, filename);
- }
- }
+ ((BitVector)bits).write(dir, filename, context);
}
@Override
diff --git a/lucene/src/java/org/apache/lucene/codecs/simpletext/SimpleTextLiveDocsFormat.java b/lucene/src/java/org/apache/lucene/codecs/simpletext/SimpleTextLiveDocsFormat.java
index 0acf4599403..52aa471c5bf 100644
--- a/lucene/src/java/org/apache/lucene/codecs/simpletext/SimpleTextLiveDocsFormat.java
+++ b/lucene/src/java/org/apache/lucene/codecs/simpletext/SimpleTextLiveDocsFormat.java
@@ -127,7 +127,6 @@ public class SimpleTextLiveDocsFormat extends LiveDocsFormat {
IOUtils.close(out);
} else {
IOUtils.closeWhileHandlingException(out);
- IOUtils.deleteFilesIgnoringExceptions(dir, fileName);
}
}
}