Index: lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java =================================================================== --- lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java (revision 1378461) +++ lucene/core/src/java/org/apache/lucene/codecs/lucene3x/Lucene3xCodec.java (working copy) @@ -68,13 +68,8 @@ static final String COMPOUND_FILE_STORE_EXTENSION = "cfx"; // TODO: this should really be a different impl - private final LiveDocsFormat liveDocsFormat = new Lucene40LiveDocsFormat() { - @Override - public void writeLiveDocs(MutableBits bits, Directory dir, SegmentInfoPerCommit info, int newDelCount, IOContext context) throws IOException { - throw new UnsupportedOperationException("this codec can only be used for reading"); - } - }; - + private final LiveDocsFormat liveDocsFormat = new Lucene40LiveDocsFormat(); + // 3.x doesn't support docvalues private final DocValuesFormat docValuesFormat = new DocValuesFormat() { @Override Index: lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java =================================================================== --- lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (revision 1378461) +++ lucene/core/src/test/org/apache/lucene/index/TestBackwardsCompatibility.java (working copy) @@ -302,6 +302,22 @@ } } + public void testDeleteOldIndex() throws IOException { + for (String name : oldNames) { + if (VERBOSE) { + System.out.println("TEST: oldName=" + name); + } + Directory dir = newDirectory(oldIndexDirs.get(name)); + IndexWriter iw = new IndexWriter(dir, new IndexWriterConfig(TEST_VERSION_CURRENT, null)); + iw.deleteDocuments(new Term("id", "3")); + iw.close(); + IndexReader ir = DirectoryReader.open(dir); + assertEquals(34, ir.numDocs()); + ir.close(); + dir.close(); + } + } + private void doTestHits(ScoreDoc[] hits, int expectedCount, IndexReader reader) throws IOException { final int hitCount = hits.length; assertEquals("wrong number of hits", expectedCount, hitCount); Index: lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java =================================================================== --- lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java (revision 1378461) +++ lucene/test-framework/src/java/org/apache/lucene/codecs/lucene3x/PreFlexRWCodec.java (working copy) @@ -38,8 +38,6 @@ private final TermVectorsFormat termVectors = new PreFlexRWTermVectorsFormat(); private final SegmentInfoFormat segmentInfos = new PreFlexRWSegmentInfoFormat(); private final StoredFieldsFormat storedFields = new PreFlexRWStoredFieldsFormat(); - // TODO: this should really be a different impl - private final LiveDocsFormat liveDocs = new Lucene40LiveDocsFormat(); @Override public PostingsFormat postingsFormat() { @@ -87,15 +85,6 @@ } @Override - public LiveDocsFormat liveDocsFormat() { - if (LuceneTestCase.PREFLEX_IMPERSONATION_IS_ACTIVE) { - return liveDocs; - } else { - return super.liveDocsFormat(); - } - } - - @Override public StoredFieldsFormat storedFieldsFormat() { if (LuceneTestCase.PREFLEX_IMPERSONATION_IS_ACTIVE) { return storedFields;