lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject svn commit: r1297785 [5/16] - in /lucene/dev/branches/lucene3795_lsp_spatial_module: ./ dev-tools/eclipse/ dev-tools/maven/ dev-tools/maven/lucene/ dev-tools/maven/lucene/contrib/demo/ dev-tools/maven/lucene/contrib/highlighter/ dev-tools/maven/lucene/...
Date Tue, 06 Mar 2012 23:17:23 GMT
Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestFilterAtomicReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestFilterAtomicReader.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestFilterAtomicReader.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestFilterAtomicReader.java Tue Mar  6 23:17:08 2012
@@ -21,17 +21,15 @@ package org.apache.lucene.index;
 import java.io.IOException;
 import java.lang.reflect.Method;
 import java.lang.reflect.Modifier;
-import java.util.HashSet;
-
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.util.Bits;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
-import org.apache.lucene.util.ReaderUtil;
 
 public class TestFilterAtomicReader extends LuceneTestCase {
 
@@ -168,7 +166,7 @@ public class TestFilterAtomicReader exte
     
     DocsAndPositionsEnum positions = terms.docsAndPositions(MultiFields.getLiveDocs(reader),
                                                             null, false);
-    while (positions.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+    while (positions.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
       assertTrue((positions.docID() % 2) == 1);
     }
 
@@ -176,22 +174,31 @@ public class TestFilterAtomicReader exte
     directory.close();
     target.close();
   }
-
-  public void testOverrideMethods() throws Exception {
+  
+  private void checkOverrideMethods(Class<?> clazz) throws Exception {
     boolean fail = false;
-    for (Method m : FilterAtomicReader.class.getMethods()) {
+    for (Method m : clazz.getMethods()) {
       int mods = m.getModifiers();
       if (Modifier.isStatic(mods) || Modifier.isFinal(mods) || m.isSynthetic()) {
         continue;
       }
       Class<?> declaringClass = m.getDeclaringClass();
-      String name = m.getName();
-      if (declaringClass != FilterAtomicReader.class && declaringClass != Object.class) {
-        System.err.println("method is not overridden by FilterIndexReader: " + name);
+      if (declaringClass != clazz && declaringClass != Object.class) {
+        System.err.println("method is not overridden by "+clazz.getName()+": " + m.toGenericString());
         fail = true;
       }
     }
-    assertFalse("FilterIndexReader overrides (or not) some problematic methods; see log above", fail);
+    assertFalse(clazz.getName()+" does not override some methods; see log above", fail);
+  }
+
+  public void testOverrideMethods() throws Exception {
+    checkOverrideMethods(FilterAtomicReader.class);
+    checkOverrideMethods(FilterAtomicReader.FilterFields.class);
+    checkOverrideMethods(FilterAtomicReader.FilterTerms.class);
+    checkOverrideMethods(FilterAtomicReader.FilterFieldsEnum.class);
+    checkOverrideMethods(FilterAtomicReader.FilterTermsEnum.class);
+    checkOverrideMethods(FilterAtomicReader.FilterDocsEnum.class);
+    checkOverrideMethods(FilterAtomicReader.FilterDocsAndPositionsEnum.class);
   }
 
 }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestFlushByRamOrCountsPolicy.java Tue Mar  6 23:17:08 2012
@@ -39,7 +39,7 @@ public class TestFlushByRamOrCountsPolic
 
   @BeforeClass
   public static void beforeClass() throws Exception {
-    lineDocFile = new LineFileDocs(random);
+    lineDocFile = new LineFileDocs(random, defaultCodecSupportsDocValues());
   }
   
   @AfterClass
@@ -323,6 +323,8 @@ public class TestFlushByRamOrCountsPolic
         }
         writer.commit();
       } catch (Throwable ex) {
+        System.out.println("FAILED exc:");
+        ex.printStackTrace(System.out);
         throw new RuntimeException(ex);
       }
     }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestForTooMuchCloning.java Tue Mar  6 23:17:08 2012
@@ -17,8 +17,6 @@ package org.apache.lucene.index;
  * limitations under the License.
  */
 
-import java.util.*;
-
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.TextField;

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestForceMergeForever.java Tue Mar  6 23:17:08 2012
@@ -59,7 +59,7 @@ public class TestForceMergeForever exten
     // Try to make an index that requires merging:
     w.getConfig().setMaxBufferedDocs(_TestUtil.nextInt(random, 2, 11));
     final int numStartDocs = atLeast(20);
-    final LineFileDocs docs = new LineFileDocs(random);
+    final LineFileDocs docs = new LineFileDocs(random, defaultCodecSupportsDocValues());
     for(int docIDX=0;docIDX<numStartDocs;docIDX++) {
       w.addDocument(docs.nextDoc());
     }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriter.java Tue Mar  6 23:17:08 2012
@@ -21,6 +21,7 @@ import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.io.Reader;
 import java.io.StringReader;
+import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -38,8 +39,8 @@ import org.apache.lucene.document.FieldT
 import org.apache.lucene.document.StoredField;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.document.TextField;
-import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.index.FieldInfo.IndexOptions;
+import org.apache.lucene.index.IndexWriterConfig.OpenMode;
 import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.FieldCache;
 import org.apache.lucene.search.IndexSearcher;
@@ -968,14 +969,14 @@ public class TestIndexWriter extends Luc
     assertNotNull(termsEnum.next());
     DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null, false);
     assertNotNull(dpEnum);
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(1, dpEnum.freq());
     assertEquals(100, dpEnum.nextPosition());
 
     assertNotNull(termsEnum.next());
     dpEnum = termsEnum.docsAndPositions(null, dpEnum, false);
     assertNotNull(dpEnum);
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(1, dpEnum.freq());
     assertEquals(101, dpEnum.nextPosition());
     assertNull(termsEnum.next());
@@ -1787,4 +1788,17 @@ public class TestIndexWriter extends Luc
     w.close();
     dir.close();
   }
+
+  public void testOnlyUpdateDocuments() throws Exception {
+    Directory dir = newDirectory();
+    IndexWriter w = new IndexWriter(dir,
+                                    new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random)));
+
+    final List<Document> docs = new ArrayList<Document>();
+    docs.add(new Document());
+    w.updateDocuments(new Term("foo", "bar"),
+                      docs);
+    w.close();
+    dir.close();
+  }
 }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterReader.java Tue Mar  6 23:17:08 2012
@@ -31,6 +31,7 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.Query;
 import org.apache.lucene.search.TermQuery;
@@ -57,7 +58,7 @@ public class TestIndexWriterReader exten
                                  false);
 
     if (td != null) {
-      while (td.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+      while (td.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
         td.docID();
         count++;
       }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexWriterWithThreads.java Tue Mar  6 23:17:08 2012
@@ -25,6 +25,7 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.AlreadyClosedException;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.MockDirectoryWrapper;
@@ -217,7 +218,7 @@ public class TestIndexWriterWithThreads 
                                       null,
                                       false);
       int count = 0;
-      while(tdocs.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+      while(tdocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
         count++;
       }
       assertTrue(count > 0);

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexableField.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexableField.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexableField.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestIndexableField.java Tue Mar  6 23:17:08 2012
@@ -28,6 +28,7 @@ import org.apache.lucene.document.Docume
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.search.BooleanClause;
 import org.apache.lucene.search.BooleanQuery;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.IndexSearcher;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.search.TopDocs;
@@ -264,14 +265,14 @@ public class TestIndexableField extends 
             assertEquals(new BytesRef(""+counter), termsEnum.next());
             assertEquals(1, termsEnum.totalTermFreq());
             DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null, false);
-            assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+            assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
             assertEquals(1, dpEnum.freq());
             assertEquals(1, dpEnum.nextPosition());
 
             assertEquals(new BytesRef("text"), termsEnum.next());
             assertEquals(1, termsEnum.totalTermFreq());
             dpEnum = termsEnum.docsAndPositions(null, dpEnum, false);
-            assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+            assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
             assertEquals(1, dpEnum.freq());
             assertEquals(0, dpEnum.nextPosition());
 

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestLongPostings.java Tue Mar  6 23:17:08 2012
@@ -29,6 +29,7 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.index.FieldInfo.IndexOptions;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
@@ -110,30 +111,26 @@ public class TestLongPostings extends Lu
     }
 
     final IndexReader r;
-    if (true) { 
-      final IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random))
-        .setOpenMode(IndexWriterConfig.OpenMode.CREATE)
-        .setMergePolicy(newLogMergePolicy());
-      iwc.setRAMBufferSizeMB(16.0 + 16.0 * random.nextDouble());
-      iwc.setMaxBufferedDocs(-1);
-      final RandomIndexWriter riw = new RandomIndexWriter(random, dir, iwc);
-
-      for(int idx=0;idx<NUM_DOCS;idx++) {
-        final Document doc = new Document();
-        String s = isS1.get(idx) ? s1 : s2;
-        final Field f = newField("field", s, TextField.TYPE_UNSTORED);
-        final int count = _TestUtil.nextInt(random, 1, 4);
-        for(int ct=0;ct<count;ct++) {
-          doc.add(f);
-        }
-        riw.addDocument(doc);
-      }
-
-      r = riw.getReader();
-      riw.close();
-    } else {
-      r = IndexReader.open(dir);
-    }
+	  final IndexWriterConfig iwc = newIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random))
+	    .setOpenMode(IndexWriterConfig.OpenMode.CREATE)
+	    .setMergePolicy(newLogMergePolicy());
+	  iwc.setRAMBufferSizeMB(16.0 + 16.0 * random.nextDouble());
+	  iwc.setMaxBufferedDocs(-1);
+	  final RandomIndexWriter riw = new RandomIndexWriter(random, dir, iwc);
+	
+	  for(int idx=0;idx<NUM_DOCS;idx++) {
+	    final Document doc = new Document();
+	    String s = isS1.get(idx) ? s1 : s2;
+	    final Field f = newField("field", s, TextField.TYPE_UNSTORED);
+	    final int count = _TestUtil.nextInt(random, 1, 4);
+	    for(int ct=0;ct<count;ct++) {
+	      doc.add(f);
+	    }
+	    riw.addDocument(doc);
+	  }
+	
+	  r = riw.getReader();
+	  riw.close();
 
     /*
     if (VERBOSE) {
@@ -176,7 +173,7 @@ public class TestLongPostings extends Lu
       final DocsAndPositionsEnum postings = MultiFields.getTermPositionsEnum(r, null, "field", new BytesRef(term), false);
 
       int docID = -1;
-      while(docID < DocsEnum.NO_MORE_DOCS) {
+      while(docID < DocIdSetIterator.NO_MORE_DOCS) {
         final int what = random.nextInt(3);
         if (what == 0) {
           if (VERBOSE) {
@@ -199,7 +196,7 @@ public class TestLongPostings extends Lu
             System.out.println("  got docID=" + docID);
           }
           assertEquals(expected, docID);
-          if (docID == DocsEnum.NO_MORE_DOCS) {
+          if (docID == DocIdSetIterator.NO_MORE_DOCS) {
             break;
           }
 
@@ -241,7 +238,7 @@ public class TestLongPostings extends Lu
             System.out.println("  got docID=" + docID);
           }
           assertEquals(expected, docID);
-          if (docID == DocsEnum.NO_MORE_DOCS) {
+          if (docID == DocIdSetIterator.NO_MORE_DOCS) {
             break;
           }
           
@@ -380,7 +377,7 @@ public class TestLongPostings extends Lu
       assert docs != null;
 
       int docID = -1;
-      while(docID < DocsEnum.NO_MORE_DOCS) {
+      while(docID < DocIdSetIterator.NO_MORE_DOCS) {
         final int what = random.nextInt(3);
         if (what == 0) {
           if (VERBOSE) {
@@ -403,7 +400,7 @@ public class TestLongPostings extends Lu
             System.out.println("  got docID=" + docID);
           }
           assertEquals(expected, docID);
-          if (docID == DocsEnum.NO_MORE_DOCS) {
+          if (docID == DocIdSetIterator.NO_MORE_DOCS) {
             break;
           }
 
@@ -439,7 +436,7 @@ public class TestLongPostings extends Lu
             System.out.println("  got docID=" + docID);
           }
           assertEquals(expected, docID);
-          if (docID == DocsEnum.NO_MORE_DOCS) {
+          if (docID == DocIdSetIterator.NO_MORE_DOCS) {
             break;
           }
           

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestMultiFields.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestMultiFields.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestMultiFields.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestMultiFields.java Tue Mar  6 23:17:08 2012
@@ -17,6 +17,7 @@ package org.apache.lucene.index;
  * limitations under the License.
  */
 
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.*;
 import org.apache.lucene.util.*;
 import org.apache.lucene.document.*;
@@ -128,7 +129,7 @@ public class TestMultiFields extends Luc
             assertEquals(docID, docsEnum.nextDoc());
           }
         }
-        assertEquals(docsEnum.NO_MORE_DOCS, docsEnum.nextDoc());
+        assertEquals(DocIdSetIterator.NO_MORE_DOCS, docsEnum.nextDoc());
       }
 
       reader.close();

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestNorms.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestNorms.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestNorms.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestNorms.java Tue Mar  6 23:17:08 2012
@@ -29,7 +29,6 @@ import org.apache.lucene.search.similari
 import org.apache.lucene.search.similarities.PerFieldSimilarityWrapper;
 import org.apache.lucene.search.similarities.Similarity;
 import org.apache.lucene.store.Directory;
-import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.util.LineFileDocs;
 import org.apache.lucene.util.LuceneTestCase;
 
@@ -179,7 +178,7 @@ public class TestNorms extends LuceneTes
     Similarity provider = new MySimProvider(writeNorms);
     config.setSimilarity(provider);
     RandomIndexWriter writer = new RandomIndexWriter(random, dir, config);
-    final LineFileDocs docs = new LineFileDocs(random);
+    final LineFileDocs docs = new LineFileDocs(random, defaultCodecSupportsDocValues());
     int num = atLeast(100);
     for (int i = 0; i < num; i++) {
       Document doc = docs.nextDoc();

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestParallelTermEnum.java Tue Mar  6 23:17:08 2012
@@ -22,180 +22,90 @@ import java.io.IOException;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.Bits;
+import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
 import org.apache.lucene.util._TestUtil;
 
 public class TestParallelTermEnum extends LuceneTestCase {
-    private AtomicReader ir1;
-    private AtomicReader ir2;
-    private Directory rd1;
-    private Directory rd2;
+  private AtomicReader ir1;
+  private AtomicReader ir2;
+  private Directory rd1;
+  private Directory rd2;
+  
+  @Override
+  public void setUp() throws Exception {
+    super.setUp();
+    Document doc;
+    rd1 = newDirectory();
+    IndexWriter iw1 = new IndexWriter(rd1, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random)));
+
+    doc = new Document();
+    doc.add(newField("field1", "the quick brown fox jumps", TextField.TYPE_STORED));
+    doc.add(newField("field2", "the quick brown fox jumps", TextField.TYPE_STORED));
+    iw1.addDocument(doc);
+
+    iw1.close();
+    rd2 = newDirectory();
+    IndexWriter iw2 = new IndexWriter(rd2, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random)));
+
+    doc = new Document();
+    doc.add(newField("field1", "the fox jumps over the lazy dog", TextField.TYPE_STORED));
+    doc.add(newField("field3", "the fox jumps over the lazy dog", TextField.TYPE_STORED));
+    iw2.addDocument(doc);
+
+    iw2.close();
+
+    this.ir1 = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(rd1));
+    this.ir2 = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(rd2));
+  }
+
+  @Override
+  public void tearDown() throws Exception {
+    ir1.close();
+    ir2.close();
+    rd1.close();
+    rd2.close();
+    super.tearDown();
+  }
+  
+  private void checkTerms(Terms terms, Bits liveDocs, String... termsList) throws IOException {
+    assertNotNull(terms);
+    final TermsEnum te = terms.iterator(null);
     
-    @Override
-    public void setUp() throws Exception {
-        super.setUp();
-        Document doc;
-        rd1 = newDirectory();
-        IndexWriter iw1 = new IndexWriter(rd1, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random)));
-
-        doc = new Document();
-        doc.add(newField("field1", "the quick brown fox jumps", TextField.TYPE_STORED));
-        doc.add(newField("field2", "the quick brown fox jumps", TextField.TYPE_STORED));
-        doc.add(newField("field4", "", TextField.TYPE_UNSTORED));
-        iw1.addDocument(doc);
-
-        iw1.close();
-        rd2 = newDirectory();
-        IndexWriter iw2 = new IndexWriter(rd2, newIndexWriterConfig( TEST_VERSION_CURRENT, new MockAnalyzer(random)));
-
-        doc = new Document();
-        doc.add(newField("field0", "", TextField.TYPE_UNSTORED));
-        doc.add(newField("field1", "the fox jumps over the lazy dog", TextField.TYPE_STORED));
-        doc.add(newField("field3", "the fox jumps over the lazy dog", TextField.TYPE_STORED));
-        iw2.addDocument(doc);
-
-        iw2.close();
-
-        this.ir1 = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(rd1));
-        this.ir2 = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(rd2));
+    for (String t : termsList) {
+      BytesRef b = te.next();
+      assertNotNull(b);
+      assertEquals(t, b.utf8ToString());
+      DocsEnum td = _TestUtil.docs(random, te, liveDocs, null, false);
+      assertTrue(td.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
+      assertEquals(0, td.docID());
+      assertEquals(td.nextDoc(), DocIdSetIterator.NO_MORE_DOCS);
     }
+    assertNull(te.next());
+  }
 
-    @Override
-    public void tearDown() throws Exception {
-        ir1.close();
-        ir2.close();
-        rd1.close();
-        rd2.close();
-        super.tearDown();
-    }
+  public void test1() throws IOException {
+    ParallelAtomicReader pr = new ParallelAtomicReader(ir1, ir2);
 
-    public void test1() throws IOException {
-        ParallelAtomicReader pr = new ParallelAtomicReader(ir1, ir2);
+    Bits liveDocs = pr.getLiveDocs();
 
-        Bits liveDocs = pr.getLiveDocs();
+    FieldsEnum fe = pr.fields().iterator();
 
-        FieldsEnum fe = pr.fields().iterator();
+    String f = fe.next();
+    assertEquals("field1", f);
+    checkTerms(fe.terms(), liveDocs, "brown", "fox", "jumps", "quick", "the");
 
-        String f = fe.next();
-        assertEquals("field0", f);
-        f = fe.next();
-        assertEquals("field1", f);
-
-        Terms terms = fe.terms();
-        TermsEnum te = terms.iterator(null);
-
-        assertEquals("brown", te.next().utf8ToString());
-        DocsEnum td = _TestUtil.docs(random, te, liveDocs, null, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("fox", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("jumps", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("quick", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("the", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertNull(te.next());
-        f = fe.next();
-        assertEquals("field2", f);
-        terms = fe.terms();
-        assertNotNull(terms);
-        te = terms.iterator(null);
-
-        assertEquals("brown", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("fox", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("jumps", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("quick", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("the", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertNull(te.next());
-        f = fe.next();
-        assertEquals("field3", f);
-        terms = fe.terms();
-        assertNotNull(terms);
-        te = terms.iterator(null);
-
-        assertEquals("dog", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("fox", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("jumps", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("lazy", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("over", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
-
-        assertEquals("the", te.next().utf8ToString());
-        td = _TestUtil.docs(random, te, liveDocs, td, false);
-        assertTrue(td.nextDoc() != DocsEnum.NO_MORE_DOCS);
-        assertEquals(0, td.docID());
-        assertEquals(td.nextDoc(), DocsEnum.NO_MORE_DOCS);
+    f = fe.next();
+    assertEquals("field2", f);
+    checkTerms(fe.terms(), liveDocs, "brown", "fox", "jumps", "quick", "the");
 
-        assertNull(te.next());
-    }
+    f = fe.next();
+    assertEquals("field3", f);
+    checkTerms(fe.terms(), liveDocs, "dog", "fox", "jumps", "lazy", "over", "the");
+
+    assertNull(fe.next());
+  }
 }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestPerSegmentDeletes.java Tue Mar  6 23:17:08 2012
@@ -24,6 +24,7 @@ import java.util.Map;
 import java.util.Random;
 
 import org.apache.lucene.analysis.MockAnalyzer;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.store.RAMDirectory;
@@ -233,7 +234,7 @@ public class TestPerSegmentDeletes exten
 
   public static int[] toArray(DocsEnum docsEnum) throws IOException {
     List<Integer> docs = new ArrayList<Integer>();
-    while (docsEnum.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+    while (docsEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
       int docID = docsEnum.docID();
       docs.add(docID);
     }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java Tue Mar  6 23:17:08 2012
@@ -88,7 +88,7 @@ public class TestPostingsOffsets extends
     assertEquals(2, dp.nextPosition());
     assertEquals(9, dp.startOffset());
     assertEquals(17, dp.endOffset());
-    assertEquals(DocsEnum.NO_MORE_DOCS, dp.nextDoc());
+    assertEquals(DocIdSetIterator.NO_MORE_DOCS, dp.nextDoc());
 
     dp = MultiFields.getTermPositionsEnum(r, null, "content", new BytesRef("b"), true);
     assertNotNull(dp);
@@ -97,7 +97,7 @@ public class TestPostingsOffsets extends
     assertEquals(1, dp.nextPosition());
     assertEquals(8, dp.startOffset());
     assertEquals(9, dp.endOffset());
-    assertEquals(DocsEnum.NO_MORE_DOCS, dp.nextDoc());
+    assertEquals(DocIdSetIterator.NO_MORE_DOCS, dp.nextDoc());
 
     dp = MultiFields.getTermPositionsEnum(r, null, "content", new BytesRef("c"), true);
     assertNotNull(dp);
@@ -106,7 +106,7 @@ public class TestPostingsOffsets extends
     assertEquals(3, dp.nextPosition());
     assertEquals(19, dp.startOffset());
     assertEquals(50, dp.endOffset());
-    assertEquals(DocsEnum.NO_MORE_DOCS, dp.nextDoc());
+    assertEquals(DocIdSetIterator.NO_MORE_DOCS, dp.nextDoc());
 
     r.close();
     dir.close();
@@ -156,7 +156,7 @@ public class TestPostingsOffsets extends
     for (String term : terms) {
       DocsAndPositionsEnum dp = MultiFields.getTermPositionsEnum(reader, null, "numbers", new BytesRef(term), true);
       int doc;
-      while((doc = dp.nextDoc()) != DocsEnum.NO_MORE_DOCS) {
+      while((doc = dp.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
         String storedNumbers = reader.document(doc).get("numbers");
         int freq = dp.freq();
         for (int i = 0; i < freq; i++) {
@@ -304,7 +304,7 @@ public class TestPostingsOffsets extends
           assertNotNull(docs);
           int doc;
           //System.out.println("    doc/freq");
-          while((doc = docs.nextDoc()) != DocsEnum.NO_MORE_DOCS) {
+          while((doc = docs.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
             final List<Token> expected = actualTokens.get(term).get(docIDToID[doc]);
             //System.out.println("      doc=" + docIDToID[doc] + " docID=" + doc + " " + expected.size() + " freq");
             assertNotNull(expected);
@@ -314,7 +314,7 @@ public class TestPostingsOffsets extends
           docsAndPositions = termsEnum.docsAndPositions(null, docsAndPositions, false);
           assertNotNull(docsAndPositions);
           //System.out.println("    doc/freq/pos");
-          while((doc = docsAndPositions.nextDoc()) != DocsEnum.NO_MORE_DOCS) {
+          while((doc = docsAndPositions.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
             final List<Token> expected = actualTokens.get(term).get(docIDToID[doc]);
             //System.out.println("      doc=" + docIDToID[doc] + " " + expected.size() + " freq");
             assertNotNull(expected);
@@ -329,7 +329,7 @@ public class TestPostingsOffsets extends
           docsAndPositionsAndOffsets = termsEnum.docsAndPositions(null, docsAndPositions, true);
           assertNotNull(docsAndPositionsAndOffsets);
           //System.out.println("    doc/freq/pos/offs");
-          while((doc = docsAndPositions.nextDoc()) != DocsEnum.NO_MORE_DOCS) {
+          while((doc = docsAndPositions.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
             final List<Token> expected = actualTokens.get(term).get(docIDToID[doc]);
             //System.out.println("      doc=" + docIDToID[doc] + " " + expected.size() + " freq");
             assertNotNull(expected);

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestReaderClosed.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestReaderClosed.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestReaderClosed.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestReaderClosed.java Tue Mar  6 23:17:08 2012
@@ -30,7 +30,6 @@ import org.apache.lucene.util.LuceneTest
 import org.apache.lucene.util._TestUtil;
 
 public class TestReaderClosed extends LuceneTestCase {
-  private IndexSearcher searcher;
   private IndexReader reader;
   private Directory dir;
 
@@ -54,12 +53,12 @@ public class TestReaderClosed extends Lu
       writer.addDocument(doc);
     }
     reader = writer.getReader();
-    searcher = newSearcher(reader, /* TODO: change that back to true and add better test,
-      so wrapped readers are explicitely checked, see LUCENE-3800: */ false);
     writer.close();
   }
   
   public void test() throws Exception {
+    assertTrue(reader.getRefCount() > 0);
+    IndexSearcher searcher = newSearcher(reader);
     TermRangeQuery query = TermRangeQuery.newStringRange("field", "a", "z", true, true);
     searcher.search(query, 5);
     reader.close();
@@ -70,6 +69,25 @@ public class TestReaderClosed extends Lu
     }
   }
   
+  // LUCENE-3800
+  public void testReaderChaining() throws Exception {
+    assertTrue(reader.getRefCount() > 0);
+    IndexReader wrappedReader = SlowCompositeReaderWrapper.wrap(reader);
+    wrappedReader = new ParallelAtomicReader((AtomicReader) wrappedReader);
+    IndexSearcher searcher = newSearcher(wrappedReader);
+    TermRangeQuery query = TermRangeQuery.newStringRange("field", "a", "z", true, true);
+    searcher.search(query, 5);
+    reader.close(); // close original child reader
+    try {
+      searcher.search(query, 5);
+    } catch (AlreadyClosedException ace) {
+      assertEquals(
+        "this IndexReader cannot be used anymore as one of its child readers was closed",
+        ace.getMessage()
+      );
+    }
+  }
+  
   public void tearDown() throws Exception {
     dir.close();
     super.tearDown();

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestRollingUpdates.java Tue Mar  6 23:17:08 2012
@@ -34,7 +34,7 @@ public class TestRollingUpdates extends 
   public void testRollingUpdates() throws Exception {
     final MockDirectoryWrapper dir = newDirectory();
     dir.setCheckIndexOnClose(false); // we use a custom codec provider
-    final LineFileDocs docs = new LineFileDocs(random);
+    final LineFileDocs docs = new LineFileDocs(random, defaultCodecSupportsDocValues());
 
     //provider.register(new MemoryCodec());
     if ( (!"Lucene3x".equals(Codec.getDefault().getName())) && random.nextBoolean()) {

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentMerger.java Tue Mar  6 23:17:08 2012
@@ -23,6 +23,7 @@ import org.apache.lucene.analysis.MockAn
 import org.apache.lucene.codecs.Codec;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.InfoStream;
@@ -105,7 +106,7 @@ public class TestSegmentMerger extends L
                                        null,
                                        false);
     assertTrue(termDocs != null);
-    assertTrue(termDocs.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(termDocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
 
     int tvCount = 0;
     for(FieldInfo fieldInfo : mergedReader.getFieldInfos()) {

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentReader.java Tue Mar  6 23:17:08 2012
@@ -23,6 +23,7 @@ import java.util.HashSet;
 import java.util.List;
 
 import org.apache.lucene.document.Document;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.IOContext;
 import org.apache.lucene.util.BytesRef;
@@ -133,7 +134,7 @@ public class TestSegmentReader extends L
                                        MultiFields.getLiveDocs(reader),
                                        null,
                                        false);
-    assertTrue(termDocs.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(termDocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
 
     termDocs = _TestUtil.docs(random, reader,
                               DocHelper.NO_NORMS_KEY,
@@ -142,7 +143,7 @@ public class TestSegmentReader extends L
                               null,
                               false);
 
-    assertTrue(termDocs.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(termDocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
 
     
     DocsAndPositionsEnum positions = MultiFields.getTermPositionsEnum(reader,
@@ -152,7 +153,7 @@ public class TestSegmentReader extends L
                                                                       false);
     // NOTE: prior rev of this test was failing to first
     // call next here:
-    assertTrue(positions.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(positions.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     assertTrue(positions.docID() == 0);
     assertTrue(positions.nextPosition() >= 0);
   }    

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermDocs.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermDocs.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermDocs.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestSegmentTermDocs.java Tue Mar  6 23:17:08 2012
@@ -22,6 +22,7 @@ import java.io.IOException;
 import org.apache.lucene.analysis.MockAnalyzer;
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
@@ -63,7 +64,7 @@ public class TestSegmentTermDocs extends
     TermsEnum terms = reader.fields().terms(DocHelper.TEXT_FIELD_2_KEY).iterator(null);
     terms.seekCeil(new BytesRef("field"));
     DocsEnum termDocs = _TestUtil.docs(random, terms, reader.getLiveDocs(), null, true);
-    if (termDocs.nextDoc() != DocsEnum.NO_MORE_DOCS)    {
+    if (termDocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS)    {
       int docId = termDocs.docID();
       assertTrue(docId == 0);
       int freq = termDocs.freq();
@@ -142,19 +143,19 @@ public class TestSegmentTermDocs extends
     // without optimization (assumption skipInterval == 16)
     
     // with next
-    assertTrue(tdocs.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(0, tdocs.docID());
     assertEquals(4, tdocs.freq());
-    assertTrue(tdocs.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(1, tdocs.docID());
     assertEquals(4, tdocs.freq());
-    assertTrue(tdocs.advance(0) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(0) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(2, tdocs.docID());
-    assertTrue(tdocs.advance(4) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(4) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(4, tdocs.docID());
-    assertTrue(tdocs.advance(9) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(9) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(9, tdocs.docID());
-    assertFalse(tdocs.advance(10) != DocsEnum.NO_MORE_DOCS);
+    assertFalse(tdocs.advance(10) != DocIdSetIterator.NO_MORE_DOCS);
     
     // without next
     tdocs = _TestUtil.docs(random, reader,
@@ -164,13 +165,13 @@ public class TestSegmentTermDocs extends
                            null,
                            false);
     
-    assertTrue(tdocs.advance(0) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(0) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(0, tdocs.docID());
-    assertTrue(tdocs.advance(4) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(4) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(4, tdocs.docID());
-    assertTrue(tdocs.advance(9) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(9) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(9, tdocs.docID());
-    assertFalse(tdocs.advance(10) != DocsEnum.NO_MORE_DOCS);
+    assertFalse(tdocs.advance(10) != DocIdSetIterator.NO_MORE_DOCS);
     
     // exactly skipInterval documents and therefore with optimization
     
@@ -182,21 +183,21 @@ public class TestSegmentTermDocs extends
                            null,
                            true);
 
-    assertTrue(tdocs.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(10, tdocs.docID());
     assertEquals(4, tdocs.freq());
-    assertTrue(tdocs.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(11, tdocs.docID());
     assertEquals(4, tdocs.freq());
-    assertTrue(tdocs.advance(5) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(5) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(12, tdocs.docID());
-    assertTrue(tdocs.advance(15) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(15) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(15, tdocs.docID());
-    assertTrue(tdocs.advance(24) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(24) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(24, tdocs.docID());
-    assertTrue(tdocs.advance(25) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(25) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(25, tdocs.docID());
-    assertFalse(tdocs.advance(26) != DocsEnum.NO_MORE_DOCS);
+    assertFalse(tdocs.advance(26) != DocIdSetIterator.NO_MORE_DOCS);
     
     // without next
     tdocs = _TestUtil.docs(random, reader,
@@ -206,15 +207,15 @@ public class TestSegmentTermDocs extends
                            null,
                            true);
     
-    assertTrue(tdocs.advance(5) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(5) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(10, tdocs.docID());
-    assertTrue(tdocs.advance(15) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(15) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(15, tdocs.docID());
-    assertTrue(tdocs.advance(24) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(24) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(24, tdocs.docID());
-    assertTrue(tdocs.advance(25) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(25) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(25, tdocs.docID());
-    assertFalse(tdocs.advance(26) != DocsEnum.NO_MORE_DOCS);
+    assertFalse(tdocs.advance(26) != DocIdSetIterator.NO_MORE_DOCS);
     
     // much more than skipInterval documents and therefore with optimization
     
@@ -226,23 +227,23 @@ public class TestSegmentTermDocs extends
                            null,
                            true);
 
-    assertTrue(tdocs.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(26, tdocs.docID());
     assertEquals(4, tdocs.freq());
-    assertTrue(tdocs.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(27, tdocs.docID());
     assertEquals(4, tdocs.freq());
-    assertTrue(tdocs.advance(5) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(5) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(28, tdocs.docID());
-    assertTrue(tdocs.advance(40) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(40) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(40, tdocs.docID());
-    assertTrue(tdocs.advance(57) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(57) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(57, tdocs.docID());
-    assertTrue(tdocs.advance(74) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(74) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(74, tdocs.docID());
-    assertTrue(tdocs.advance(75) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(75) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(75, tdocs.docID());
-    assertFalse(tdocs.advance(76) != DocsEnum.NO_MORE_DOCS);
+    assertFalse(tdocs.advance(76) != DocIdSetIterator.NO_MORE_DOCS);
     
     //without next
     tdocs = _TestUtil.docs(random, reader,
@@ -251,17 +252,17 @@ public class TestSegmentTermDocs extends
                            MultiFields.getLiveDocs(reader),
                            null,
                            false);
-    assertTrue(tdocs.advance(5) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(5) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(26, tdocs.docID());
-    assertTrue(tdocs.advance(40) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(40) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(40, tdocs.docID());
-    assertTrue(tdocs.advance(57) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(57) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(57, tdocs.docID());
-    assertTrue(tdocs.advance(74) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(74) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(74, tdocs.docID());
-    assertTrue(tdocs.advance(75) != DocsEnum.NO_MORE_DOCS);
+    assertTrue(tdocs.advance(75) != DocIdSetIterator.NO_MORE_DOCS);
     assertEquals(75, tdocs.docID());
-    assertFalse(tdocs.advance(76) != DocsEnum.NO_MORE_DOCS);
+    assertFalse(tdocs.advance(76) != DocIdSetIterator.NO_MORE_DOCS);
     
     reader.close();
     dir.close();

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestStressAdvance.java Tue Mar  6 23:17:08 2012
@@ -22,6 +22,7 @@ import java.util.List;
 import java.util.Set;
 
 import org.apache.lucene.util.*;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.*;
 import org.apache.lucene.document.*;
 
@@ -117,14 +118,14 @@ public class TestStressAdvance extends L
       }
       if (upto == expected.size()) {
         if (VERBOSE) {
-          System.out.println("  expect docID=" + DocsEnum.NO_MORE_DOCS + " actual=" + docID);
+          System.out.println("  expect docID=" + DocIdSetIterator.NO_MORE_DOCS + " actual=" + docID);
         }
-        assertEquals(DocsEnum.NO_MORE_DOCS, docID);
+        assertEquals(DocIdSetIterator.NO_MORE_DOCS, docID);
       } else {
         if (VERBOSE) {
           System.out.println("  expect docID=" + expected.get(upto) + " actual=" + docID);
         }
-        assertTrue(docID != DocsEnum.NO_MORE_DOCS);
+        assertTrue(docID != DocIdSetIterator.NO_MORE_DOCS);
         assertEquals(expected.get(upto).intValue(), docID);
       }
     }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestStressIndexing2.java Tue Mar  6 23:17:08 2012
@@ -34,6 +34,7 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.TextField;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.TermQuery;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.*;
@@ -336,7 +337,7 @@ public class TestStressIndexing2 extends
       DocsEnum docs = null;
       while(termsEnum.next() != null) {
         docs = _TestUtil.docs(random, termsEnum, null, docs, false);
-        while(docs.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+        while(docs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
           fail("r1 is not empty but r2 is");
         }
       }
@@ -362,18 +363,18 @@ public class TestStressIndexing2 extends
         termDocs2 = null;
       }
 
-      if (termDocs1.nextDoc() == DocsEnum.NO_MORE_DOCS) {
+      if (termDocs1.nextDoc() == DocIdSetIterator.NO_MORE_DOCS) {
         // This doc is deleted and wasn't replaced
-        assertTrue(termDocs2 == null || termDocs2.nextDoc() == DocsEnum.NO_MORE_DOCS);
+        assertTrue(termDocs2 == null || termDocs2.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
         continue;
       }
 
       int id1 = termDocs1.docID();
-      assertEquals(DocsEnum.NO_MORE_DOCS, termDocs1.nextDoc());
+      assertEquals(DocIdSetIterator.NO_MORE_DOCS, termDocs1.nextDoc());
 
-      assertTrue(termDocs2.nextDoc() != DocsEnum.NO_MORE_DOCS);
+      assertTrue(termDocs2.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
       int id2 = termDocs2.docID();
-      assertEquals(DocsEnum.NO_MORE_DOCS, termDocs2.nextDoc());
+      assertEquals(DocIdSetIterator.NO_MORE_DOCS, termDocs2.nextDoc());
 
       r2r1[id2] = id1;
 
@@ -409,7 +410,7 @@ public class TestStressIndexing2 extends
               System.out.println("      " + term2.utf8ToString() + ": freq=" + termsEnum3.totalTermFreq());
               dpEnum = termsEnum3.docsAndPositions(null, dpEnum, false);
               if (dpEnum != null) {
-                assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+                assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
                 final int freq = dpEnum.freq();
                 System.out.println("        doc=" + dpEnum.docID() + " freq=" + freq);
                 for(int posUpto=0;posUpto<freq;posUpto++) {
@@ -418,7 +419,7 @@ public class TestStressIndexing2 extends
               } else {
                 dEnum = _TestUtil.docs(random, termsEnum3, null, dEnum, true);
                 assertNotNull(dEnum);
-                assertTrue(dEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+                assertTrue(dEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
                 final int freq = dEnum.freq();
                 System.out.println("        doc=" + dEnum.docID() + " freq=" + freq);
               }
@@ -443,7 +444,7 @@ public class TestStressIndexing2 extends
               System.out.println("      " + term2.utf8ToString() + ": freq=" + termsEnum3.totalTermFreq());
               dpEnum = termsEnum3.docsAndPositions(null, dpEnum, false);
               if (dpEnum != null) {
-                assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+                assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
                 final int freq = dpEnum.freq();
                 System.out.println("        doc=" + dpEnum.docID() + " freq=" + freq);
                 for(int posUpto=0;posUpto<freq;posUpto++) {
@@ -452,7 +453,7 @@ public class TestStressIndexing2 extends
               } else {
                 dEnum = _TestUtil.docs(random, termsEnum3, null, dEnum, true);
                 assertNotNull(dEnum);
-                assertTrue(dEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+                assertTrue(dEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
                 final int freq = dEnum.freq();
                 System.out.println("        doc=" + dEnum.docID() + " freq=" + freq);
               }
@@ -508,7 +509,7 @@ public class TestStressIndexing2 extends
         
         //System.out.println("TEST: term1=" + term1);
         docs1 = _TestUtil.docs(random, termsEnum1, liveDocs1, docs1, true);
-        while (docs1.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+        while (docs1.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
           int d = docs1.docID();
           int f = docs1.freq();
           info1[len1] = (((long)d)<<32) | f;
@@ -542,7 +543,7 @@ public class TestStressIndexing2 extends
         
         //System.out.println("TEST: term1=" + term1);
         docs2 = _TestUtil.docs(random, termsEnum2, liveDocs2, docs2, true);
-        while (docs2.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+        while (docs2.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
           int d = r2r1[docs2.docID()];
           int f = docs2.freq();
           info2[len2] = (((long)d)<<32) | f;
@@ -640,7 +641,7 @@ public class TestStressIndexing2 extends
           // docIDs are not supposed to be equal
           //int docID2 = dpEnum2.nextDoc();
           //assertEquals(docID1, docID2);
-          assertTrue(docID1 != DocsEnum.NO_MORE_DOCS);
+          assertTrue(docID1 != DocIdSetIterator.NO_MORE_DOCS);
           
           int freq1 = dpEnum1.freq();
           int freq2 = dpEnum2.freq();
@@ -665,8 +666,8 @@ public class TestStressIndexing2 extends
                            offsetAtt2.endOffset());
             }
           }
-          assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum1.nextDoc());
-          assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum2.nextDoc());
+          assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum1.nextDoc());
+          assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum2.nextDoc());
         } else {
           dEnum1 = _TestUtil.docs(random, termsEnum1, null, dEnum1, true);
           dEnum2 = _TestUtil.docs(random, termsEnum2, null, dEnum2, true);
@@ -677,12 +678,12 @@ public class TestStressIndexing2 extends
           // docIDs are not supposed to be equal
           //int docID2 = dEnum2.nextDoc();
           //assertEquals(docID1, docID2);
-          assertTrue(docID1 != DocsEnum.NO_MORE_DOCS);
+          assertTrue(docID1 != DocIdSetIterator.NO_MORE_DOCS);
           int freq1 = dEnum1.freq();
           int freq2 = dEnum2.freq();
           assertEquals(freq1, freq2);
-          assertEquals(DocsEnum.NO_MORE_DOCS, dEnum1.nextDoc());
-          assertEquals(DocsEnum.NO_MORE_DOCS, dEnum2.nextDoc());
+          assertEquals(DocIdSetIterator.NO_MORE_DOCS, dEnum1.nextDoc());
+          assertEquals(DocIdSetIterator.NO_MORE_DOCS, dEnum2.nextDoc());
         }
       }
 

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsReader.java Tue Mar  6 23:17:08 2012
@@ -237,7 +237,7 @@ public class TestTermVectorsReader exten
         assertNotNull(docsEnum);
         int doc = docsEnum.docID();
         assertTrue(doc == -1 || doc == DocIdSetIterator.NO_MORE_DOCS);
-        assertTrue(docsEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+        assertTrue(docsEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
         assertEquals(DocIdSetIterator.NO_MORE_DOCS, docsEnum.nextDoc());
       }
       assertNull(termsEnum.next());
@@ -264,17 +264,17 @@ public class TestTermVectorsReader exten
       assertNotNull(dpEnum);
       int doc = dpEnum.docID();
       assertTrue(doc == -1 || doc == DocIdSetIterator.NO_MORE_DOCS);
-      assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+      assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
       assertEquals(dpEnum.freq(), positions[i].length);
       for (int j = 0; j < positions[i].length; j++) {
         assertEquals(positions[i][j], dpEnum.nextPosition());
       }
-      assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum.nextDoc());
+      assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum.nextDoc());
 
       dpEnum = termsEnum.docsAndPositions(null, dpEnum, true);
       doc = dpEnum.docID();
       assertTrue(doc == -1 || doc == DocIdSetIterator.NO_MORE_DOCS);
-      assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+      assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
       assertNotNull(dpEnum);
       assertEquals(dpEnum.freq(), positions[i].length);
       for (int j = 0; j < positions[i].length; j++) {
@@ -282,7 +282,7 @@ public class TestTermVectorsReader exten
         assertEquals(j*10, dpEnum.startOffset());
         assertEquals(j*10 + testTerms[i].length(), dpEnum.endOffset());
       }
-      assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum.nextDoc());
+      assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum.nextDoc());
     }
 
     Terms freqVector = reader.get(0).terms(testFields[1]); //no pos, no offset
@@ -316,15 +316,15 @@ public class TestTermVectorsReader exten
 
       dpEnum = termsEnum.docsAndPositions(null, dpEnum, false);
       assertNotNull(dpEnum);
-      assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+      assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
       assertEquals(dpEnum.freq(), positions[i].length);
       for (int j = 0; j < positions[i].length; j++) {
         assertEquals(positions[i][j], dpEnum.nextPosition());
       }
-      assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum.nextDoc());
+      assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum.nextDoc());
 
       dpEnum = termsEnum.docsAndPositions(null, dpEnum, true);
-      assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+      assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
       assertNotNull(dpEnum);
       assertEquals(dpEnum.freq(), positions[i].length);
       for (int j = 0; j < positions[i].length; j++) {
@@ -332,7 +332,7 @@ public class TestTermVectorsReader exten
         assertEquals(j*10, dpEnum.startOffset());
         assertEquals(j*10 + testTerms[i].length(), dpEnum.endOffset());
       }
-      assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum.nextDoc());
+      assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum.nextDoc());
     }
     reader.close();
   }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermVectorsWriter.java Tue Mar  6 23:17:08 2012
@@ -31,6 +31,7 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.document.FieldType;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.store.MockDirectoryWrapper;
 import org.apache.lucene.store.RAMDirectory;
@@ -69,18 +70,18 @@ public class TestTermVectorsWriter exten
     assertEquals(1, termsEnum.totalTermFreq());
 
     DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null, true);
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(8, dpEnum.startOffset());
     assertEquals(8, dpEnum.endOffset());
-    assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum.nextDoc());
+    assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum.nextDoc());
 
     // Token "abcd" occurred three times
     assertEquals(new BytesRef("abcd"), termsEnum.next());
     dpEnum = termsEnum.docsAndPositions(null, dpEnum, true);
     assertEquals(3, termsEnum.totalTermFreq());
 
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(0, dpEnum.startOffset());
     assertEquals(4, dpEnum.endOffset());
@@ -93,7 +94,7 @@ public class TestTermVectorsWriter exten
     assertEquals(8, dpEnum.startOffset());
     assertEquals(12, dpEnum.endOffset());
 
-    assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum.nextDoc());
+    assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum.nextDoc());
     assertNull(termsEnum.next());
     r.close();
     dir.close();
@@ -120,7 +121,7 @@ public class TestTermVectorsWriter exten
     DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null, true);
     assertEquals(2, termsEnum.totalTermFreq());
 
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(0, dpEnum.startOffset());
     assertEquals(4, dpEnum.endOffset());
@@ -128,7 +129,7 @@ public class TestTermVectorsWriter exten
     dpEnum.nextPosition();
     assertEquals(5, dpEnum.startOffset());
     assertEquals(9, dpEnum.endOffset());
-    assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum.nextDoc());
+    assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum.nextDoc());
 
     r.close();
     dir.close();
@@ -155,7 +156,7 @@ public class TestTermVectorsWriter exten
     DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null, true);
     assertEquals(2, termsEnum.totalTermFreq());
 
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(0, dpEnum.startOffset());
     assertEquals(4, dpEnum.endOffset());
@@ -163,7 +164,7 @@ public class TestTermVectorsWriter exten
     dpEnum.nextPosition();
     assertEquals(8, dpEnum.startOffset());
     assertEquals(12, dpEnum.endOffset());
-    assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum.nextDoc());
+    assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum.nextDoc());
 
     r.close();
     dir.close();
@@ -194,7 +195,7 @@ public class TestTermVectorsWriter exten
     DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null, true);
     assertEquals(2, termsEnum.totalTermFreq());
 
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(0, dpEnum.startOffset());
     assertEquals(4, dpEnum.endOffset());
@@ -202,7 +203,7 @@ public class TestTermVectorsWriter exten
     dpEnum.nextPosition();
     assertEquals(8, dpEnum.startOffset());
     assertEquals(12, dpEnum.endOffset());
-    assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum.nextDoc());
+    assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum.nextDoc());
 
     r.close();
     dir.close();
@@ -230,7 +231,7 @@ public class TestTermVectorsWriter exten
     DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null, true);
     assertEquals(2, termsEnum.totalTermFreq());
 
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(0, dpEnum.startOffset());
     assertEquals(4, dpEnum.endOffset());
@@ -238,7 +239,7 @@ public class TestTermVectorsWriter exten
     dpEnum.nextPosition();
     assertEquals(9, dpEnum.startOffset());
     assertEquals(13, dpEnum.endOffset());
-    assertEquals(DocsEnum.NO_MORE_DOCS, dpEnum.nextDoc());
+    assertEquals(DocIdSetIterator.NO_MORE_DOCS, dpEnum.nextDoc());
 
     r.close();
     dir.close();
@@ -266,21 +267,21 @@ public class TestTermVectorsWriter exten
     assertNotNull(termsEnum.next());
     DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null, true);
 
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(0, dpEnum.startOffset());
     assertEquals(4, dpEnum.endOffset());
 
     assertNotNull(termsEnum.next());
     dpEnum = termsEnum.docsAndPositions(null, dpEnum, true);
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(11, dpEnum.startOffset());
     assertEquals(17, dpEnum.endOffset());
 
     assertNotNull(termsEnum.next());
     dpEnum = termsEnum.docsAndPositions(null, dpEnum, true);
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(18, dpEnum.startOffset());
     assertEquals(21, dpEnum.endOffset());
@@ -312,14 +313,14 @@ public class TestTermVectorsWriter exten
     DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null, true);
 
     assertEquals(1, (int) termsEnum.totalTermFreq());
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(1, dpEnum.startOffset());
     assertEquals(7, dpEnum.endOffset());
 
     assertNotNull(termsEnum.next());
     dpEnum = termsEnum.docsAndPositions(null, dpEnum, true);
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(8, dpEnum.startOffset());
     assertEquals(11, dpEnum.endOffset());
@@ -355,14 +356,14 @@ public class TestTermVectorsWriter exten
     DocsAndPositionsEnum dpEnum = termsEnum.docsAndPositions(null, null, true);
 
     assertEquals(1, (int) termsEnum.totalTermFreq());
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(0, dpEnum.startOffset());
     assertEquals(4, dpEnum.endOffset());
 
     assertNotNull(termsEnum.next());
     dpEnum = termsEnum.docsAndPositions(null, dpEnum, true);
-    assertTrue(dpEnum.nextDoc() != DocsEnum.NO_MORE_DOCS);
+    assertTrue(dpEnum.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     dpEnum.nextPosition();
     assertEquals(6, dpEnum.startOffset());
     assertEquals(12, dpEnum.endOffset());

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermdocPerf.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermdocPerf.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermdocPerf.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermdocPerf.java Tue Mar  6 23:17:08 2012
@@ -27,6 +27,7 @@ import org.apache.lucene.analysis.tokena
 import org.apache.lucene.document.Document;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.index.IndexWriterConfig.OpenMode;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.LuceneTestCase;
@@ -123,7 +124,7 @@ public class TestTermdocPerf extends Luc
     for (int i=0; i<iter; i++) {
       tenum.seekCeil(new BytesRef("val"));
       tdocs = _TestUtil.docs(random, tenum, MultiFields.getLiveDocs(reader), tdocs, false);
-      while (tdocs.nextDoc() != DocsEnum.NO_MORE_DOCS) {
+      while (tdocs.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
         ret += tdocs.docID();
       }
     }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTermsEnum.java Tue Mar  6 23:17:08 2012
@@ -35,6 +35,7 @@ import org.apache.lucene.document.Field;
 import org.apache.lucene.document.IntField;
 import org.apache.lucene.document.StringField;
 import org.apache.lucene.document.TextField;
+import org.apache.lucene.search.DocIdSetIterator;
 import org.apache.lucene.search.FieldCache;
 import org.apache.lucene.store.Directory;
 import org.apache.lucene.util.BytesRef;
@@ -51,7 +52,7 @@ import org.apache.lucene.util.automaton.
 public class TestTermsEnum extends LuceneTestCase {
 
   public void test() throws Exception {
-    final LineFileDocs docs = new LineFileDocs(random);
+    final LineFileDocs docs = new LineFileDocs(random, defaultCodecSupportsDocValues());
     final Directory d = newDirectory();
     final RandomIndexWriter w = new RandomIndexWriter(random, d);
     final int numDocs = atLeast(10);
@@ -333,7 +334,7 @@ public class TestTermsEnum extends Lucen
           assertEquals(1, te.docFreq());
           docsEnum = _TestUtil.docs(random, te, null, docsEnum, false);
           final int docID = docsEnum.nextDoc();
-          assertTrue(docID != DocsEnum.NO_MORE_DOCS);
+          assertTrue(docID != DocIdSetIterator.NO_MORE_DOCS);
           assertEquals(docIDToID[docID], termToID.get(expected).intValue());
           do {
             loc++;

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/index/TestTypePromotion.java Tue Mar  6 23:17:08 2012
@@ -97,8 +97,8 @@ public class TestTypePromotion extends L
         writer.addIndexes(dir_2);
       } else {
         // do a real merge here
-        IndexReader open = IndexReader.open(dir_2);
-        writer.addIndexes(SlowCompositeReaderWrapper.wrap(open));
+        IndexReader open = maybeWrapReader(IndexReader.open(dir_2));
+        writer.addIndexes(open);
         open.close();
       }
       dir_2.close();

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/JustCompileSearch.java Tue Mar  6 23:17:08 2012
@@ -129,7 +129,7 @@ final class JustCompileSearch {
     }
 
     @Override
-    public FieldComparator setNextReader(AtomicReaderContext context)
+    public FieldComparator<Object> setNextReader(AtomicReaderContext context)
         throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }
@@ -144,7 +144,7 @@ final class JustCompileSearch {
   static final class JustCompileFieldComparatorSource extends FieldComparatorSource {
 
     @Override
-    public FieldComparator newComparator(String fieldname, int numHits,
+    public FieldComparator<?> newComparator(String fieldname, int numHits,
         int sortPos, boolean reversed) throws IOException {
       throw new UnsupportedOperationException(UNSUPPORTED_MSG);
     }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestCustomSearcherSort.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestCustomSearcherSort.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestCustomSearcherSort.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestCustomSearcherSort.java Tue Mar  6 23:17:08 2012
@@ -51,7 +51,7 @@ public class TestCustomSearcherSort exte
     INDEX_SIZE = atLeast(2000);
     index = newDirectory();
     RandomIndexWriter writer = new RandomIndexWriter(random, index);
-    RandomGen random = new RandomGen(this.random);
+    RandomGen random = new RandomGen(LuceneTestCase.random);
     for (int i = 0; i < INDEX_SIZE; ++i) { // don't decrease; if to low the
                                            // problem doesn't show up
       Document doc = new Document();

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestDocIdSet.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestDocIdSet.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestDocIdSet.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestDocIdSet.java Tue Mar  6 23:17:08 2012
@@ -125,4 +125,41 @@ public class TestDocIdSet extends Lucene
     dir.close();
   }
 
+  public void testNullIteratorFilteredDocIdSet() throws Exception {
+    Directory dir = newDirectory();
+    RandomIndexWriter writer = new RandomIndexWriter(random, dir);
+    Document doc = new Document();
+    doc.add(newField("c", "val", StringField.TYPE_UNSTORED));
+    writer.addDocument(doc);
+    IndexReader reader = writer.getReader();
+    writer.close();
+    
+    // First verify the document is searchable.
+    IndexSearcher searcher = newSearcher(reader);
+    Assert.assertEquals(1, searcher.search(new MatchAllDocsQuery(), 10).totalHits);
+    
+      // Now search w/ a Filter which returns a null DocIdSet
+    Filter f = new Filter() {
+      @Override
+      public DocIdSet getDocIdSet(AtomicReaderContext context, Bits acceptDocs) throws IOException {
+        final DocIdSet innerNullIteratorSet = new DocIdSet() {
+          @Override
+          public DocIdSetIterator iterator() {
+            return null;
+          } 
+        };
+        return new FilteredDocIdSet(innerNullIteratorSet) {
+          @Override
+          protected boolean match(int docid) {
+            return true;
+          }	
+        };
+      }
+    };
+    
+    Assert.assertEquals(0, searcher.search(new MatchAllDocsQuery(), f, 10).totalHits);
+    reader.close();
+    dir.close();
+  }
+
 }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestElevationComparator.java Tue Mar  6 23:17:08 2012
@@ -139,7 +139,7 @@ class ElevationComparatorSource extends 
   }
 
   @Override
-  public FieldComparator newComparator(final String fieldname, final int numHits, int sortPos, boolean reversed) throws IOException {
+  public FieldComparator<Integer> newComparator(final String fieldname, final int numHits, int sortPos, boolean reversed) throws IOException {
    return new FieldComparator<Integer>() {
 
      FieldCache.DocTermsIndex idIndex;
@@ -179,7 +179,7 @@ class ElevationComparatorSource extends 
      }
 
      @Override
-     public FieldComparator setNextReader(AtomicReaderContext context) throws IOException {
+     public FieldComparator<Integer> setNextReader(AtomicReaderContext context) throws IOException {
        idIndex = FieldCache.DEFAULT.getTermsIndex(context.reader(), fieldname);
        return this;
      }

Modified: lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestPositionIncrement.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestPositionIncrement.java?rev=1297785&r1=1297784&r2=1297785&view=diff
==============================================================================
--- lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestPositionIncrement.java (original)
+++ lucene/dev/branches/lucene3795_lsp_spatial_module/lucene/core/src/test/org/apache/lucene/search/TestPositionIncrement.java Tue Mar  6 23:17:08 2012
@@ -218,7 +218,7 @@ public class TestPositionIncrement exten
                                                   false);
     
     int count = 0;
-    assertTrue(tp.nextDoc() != DocsAndPositionsEnum.NO_MORE_DOCS);
+    assertTrue(tp.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
     // "a" occurs 4 times
     assertEquals(4, tp.freq());
     int expected = 0;
@@ -228,7 +228,7 @@ public class TestPositionIncrement exten
     assertEquals(6, tp.nextPosition());
 
     // only one doc has "a"
-    assertEquals(DocsAndPositionsEnum.NO_MORE_DOCS, tp.nextDoc());
+    assertEquals(DocIdSetIterator.NO_MORE_DOCS, tp.nextDoc());
 
     IndexSearcher is = newSearcher(readerFromWriter);
   



Mime
View raw message