lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [2/7] .NETification
Date Tue, 16 Sep 2014 20:20:50 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterCommit.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterCommit.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterCommit.cs
index 5eccda9..1a4b4d3 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterCommit.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterCommit.cs
@@ -315,7 +315,7 @@ namespace Lucene.Net.Index
 
             // Reader should see index as multi-seg at this
             // point:
-            Assert.IsTrue(reader.Leaves().Count > 1, "Reader incorrectly sees one segment");
+            Assert.IsTrue(reader.Leaves.Count > 1, "Reader incorrectly sees one segment");
             reader.Dispose();
 
             // Abort the writer:
@@ -326,7 +326,7 @@ namespace Lucene.Net.Index
             reader = DirectoryReader.Open(dir);
 
             // Reader should still see index as multi-segment
-            Assert.IsTrue(reader.Leaves().Count > 1, "Reader incorrectly sees one segment");
+            Assert.IsTrue(reader.Leaves.Count > 1, "Reader incorrectly sees one segment");
             reader.Dispose();
 
             if (VERBOSE)
@@ -347,7 +347,7 @@ namespace Lucene.Net.Index
             reader = DirectoryReader.Open(dir);
 
             // Reader should see index as one segment
-            Assert.AreEqual(1, reader.Leaves().Count, "Reader incorrectly sees more than one segment");
+            Assert.AreEqual(1, reader.Leaves.Count, "Reader incorrectly sees more than one segment");
             reader.Dispose();
             dir.Dispose();
         }
@@ -457,27 +457,27 @@ namespace Lucene.Net.Index
             }
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(0, reader.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
             writer.Commit();
             DirectoryReader reader2 = DirectoryReader.OpenIfChanged(reader);
             Assert.IsNotNull(reader2);
-            Assert.AreEqual(0, reader.NumDocs());
-            Assert.AreEqual(23, reader2.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
+            Assert.AreEqual(23, reader2.NumDocs);
             reader.Dispose();
 
             for (int i = 0; i < 17; i++)
             {
                 TestIndexWriter.AddDoc(writer);
             }
-            Assert.AreEqual(23, reader2.NumDocs());
+            Assert.AreEqual(23, reader2.NumDocs);
             reader2.Dispose();
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(23, reader.NumDocs());
+            Assert.AreEqual(23, reader.NumDocs);
             reader.Dispose();
             writer.Commit();
 
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(40, reader.NumDocs());
+            Assert.AreEqual(40, reader.NumDocs);
             reader.Dispose();
             writer.Dispose();
             dir.Dispose();
@@ -581,20 +581,20 @@ namespace Lucene.Net.Index
             }
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(0, reader.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
 
             writer.PrepareCommit();
 
             IndexReader reader2 = DirectoryReader.Open(dir);
-            Assert.AreEqual(0, reader2.NumDocs());
+            Assert.AreEqual(0, reader2.NumDocs);
 
             writer.Commit();
 
             IndexReader reader3 = DirectoryReader.OpenIfChanged(reader);
             Assert.IsNotNull(reader3);
-            Assert.AreEqual(0, reader.NumDocs());
-            Assert.AreEqual(0, reader2.NumDocs());
-            Assert.AreEqual(23, reader3.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
+            Assert.AreEqual(0, reader2.NumDocs);
+            Assert.AreEqual(23, reader3.NumDocs);
             reader.Dispose();
             reader2.Dispose();
 
@@ -603,21 +603,21 @@ namespace Lucene.Net.Index
                 TestIndexWriter.AddDoc(writer);
             }
 
-            Assert.AreEqual(23, reader3.NumDocs());
+            Assert.AreEqual(23, reader3.NumDocs);
             reader3.Dispose();
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(23, reader.NumDocs());
+            Assert.AreEqual(23, reader.NumDocs);
             reader.Dispose();
 
             writer.PrepareCommit();
 
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(23, reader.NumDocs());
+            Assert.AreEqual(23, reader.NumDocs);
             reader.Dispose();
 
             writer.Commit();
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(40, reader.NumDocs());
+            Assert.AreEqual(40, reader.NumDocs);
             reader.Dispose();
             writer.Dispose();
             dir.Dispose();
@@ -642,19 +642,19 @@ namespace Lucene.Net.Index
             }
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(0, reader.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
 
             writer.PrepareCommit();
 
             IndexReader reader2 = DirectoryReader.Open(dir);
-            Assert.AreEqual(0, reader2.NumDocs());
+            Assert.AreEqual(0, reader2.NumDocs);
 
             writer.Rollback();
 
             IndexReader reader3 = DirectoryReader.OpenIfChanged(reader);
             Assert.IsNull(reader3);
-            Assert.AreEqual(0, reader.NumDocs());
-            Assert.AreEqual(0, reader2.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
+            Assert.AreEqual(0, reader2.NumDocs);
             reader.Dispose();
             reader2.Dispose();
 
@@ -665,18 +665,18 @@ namespace Lucene.Net.Index
             }
 
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(0, reader.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
             reader.Dispose();
 
             writer.PrepareCommit();
 
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(0, reader.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
             reader.Dispose();
 
             writer.Commit();
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(17, reader.NumDocs());
+            Assert.AreEqual(17, reader.NumDocs);
             reader.Dispose();
             writer.Dispose();
             dir.Dispose();
@@ -694,7 +694,7 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             IndexReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(0, reader.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
             reader.Dispose();
             dir.Dispose();
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterDelete.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterDelete.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterDelete.cs
index 1719714..d5f8513 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterDelete.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterDelete.cs
@@ -119,7 +119,7 @@ namespace Lucene.Net.Index
             modifier.Commit();
 
             IndexReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(7, reader.NumDocs());
+            Assert.AreEqual(7, reader.NumDocs);
             reader.Dispose();
 
             modifier.DeleteDocuments(new Term("value", Convert.ToString(value)));
@@ -127,7 +127,7 @@ namespace Lucene.Net.Index
             modifier.Commit();
 
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(0, reader.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
             reader.Dispose();
             modifier.Dispose();
             dir.Dispose();
@@ -189,7 +189,7 @@ namespace Lucene.Net.Index
                 modifier.Commit();
 
                 IndexReader reader = DirectoryReader.Open(dir);
-                Assert.AreEqual(1, reader.NumDocs());
+                Assert.AreEqual(1, reader.NumDocs);
 
                 int hitCount = GetHitCount(dir, new Term("id", Convert.ToString(id)));
                 Assert.AreEqual(1, hitCount);
@@ -230,7 +230,7 @@ namespace Lucene.Net.Index
             modifier.Commit();
 
             IndexReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(5, reader.NumDocs());
+            Assert.AreEqual(5, reader.NumDocs);
             modifier.Dispose();
             reader.Dispose();
             dir.Dispose();
@@ -253,7 +253,7 @@ namespace Lucene.Net.Index
             modifier.Commit();
 
             IndexReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(7, reader.NumDocs());
+            Assert.AreEqual(7, reader.NumDocs);
             reader.Dispose();
 
             id = 0;
@@ -263,7 +263,7 @@ namespace Lucene.Net.Index
             modifier.Commit();
 
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(5, reader.NumDocs());
+            Assert.AreEqual(5, reader.NumDocs);
             reader.Dispose();
 
             Term[] terms = new Term[3];
@@ -274,7 +274,7 @@ namespace Lucene.Net.Index
             modifier.DeleteDocuments(terms);
             modifier.Commit();
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(2, reader.NumDocs());
+            Assert.AreEqual(2, reader.NumDocs);
             reader.Dispose();
 
             modifier.Dispose();
@@ -298,7 +298,7 @@ namespace Lucene.Net.Index
             modifier.Commit();
 
             IndexReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(7, reader.NumDocs());
+            Assert.AreEqual(7, reader.NumDocs);
             reader.Dispose();
 
             // Add 1 doc (so we will have something buffered)
@@ -309,7 +309,7 @@ namespace Lucene.Net.Index
 
             // Delete all shouldn't be on disk yet
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(7, reader.NumDocs());
+            Assert.AreEqual(7, reader.NumDocs);
             reader.Dispose();
 
             // Add a doc and update a doc (after the deleteAll, before the commit)
@@ -321,7 +321,7 @@ namespace Lucene.Net.Index
 
             // Validate there are no docs left
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(2, reader.NumDocs());
+            Assert.AreEqual(2, reader.NumDocs);
             reader.Dispose();
 
             modifier.Dispose();
@@ -362,9 +362,9 @@ namespace Lucene.Net.Index
 
             modifier.Dispose();
             DirectoryReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(reader.MaxDoc(), 0);
-            Assert.AreEqual(reader.NumDocs(), 0);
-            Assert.AreEqual(reader.NumDeletedDocs(), 0);
+            Assert.AreEqual(reader.MaxDoc, 0);
+            Assert.AreEqual(reader.NumDocs, 0);
+            Assert.AreEqual(reader.NumDeletedDocs, 0);
             reader.Dispose();
 
             dir.Dispose();
@@ -446,7 +446,7 @@ namespace Lucene.Net.Index
             AddDoc(modifier, ++id, value);
 
             IndexReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(7, reader.NumDocs());
+            Assert.AreEqual(7, reader.NumDocs);
             reader.Dispose();
 
             // Delete all
@@ -458,7 +458,7 @@ namespace Lucene.Net.Index
 
             // Validate that the docs are still there
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(7, reader.NumDocs());
+            Assert.AreEqual(7, reader.NumDocs);
             reader.Dispose();
 
             dir.Dispose();
@@ -481,7 +481,7 @@ namespace Lucene.Net.Index
             modifier.Commit();
 
             IndexReader reader = modifier.Reader;
-            Assert.AreEqual(7, reader.NumDocs());
+            Assert.AreEqual(7, reader.NumDocs);
             reader.Dispose();
 
             AddDoc(modifier, ++id, value);
@@ -491,7 +491,7 @@ namespace Lucene.Net.Index
             modifier.DeleteAll();
 
             reader = modifier.Reader;
-            Assert.AreEqual(0, reader.NumDocs());
+            Assert.AreEqual(0, reader.NumDocs);
             reader.Dispose();
 
             // Roll it back
@@ -500,7 +500,7 @@ namespace Lucene.Net.Index
 
             // Validate that the docs are still there
             reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(7, reader.NumDocs());
+            Assert.AreEqual(7, reader.NumDocs);
             reader.Dispose();
 
             dir.Dispose();
@@ -1123,7 +1123,7 @@ namespace Lucene.Net.Index
                     w.DeleteDocuments(new Term("id", "" + ids[upto++]));
                 }
                 IndexReader r = w.Reader;
-                Assert.AreEqual(NUM_DOCS - upto, r.NumDocs());
+                Assert.AreEqual(NUM_DOCS - upto, r.NumDocs);
                 r.Dispose();
             }
 
@@ -1434,12 +1434,12 @@ namespace Lucene.Net.Index
             w = new IndexWriter(d, iwc);
             IndexReader r = DirectoryReader.Open(w, false);
             Assert.IsTrue(w.TryDeleteDocument(r, 1));
-            Assert.IsTrue(w.TryDeleteDocument(r.Leaves()[0].Reader(), 0));
+            Assert.IsTrue(w.TryDeleteDocument(r.Leaves[0].Reader, 0));
             r.Dispose();
             w.Dispose();
 
             r = DirectoryReader.Open(d);
-            Assert.AreEqual(2, r.NumDeletedDocs());
+            Assert.AreEqual(2, r.NumDeletedDocs);
             Assert.IsNotNull(MultiFields.GetLiveDocs(r));
             r.Dispose();
             d.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
index c7d16fb..58b706e 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterExceptions.cs
@@ -815,11 +815,11 @@ namespace Lucene.Net.Index
                 {
                     int expected = 5;
                     Assert.AreEqual(expected, reader.DocFreq(new Term("contents", "here")));
-                    Assert.AreEqual(expected, reader.MaxDoc());
+                    Assert.AreEqual(expected, reader.MaxDoc);
                     int numDel = 0;
                     Bits liveDocs = MultiFields.GetLiveDocs(reader);
                     Assert.IsNotNull(liveDocs);
-                    for (int j = 0; j < reader.MaxDoc(); j++)
+                    for (int j = 0; j < reader.MaxDoc; j++)
                     {
                         if (!liveDocs.Get(j))
                         {
@@ -848,10 +848,10 @@ namespace Lucene.Net.Index
                 reader = DirectoryReader.Open(dir);
                 int expected_ = 19 + (1 - i) * 2;
                 Assert.AreEqual(expected_, reader.DocFreq(new Term("contents", "here")));
-                Assert.AreEqual(expected_, reader.MaxDoc());
+                Assert.AreEqual(expected_, reader.MaxDoc);
                 int numDel_ = 0;
                 Assert.IsNull(MultiFields.GetLiveDocs(reader));
-                for (int j = 0; j < reader.MaxDoc(); j++)
+                for (int j = 0; j < reader.MaxDoc; j++)
                 {
                     reader.Document(j);
                     reader.GetTermVectors(j);
@@ -916,11 +916,11 @@ namespace Lucene.Net.Index
                 IndexReader reader = DirectoryReader.Open(dir);
                 int expected = (3 + (1 - i) * 2) * NUM_THREAD * NUM_ITER;
                 Assert.AreEqual(expected, reader.DocFreq(new Term("contents", "here")), "i=" + i);
-                Assert.AreEqual(expected, reader.MaxDoc());
+                Assert.AreEqual(expected, reader.MaxDoc);
                 int numDel = 0;
                 Bits liveDocs = MultiFields.GetLiveDocs(reader);
                 Assert.IsNotNull(liveDocs);
-                for (int j = 0; j < reader.MaxDoc(); j++)
+                for (int j = 0; j < reader.MaxDoc; j++)
                 {
                     if (!liveDocs.Get(j))
                     {
@@ -949,9 +949,9 @@ namespace Lucene.Net.Index
                 reader = DirectoryReader.Open(dir);
                 expected += 17 - NUM_THREAD * NUM_ITER;
                 Assert.AreEqual(expected, reader.DocFreq(new Term("contents", "here")));
-                Assert.AreEqual(expected, reader.MaxDoc());
+                Assert.AreEqual(expected, reader.MaxDoc);
                 Assert.IsNull(MultiFields.GetLiveDocs(reader));
-                for (int j = 0; j < reader.MaxDoc(); j++)
+                for (int j = 0; j < reader.MaxDoc; j++)
                 {
                     reader.Document(j);
                     reader.GetTermVectors(j);
@@ -1109,7 +1109,7 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             IndexReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(23, reader.NumDocs());
+            Assert.AreEqual(23, reader.NumDocs);
             reader.Dispose();
             dir.Dispose();
         }
@@ -1643,12 +1643,12 @@ namespace Lucene.Net.Index
                     w.AddDocument(document);
                     w.Dispose();
                     IndexReader reader = DirectoryReader.Open(dir);
-                    Assert.IsTrue(reader.NumDocs() > 0);
+                    Assert.IsTrue(reader.NumDocs > 0);
                     SegmentInfos sis = new SegmentInfos();
                     sis.Read(dir);
-                    foreach (AtomicReaderContext context in reader.Leaves())
+                    foreach (AtomicReaderContext context in reader.Leaves)
                     {
-                        Assert.IsFalse(((AtomicReader)context.Reader()).FieldInfos.HasVectors());
+                        Assert.IsFalse((context.AtomicReader).FieldInfos.HasVectors());
                     }
                     reader.Dispose();
                     dir.Dispose();
@@ -1961,7 +1961,7 @@ namespace Lucene.Net.Index
                 // expected
             }
             DirectoryReader ir = DirectoryReader.Open(iw, false);
-            Assert.AreEqual(1, ir.NumDocs());
+            Assert.AreEqual(1, ir.NumDocs);
             Assert.AreEqual("sometext", ir.Document(0).Get("field1"));
             ir.Dispose();
             iw.Dispose();
@@ -2048,7 +2048,7 @@ namespace Lucene.Net.Index
             iw.AddDocument(doc); // add a document
             iw.Commit();
             DirectoryReader ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(1, ir.NumDocs());
+            Assert.AreEqual(1, ir.NumDocs);
             ir.Dispose();
             iw.Dispose();
 
@@ -2073,14 +2073,14 @@ namespace Lucene.Net.Index
                 failure.ClearDoFail();
                 iw.Dispose();
                 ir = DirectoryReader.Open(dir);
-                Assert.AreEqual(1, ir.NumDocs(), "lost document after iteration: " + i);
+                Assert.AreEqual(1, ir.NumDocs, "lost document after iteration: " + i);
                 ir.Dispose();
             }
 
             // Check if document is still there
             failure.ClearDoFail();
             ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(1, ir.NumDocs());
+            Assert.AreEqual(1, ir.NumDocs);
             ir.Dispose();
 
             dir.Dispose();
@@ -2232,7 +2232,7 @@ namespace Lucene.Net.Index
 
                     // Sometimes we will make it here (we only randomly
                     // throw the exc):
-                    Assert.AreEqual(docCount - deleteCount, r.NumDocs());
+                    Assert.AreEqual(docCount - deleteCount, r.NumDocs);
                     r.Dispose();
 
                     // Sometimes close, so the disk full happens on close:
@@ -2301,19 +2301,19 @@ namespace Lucene.Net.Index
                     }
                     ir = w.Reader;
                 }
-                Assert.AreEqual(docCount - deleteCount, ir.NumDocs());
+                Assert.AreEqual(docCount - deleteCount, ir.NumDocs);
                 if (DefaultCodecSupportsDocValues())
                 {
                     BytesRef scratch = new BytesRef();
-                    foreach (AtomicReaderContext context in ir.Leaves())
+                    foreach (AtomicReaderContext context in ir.Leaves)
                     {
-                        AtomicReader reader = (AtomicReader)context.Reader();
+                        AtomicReader reader = context.AtomicReader;
                         Bits liveDocs = reader.LiveDocs;
                         NumericDocValues f = reader.GetNumericDocValues("f");
                         NumericDocValues cf = reader.GetNumericDocValues("cf");
                         BinaryDocValues bf = reader.GetBinaryDocValues("bf");
                         BinaryDocValues bcf = reader.GetBinaryDocValues("bcf");
-                        for (int i = 0; i < reader.MaxDoc(); i++)
+                        for (int i = 0; i < reader.MaxDoc; i++)
                         {
                             if (liveDocs == null || liveDocs.Get(i))
                             {
@@ -2347,7 +2347,7 @@ namespace Lucene.Net.Index
 
             // Final verify:
             IndexReader indRdr = DirectoryReader.Open(dir);
-            Assert.AreEqual(docCount - deleteCount, indRdr.NumDocs());
+            Assert.AreEqual(docCount - deleteCount, indRdr.NumDocs);
             indRdr.Dispose();
 
             dir.Dispose();
@@ -2471,7 +2471,7 @@ namespace Lucene.Net.Index
             Assert.IsFalse(IndexWriter.IsLocked(dir));
 
             r = DirectoryReader.Open(dir);
-            Assert.AreEqual(10, r.MaxDoc());
+            Assert.AreEqual(10, r.MaxDoc);
             r.Dispose();
 
             // no leaks
@@ -2553,7 +2553,7 @@ namespace Lucene.Net.Index
                 Assert.IsFalse(IndexWriter.IsLocked(dir));
 
                 r = DirectoryReader.Open(dir);
-                Assert.AreEqual(10, r.MaxDoc());
+                Assert.AreEqual(10, r.MaxDoc);
                 r.Dispose();
 
                 // no leaks

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterForceMerge.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterForceMerge.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterForceMerge.cs
index cbcc614..8d05d83 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterForceMerge.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterForceMerge.cs
@@ -206,7 +206,7 @@ namespace Lucene.Net.Index
                 {
                     writer.Dispose();
                     DirectoryReader reader = DirectoryReader.Open(dir);
-                    Assert.AreEqual(1, reader.Leaves().Count);
+                    Assert.AreEqual(1, reader.Leaves.Count);
                     reader.Dispose();
                 }
                 else
@@ -218,7 +218,7 @@ namespace Lucene.Net.Index
                     writer.Dispose();
 
                     DirectoryReader reader = DirectoryReader.Open(dir);
-                    Assert.IsTrue(reader.Leaves().Count > 1);
+                    Assert.IsTrue(reader.Leaves.Count > 1);
                     reader.Dispose();
 
                     SegmentInfos infos = new SegmentInfos();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterMergePolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterMergePolicy.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterMergePolicy.cs
index c849f85..869a301 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterMergePolicy.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterMergePolicy.cs
@@ -211,7 +211,7 @@ namespace Lucene.Net.Index
             writer.WaitForMerges();
             writer.Commit();
             CheckInvariants(writer);
-            Assert.AreEqual(10, writer.MaxDoc());
+            Assert.AreEqual(10, writer.MaxDoc);
 
             writer.Dispose();
             dir.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterMerging.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterMerging.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterMerging.cs
index 60d30a6..5181ae0 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterMerging.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterMerging.cs
@@ -84,7 +84,7 @@ namespace Lucene.Net.Index
             bool fail = false;
             IndexReader reader = DirectoryReader.Open(directory);
 
-            int max = reader.MaxDoc();
+            int max = reader.MaxDoc;
             for (int i = 0; i < max; i++)
             {
                 Document temp = reader.Document(i);
@@ -146,8 +146,8 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             IndexReader ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(10, ir.MaxDoc());
-            Assert.AreEqual(10, ir.NumDocs());
+            Assert.AreEqual(10, ir.MaxDoc);
+            Assert.AreEqual(10, ir.NumDocs);
             ir.Dispose();
 
             IndexWriterConfig dontMergeConfig = (new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()))).SetMergePolicy(NoMergePolicy.COMPOUND_FILES);
@@ -157,18 +157,18 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(8, ir.NumDocs());
+            Assert.AreEqual(8, ir.NumDocs);
             ir.Dispose();
 
             writer = new IndexWriter(dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMergePolicy(NewLogMergePolicy()));
             Assert.AreEqual(8, writer.NumDocs());
-            Assert.AreEqual(10, writer.MaxDoc());
+            Assert.AreEqual(10, writer.MaxDoc);
             writer.ForceMergeDeletes();
             Assert.AreEqual(8, writer.NumDocs());
             writer.Dispose();
             ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(8, ir.MaxDoc());
-            Assert.AreEqual(8, ir.NumDocs());
+            Assert.AreEqual(8, ir.MaxDoc);
+            Assert.AreEqual(8, ir.NumDocs);
             ir.Dispose();
             dir.Dispose();
         }
@@ -205,8 +205,8 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             IndexReader ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(98, ir.MaxDoc());
-            Assert.AreEqual(98, ir.NumDocs());
+            Assert.AreEqual(98, ir.MaxDoc);
+            Assert.AreEqual(98, ir.NumDocs);
             ir.Dispose();
 
             IndexWriterConfig dontMergeConfig = (new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()))).SetMergePolicy(NoMergePolicy.COMPOUND_FILES);
@@ -218,7 +218,7 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(49, ir.NumDocs());
+            Assert.AreEqual(49, ir.NumDocs);
             ir.Dispose();
 
             writer = new IndexWriter(dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMergePolicy(NewLogMergePolicy(3)));
@@ -226,8 +226,8 @@ namespace Lucene.Net.Index
             writer.ForceMergeDeletes();
             writer.Dispose();
             ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(49, ir.MaxDoc());
-            Assert.AreEqual(49, ir.NumDocs());
+            Assert.AreEqual(49, ir.MaxDoc);
+            Assert.AreEqual(49, ir.NumDocs);
             ir.Dispose();
             dir.Dispose();
         }
@@ -264,8 +264,8 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             IndexReader ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(98, ir.MaxDoc());
-            Assert.AreEqual(98, ir.NumDocs());
+            Assert.AreEqual(98, ir.MaxDoc);
+            Assert.AreEqual(98, ir.NumDocs);
             ir.Dispose();
 
             IndexWriterConfig dontMergeConfig = (new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random()))).SetMergePolicy(NoMergePolicy.COMPOUND_FILES);
@@ -276,15 +276,15 @@ namespace Lucene.Net.Index
             }
             writer.Dispose();
             ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(49, ir.NumDocs());
+            Assert.AreEqual(49, ir.NumDocs);
             ir.Dispose();
 
             writer = new IndexWriter(dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetMergePolicy(NewLogMergePolicy(3)));
             writer.ForceMergeDeletes(false);
             writer.Dispose();
             ir = DirectoryReader.Open(dir);
-            Assert.AreEqual(49, ir.MaxDoc());
-            Assert.AreEqual(49, ir.NumDocs());
+            Assert.AreEqual(49, ir.MaxDoc);
+            Assert.AreEqual(49, ir.NumDocs);
             ir.Dispose();
             dir.Dispose();
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterNRTIsCurrent.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterNRTIsCurrent.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterNRTIsCurrent.cs
index 0e9dafe..2e46d17 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterNRTIsCurrent.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterNRTIsCurrent.cs
@@ -147,7 +147,7 @@ namespace Lucene.Net.Index
                                 currentReader.DecRef();
                                 currentReader = newReader;
                             }
-                            if (currentReader.NumDocs() == 0)
+                            if (currentReader.NumDocs == 0)
                             {
                                 Writer.AddDocument(doc);
                             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterOutOfFileDescriptors.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterOutOfFileDescriptors.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterOutOfFileDescriptors.cs
index e246b4a..b65a77f 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterOutOfFileDescriptors.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterOutOfFileDescriptors.cs
@@ -129,8 +129,8 @@ namespace Lucene.Net.Index
                             r2 = r3;
                         }
                     }
-                    Assert.IsTrue(r2.NumDocs() >= lastNumDocs, "before=" + lastNumDocs + " after=" + r2.NumDocs());
-                    lastNumDocs = r2.NumDocs();
+                    Assert.IsTrue(r2.NumDocs >= lastNumDocs, "before=" + lastNumDocs + " after=" + r2.NumDocs);
+                    lastNumDocs = r2.NumDocs;
                     //System.out.println("numDocs=" + lastNumDocs);
                     dir.RandomIOExceptionRateOnOpen = rate;
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
index 9a0c9d3..709b129 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterReader.cs
@@ -235,8 +235,8 @@ namespace Lucene.Net.Index
 
             Assert.IsTrue(dirReader.Current);
             Assert.IsTrue(nrtReader.Current); // nothing was committed yet so we are still current
-            Assert.AreEqual(2, nrtReader.MaxDoc()); // sees the actual document added
-            Assert.AreEqual(1, dirReader.MaxDoc());
+            Assert.AreEqual(2, nrtReader.MaxDoc); // sees the actual document added
+            Assert.AreEqual(1, dirReader.MaxDoc);
             writer.Dispose(); // close is actually a commit both should see the changes
             Assert.IsTrue(nrtReader.Current);
             Assert.IsFalse(dirReader.Current); // this reader has been opened before the writer was closed / committed
@@ -293,7 +293,7 @@ namespace Lucene.Net.Index
             writer.Commit();
             Assert.IsTrue(r1.Current); // we have seen all changes - no change after opening the NRT reader
 
-            Assert.AreEqual(200, r1.MaxDoc());
+            Assert.AreEqual(200, r1.MaxDoc);
 
             int index2df = r1.DocFreq(new Term("indexname", "index2"));
 
@@ -356,7 +356,7 @@ namespace Lucene.Net.Index
             writer.AddIndexes(dir2);
 
             IndexReader r1 = writer.Reader;
-            Assert.AreEqual(500, r1.MaxDoc());
+            Assert.AreEqual(500, r1.MaxDoc);
 
             r1.Dispose();
             writer.Dispose();
@@ -434,7 +434,7 @@ namespace Lucene.Net.Index
             addDirThreads.JoinThreads();
 
             //Assert.AreEqual(100 + numDirs * (3 * numIter / 4) * addDirThreads.numThreads
-            //    * addDirThreads.NUM_INIT_DOCS, addDirThreads.mainWriter.NumDocs());
+            //    * addDirThreads.NUM_INIT_DOCS, addDirThreads.mainWriter.NumDocs);
             Assert.AreEqual(addDirThreads.Count.Get(), addDirThreads.MainWriter.NumDocs());
 
             addDirThreads.Close(true);
@@ -444,9 +444,9 @@ namespace Lucene.Net.Index
             TestUtil.CheckIndex(mainDir);
 
             IndexReader reader = DirectoryReader.Open(mainDir);
-            Assert.AreEqual(addDirThreads.Count.Get(), reader.NumDocs());
+            Assert.AreEqual(addDirThreads.Count.Get(), reader.NumDocs);
             //Assert.AreEqual(100 + numDirs * (3 * numIter / 4) * addDirThreads.numThreads
-            //    * addDirThreads.NUM_INIT_DOCS, reader.NumDocs());
+            //    * addDirThreads.NUM_INIT_DOCS, reader.NumDocs);
             reader.Dispose();
 
             addDirThreads.CloseDir();
@@ -649,15 +649,15 @@ namespace Lucene.Net.Index
             Directory dir1 = GetAssertNoDeletesDirectory(NewDirectory());
             IndexWriter writer = new IndexWriter(dir1, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
             IndexReader r1 = writer.Reader;
-            Assert.AreEqual(0, r1.MaxDoc());
+            Assert.AreEqual(0, r1.MaxDoc);
             CreateIndexNoClose(false, "index1", writer);
             writer.Flush(!doFullMerge, true);
 
             IndexReader iwr1 = writer.Reader;
-            Assert.AreEqual(100, iwr1.MaxDoc());
+            Assert.AreEqual(100, iwr1.MaxDoc);
 
             IndexReader r2 = writer.Reader;
-            Assert.AreEqual(r2.MaxDoc(), 100);
+            Assert.AreEqual(r2.MaxDoc, 100);
             // add 100 documents
             for (int x = 10000; x < 10000 + 100; x++)
             {
@@ -668,11 +668,11 @@ namespace Lucene.Net.Index
             // verify the reader was reopened internally
             IndexReader iwr2 = writer.Reader;
             Assert.IsTrue(iwr2 != r1);
-            Assert.AreEqual(200, iwr2.MaxDoc());
+            Assert.AreEqual(200, iwr2.MaxDoc);
             // should have flushed out a segment
             IndexReader r3 = writer.Reader;
             Assert.IsTrue(r2 != r3);
-            Assert.AreEqual(200, r3.MaxDoc());
+            Assert.AreEqual(200, r3.MaxDoc);
 
             // dec ref the readers rather than close them because
             // closing flushes changes to the writer
@@ -687,7 +687,7 @@ namespace Lucene.Net.Index
             writer = new IndexWriter(dir1, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
             IndexReader w2r1 = writer.Reader;
             // insure the deletes were actually flushed to the directory
-            Assert.AreEqual(200, w2r1.MaxDoc());
+            Assert.AreEqual(200, w2r1.MaxDoc);
             w2r1.Dispose();
             writer.Dispose();
 
@@ -789,7 +789,7 @@ namespace Lucene.Net.Index
             TestUtil.CheckIndex(dir1);
             writer.Commit();
             TestUtil.CheckIndex(dir1);
-            Assert.AreEqual(100, r1.NumDocs());
+            Assert.AreEqual(100, r1.NumDocs);
 
             for (int i = 0; i < 10; i++)
             {
@@ -803,7 +803,7 @@ namespace Lucene.Net.Index
                 r1.Dispose();
                 r1 = r2;
             }
-            Assert.AreEqual(110, r1.NumDocs());
+            Assert.AreEqual(110, r1.NumDocs);
             writer.Dispose();
             r1.Dispose();
             dir1.Dispose();
@@ -825,7 +825,7 @@ namespace Lucene.Net.Index
             TestUtil.CheckIndex(dir1);
 
             // reader should remain usable even after IndexWriter is closed:
-            Assert.AreEqual(100, r.NumDocs());
+            Assert.AreEqual(100, r.NumDocs);
             Query q = new TermQuery(new Term("indexname", "test"));
             IndexSearcher searcher = NewSearcher(r);
             Assert.AreEqual(100, searcher.Search(q, 10).TotalHits);
@@ -1098,8 +1098,8 @@ namespace Lucene.Net.Index
             w.Dispose();
             r.Dispose();
             r = DirectoryReader.Open(dir);
-            Assert.AreEqual(1, r.NumDocs());
-            Assert.IsFalse(r.HasDeletions());
+            Assert.AreEqual(1, r.NumDocs);
+            Assert.IsFalse(r.HasDeletions);
             r.Dispose();
             dir.Dispose();
         }
@@ -1118,17 +1118,17 @@ namespace Lucene.Net.Index
             id.StringValue = "1";
             w.AddDocument(doc);
             IndexReader r = w.Reader;
-            Assert.AreEqual(2, r.NumDocs());
+            Assert.AreEqual(2, r.NumDocs);
             r.Dispose();
 
             w.DeleteDocuments(new Term("id", "0"));
             r = w.Reader;
-            Assert.AreEqual(1, r.NumDocs());
+            Assert.AreEqual(1, r.NumDocs);
             r.Dispose();
 
             w.DeleteDocuments(new Term("id", "1"));
             r = w.Reader;
-            Assert.AreEqual(0, r.NumDocs());
+            Assert.AreEqual(0, r.NumDocs);
             r.Dispose();
 
             w.Dispose();
@@ -1142,7 +1142,7 @@ namespace Lucene.Net.Index
             Directory dir = NewDirectory();
             IndexWriter w = new IndexWriter(dir, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())));
             IndexReader r = w.Reader;
-            Assert.AreEqual(0, r.NumDocs());
+            Assert.AreEqual(0, r.NumDocs);
             r.Dispose();
             w.Dispose();
             dir.Dispose();
@@ -1410,7 +1410,7 @@ namespace Lucene.Net.Index
                 w.AddDocument(doc);
                 IndexReader r = DirectoryReader.Open(w, true);
                 // Make sure segment count never exceeds 100:
-                Assert.IsTrue(r.Leaves().Count < 100);
+                Assert.IsTrue(r.Leaves.Count < 100);
                 r.Dispose();
             }
             w.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
index cf2051f..3120efd 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
@@ -365,9 +365,9 @@ namespace Lucene.Net.Index
             IndexReader r = writer.Reader;
 
             // Test each sub-segment
-            foreach (AtomicReaderContext ctx in r.Leaves())
+            foreach (AtomicReaderContext ctx in r.Leaves)
             {
-                CheckTermsOrder(ctx.Reader(), allTerms, false);
+                CheckTermsOrder(ctx.Reader, allTerms, false);
             }
             CheckTermsOrder(r, allTerms, true);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs
index af34567..6e118c6 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterWithThreads.cs
@@ -337,7 +337,7 @@ namespace Lucene.Net.Index
                 {
                     IndexReader reader = DirectoryReader.Open(dir);
                     Bits delDocs = MultiFields.GetLiveDocs(reader);
-                    for (int j = 0; j < reader.MaxDoc(); j++)
+                    for (int j = 0; j < reader.MaxDoc; j++)
                     {
                         if (delDocs == null || !delDocs.Get(j))
                         {
@@ -574,7 +574,7 @@ namespace Lucene.Net.Index
                 Assert.IsFalse(thread2.Failed, "Failed due to: " + thread2.Failure);
                 // now verify that we have two documents in the index
                 IndexReader reader = DirectoryReader.Open(dir);
-                Assert.AreEqual(2, reader.NumDocs(), "IndexReader should have one document per thread running");
+                Assert.AreEqual(2, reader.NumDocs, "IndexReader should have one document per thread running");
 
                 reader.Dispose();
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestLongPostings.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestLongPostings.cs b/src/Lucene.Net.Tests/core/Index/TestLongPostings.cs
index 38f3584..8afe0dc 100644
--- a/src/Lucene.Net.Tests/core/Index/TestLongPostings.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestLongPostings.cs
@@ -175,7 +175,7 @@ namespace Lucene.Net.Index
             }
             */
 
-            Assert.AreEqual(NUM_DOCS, r.NumDocs());
+            Assert.AreEqual(NUM_DOCS, r.NumDocs);
             Assert.IsTrue(r.DocFreq(new Term("field", s1)) > 0);
             Assert.IsTrue(r.DocFreq(new Term("field", s2)) > 0);
 
@@ -422,7 +422,7 @@ namespace Lucene.Net.Index
             }
             */
 
-            Assert.AreEqual(NUM_DOCS, r.NumDocs());
+            Assert.AreEqual(NUM_DOCS, r.NumDocs);
             Assert.IsTrue(r.DocFreq(new Term("field", s1)) > 0);
             Assert.IsTrue(r.DocFreq(new Term("field", s2)) > 0);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestMaxTermFrequency.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestMaxTermFrequency.cs b/src/Lucene.Net.Tests/core/Index/TestMaxTermFrequency.cs
index 93f2751..fa66c94 100644
--- a/src/Lucene.Net.Tests/core/Index/TestMaxTermFrequency.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestMaxTermFrequency.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Index
         public virtual void Test()
         {
             NumericDocValues fooNorms = MultiDocValues.GetNormValues(Reader, "foo");
-            for (int i = 0; i < Reader.MaxDoc(); i++)
+            for (int i = 0; i < Reader.MaxDoc; i++)
             {
                 Assert.AreEqual((int)Expected[i], fooNorms.Get(i) & 0xff);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestMixedCodecs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestMixedCodecs.cs b/src/Lucene.Net.Tests/core/Index/TestMixedCodecs.cs
index 7f4a9fd..723bf74 100644
--- a/src/Lucene.Net.Tests/core/Index/TestMixedCodecs.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestMixedCodecs.cs
@@ -93,7 +93,7 @@ namespace Lucene.Net.Index
                     if (Random().Next(17) == 6)
                     {
                         IndexReader r = w.Reader;
-                        Assert.AreEqual(NUM_DOCS - deleted.Count, r.NumDocs());
+                        Assert.AreEqual(NUM_DOCS - deleted.Count, r.NumDocs);
                         r.Dispose();
                     }
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestMixedDocValuesUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestMixedDocValuesUpdates.cs b/src/Lucene.Net.Tests/core/Index/TestMixedDocValuesUpdates.cs
index 9118a17..8930728 100644
--- a/src/Lucene.Net.Tests/core/Index/TestMixedDocValuesUpdates.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestMixedDocValuesUpdates.cs
@@ -166,11 +166,11 @@ namespace Lucene.Net.Index
                 reader.Dispose();
                 reader = newReader;
                 //      System.out.println("[" + Thread.currentThread().getName() + "]: reopened reader: " + reader);
-                Assert.IsTrue(reader.NumDocs() > 0); // we delete at most one document per round
+                Assert.IsTrue(reader.NumDocs > 0); // we delete at most one document per round
                 BytesRef scratch = new BytesRef();
-                foreach (AtomicReaderContext context in reader.Leaves())
+                foreach (AtomicReaderContext context in reader.Leaves)
                 {
-                    AtomicReader r = (AtomicReader)context.Reader();
+                    AtomicReader r = context.AtomicReader;
                     //        System.out.println(((SegmentReader) r).getSegmentName());
                     Bits liveDocs = r.LiveDocs;
                     for (int field = 0; field < fieldValues.Length; field++)
@@ -189,7 +189,7 @@ namespace Lucene.Net.Index
                             Assert.IsNull(ndv);
                             Assert.IsNotNull(bdv);
                         }
-                        int maxDoc = r.MaxDoc();
+                        int maxDoc = r.MaxDoc;
                         for (int doc = 0; doc < maxDoc; doc++)
                         {
                             if (liveDocs == null || liveDocs.Get(doc))
@@ -284,9 +284,9 @@ namespace Lucene.Net.Index
 
             DirectoryReader reader = DirectoryReader.Open(dir);
             BytesRef scratch = new BytesRef();
-            foreach (AtomicReaderContext context in reader.Leaves())
+            foreach (AtomicReaderContext context in reader.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 for (int i = 0; i < numThreads; i++)
                 {
                     BinaryDocValues bdv = r.GetBinaryDocValues("f" + i);
@@ -294,7 +294,7 @@ namespace Lucene.Net.Index
                     Bits docsWithBdv = r.GetDocsWithField("f" + i);
                     Bits docsWithControl = r.GetDocsWithField("cf" + i);
                     Bits liveDocs = r.LiveDocs;
-                    for (int j = 0; j < r.MaxDoc(); j++)
+                    for (int j = 0; j < r.MaxDoc; j++)
                     {
                         if (liveDocs == null || liveDocs.Get(j))
                         {
@@ -472,12 +472,12 @@ namespace Lucene.Net.Index
                 writer.UpdateBinaryDocValue(t, "f", TestBinaryDocValuesUpdates.ToBytes(value));
                 writer.UpdateNumericDocValue(t, "cf", value * 2);
                 DirectoryReader reader = DirectoryReader.Open(writer, true);
-                foreach (AtomicReaderContext context in reader.Leaves())
+                foreach (AtomicReaderContext context in reader.Leaves)
                 {
-                    AtomicReader r = (AtomicReader)context.Reader();
+                    AtomicReader r = context.AtomicReader;
                     BinaryDocValues fbdv = r.GetBinaryDocValues("f");
                     NumericDocValues cfndv = r.GetNumericDocValues("cf");
-                    for (int j = 0; j < r.MaxDoc(); j++)
+                    for (int j = 0; j < r.MaxDoc; j++)
                     {
                         Assert.AreEqual(cfndv.Get(j), TestBinaryDocValuesUpdates.GetValue(fbdv, j, scratch) * 2);
                     }
@@ -549,14 +549,14 @@ namespace Lucene.Net.Index
 
             DirectoryReader reader = DirectoryReader.Open(dir);
             BytesRef scratch = new BytesRef();
-            foreach (AtomicReaderContext context in reader.Leaves())
+            foreach (AtomicReaderContext context in reader.Leaves)
             {
                 for (int i = 0; i < numBinaryFields; i++)
                 {
-                    AtomicReader r = (AtomicReader)context.Reader();
+                    AtomicReader r = context.AtomicReader;
                     BinaryDocValues f = r.GetBinaryDocValues("f" + i);
                     NumericDocValues cf = r.GetNumericDocValues("cf" + i);
-                    for (int j = 0; j < r.MaxDoc(); j++)
+                    for (int j = 0; j < r.MaxDoc; j++)
                     {
                         Assert.AreEqual(cf.Get(j), TestBinaryDocValuesUpdates.GetValue(f, j, scratch) * 2, "reader=" + r + ", field=f" + i + ", doc=" + j);
                     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestNRTThreads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestNRTThreads.cs b/src/Lucene.Net.Tests/core/Index/TestNRTThreads.cs
index a23824d..0bea57a 100644
--- a/src/Lucene.Net.Tests/core/Index/TestNRTThreads.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestNRTThreads.cs
@@ -91,10 +91,10 @@ namespace Lucene.Net.Index
                 {
                     Console.WriteLine("TEST: got new reader=" + r);
                 }
-                //System.out.println("numDocs=" + r.NumDocs() + "
+                //System.out.println("numDocs=" + r.NumDocs + "
                 //openDelFileCount=" + dir.openDeleteFileCount());
 
-                if (r.NumDocs() > 0)
+                if (r.NumDocs > 0)
                 {
                     FixedSearcher = new IndexSearcher(r, es);
                     SmokeTestSearcher(FixedSearcher);
@@ -103,7 +103,7 @@ namespace Lucene.Net.Index
             }
             r.Dispose();
 
-            //System.out.println("numDocs=" + r.NumDocs() + " openDelFileCount=" + dir.openDeleteFileCount());
+            //System.out.println("numDocs=" + r.NumDocs + " openDelFileCount=" + dir.openDeleteFileCount());
             ISet<string> openDeletedFiles_ = ((MockDirectoryWrapper)Dir).OpenDeletedFiles;
             if (openDeletedFiles_.Count > 0)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestNorms.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestNorms.cs b/src/Lucene.Net.Tests/core/Index/TestNorms.cs
index 4f42322..124d688 100644
--- a/src/Lucene.Net.Tests/core/Index/TestNorms.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestNorms.cs
@@ -130,13 +130,13 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             NumericDocValues fooNorms = MultiDocValues.GetNormValues(reader, "foo");
-            for (int i = 0; i < reader.MaxDoc(); i++)
+            for (int i = 0; i < reader.MaxDoc; i++)
             {
                 Assert.AreEqual(0, fooNorms.Get(i));
             }
 
             NumericDocValues barNorms = MultiDocValues.GetNormValues(reader, "bar");
-            for (int i = 0; i < reader.MaxDoc(); i++)
+            for (int i = 0; i < reader.MaxDoc; i++)
             {
                 Assert.AreEqual(1, barNorms.Get(i));
             }
@@ -153,7 +153,7 @@ namespace Lucene.Net.Index
             AtomicReader open = SlowCompositeReaderWrapper.Wrap(DirectoryReader.Open(dir));
             NumericDocValues normValues = open.GetNormValues(ByteTestField);
             Assert.IsNotNull(normValues);
-            for (int i = 0; i < open.MaxDoc(); i++)
+            for (int i = 0; i < open.MaxDoc; i++)
             {
                 Document document = open.Document(i);
                 int expected = Convert.ToInt32(document.Get(ByteTestField));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestNumericDocValuesUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestNumericDocValuesUpdates.cs b/src/Lucene.Net.Tests/core/Index/TestNumericDocValuesUpdates.cs
index 88609ff..bf9d902 100644
--- a/src/Lucene.Net.Tests/core/Index/TestNumericDocValuesUpdates.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestNumericDocValuesUpdates.cs
@@ -115,8 +115,8 @@ namespace Lucene.Net.Index
                 writer.Dispose();
             }
 
-            Assert.AreEqual(1, reader.Leaves().Count);
-            AtomicReader r = (AtomicReader)reader.Leaves()[0].Reader();
+            Assert.AreEqual(1, reader.Leaves.Count);
+            AtomicReader r = (AtomicReader)reader.Leaves[0].Reader;
             NumericDocValues ndv = r.GetNumericDocValues("val");
             Assert.AreEqual(2, ndv.Get(0));
             Assert.AreEqual(2, ndv.Get(1));
@@ -165,12 +165,12 @@ namespace Lucene.Net.Index
                 writer.Dispose();
             }
 
-            foreach (AtomicReaderContext context in reader.Leaves())
+            foreach (AtomicReaderContext context in reader.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 NumericDocValues ndv = r.GetNumericDocValues("val");
                 Assert.IsNotNull(ndv);
-                for (int i = 0; i < r.MaxDoc(); i++)
+                for (int i = 0; i < r.MaxDoc; i++)
                 {
                     long expected = expectedValues[i + context.DocBase];
                     long actual = ndv.Get(i);
@@ -215,8 +215,8 @@ namespace Lucene.Net.Index
             Assert.IsNotNull(reader2);
             Assert.IsTrue(reader1 != reader2);
 
-            Assert.AreEqual(1, ((AtomicReader)reader1.Leaves()[0].Reader()).GetNumericDocValues("val").Get(0));
-            Assert.AreEqual(10, ((AtomicReader)reader2.Leaves()[0].Reader()).GetNumericDocValues("val").Get(0));
+            Assert.AreEqual(1, ((AtomicReader)reader1.Leaves[0].Reader).GetNumericDocValues("val").Get(0));
+            Assert.AreEqual(10, ((AtomicReader)reader2.Leaves[0].Reader).GetNumericDocValues("val").Get(0));
 
             IOUtils.Close(writer, reader1, reader2, dir);
         }
@@ -312,7 +312,7 @@ namespace Lucene.Net.Index
                 writer.Dispose();
             }
 
-            AtomicReader r = (AtomicReader)reader.Leaves()[0].Reader();
+            AtomicReader r = (AtomicReader)reader.Leaves[0].Reader;
             Assert.IsFalse(r.LiveDocs.Get(0));
             Assert.AreEqual(17, r.GetNumericDocValues("val").Get(1));
 
@@ -352,7 +352,7 @@ namespace Lucene.Net.Index
                 writer.Dispose();
             }
 
-            AtomicReader r = (AtomicReader)reader.Leaves()[0].Reader();
+            AtomicReader r = (AtomicReader)reader.Leaves[0].Reader;
             Assert.IsFalse(r.LiveDocs.Get(0));
             Assert.AreEqual(1, r.GetNumericDocValues("val").Get(0)); // deletes are currently applied first
 
@@ -386,13 +386,13 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            AtomicReader r = (AtomicReader)reader.Leaves()[0].Reader();
+            AtomicReader r = (AtomicReader)reader.Leaves[0].Reader;
             NumericDocValues ndv = r.GetNumericDocValues("ndv");
             BinaryDocValues bdv = r.GetBinaryDocValues("bdv");
             SortedDocValues sdv = r.GetSortedDocValues("sdv");
             SortedSetDocValues ssdv = r.GetSortedSetDocValues("ssdv");
             BytesRef scratch = new BytesRef();
-            for (int i = 0; i < r.MaxDoc(); i++)
+            for (int i = 0; i < r.MaxDoc; i++)
             {
                 Assert.AreEqual(17, ndv.Get(i));
                 bdv.Get(i, scratch);
@@ -439,10 +439,10 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            AtomicReader r = (AtomicReader)reader.Leaves()[0].Reader();
+            AtomicReader r = (AtomicReader)reader.Leaves[0].Reader;
             NumericDocValues ndv1 = r.GetNumericDocValues("ndv1");
             NumericDocValues ndv2 = r.GetNumericDocValues("ndv2");
-            for (int i = 0; i < r.MaxDoc(); i++)
+            for (int i = 0; i < r.MaxDoc; i++)
             {
                 Assert.AreEqual(17, ndv1.Get(i));
                 Assert.AreEqual(i, ndv2.Get(i));
@@ -476,9 +476,9 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            AtomicReader r = (AtomicReader)reader.Leaves()[0].Reader();
+            AtomicReader r = (AtomicReader)reader.Leaves[0].Reader;
             NumericDocValues ndv = r.GetNumericDocValues("ndv");
-            for (int i = 0; i < r.MaxDoc(); i++)
+            for (int i = 0; i < r.MaxDoc; i++)
             {
                 Assert.AreEqual(17, ndv.Get(i));
             }
@@ -509,9 +509,9 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            AtomicReader r = (AtomicReader)reader.Leaves()[0].Reader();
+            AtomicReader r = (AtomicReader)reader.Leaves[0].Reader;
             NumericDocValues ndv = r.GetNumericDocValues("ndv");
-            for (int i = 0; i < r.MaxDoc(); i++)
+            for (int i = 0; i < r.MaxDoc; i++)
             {
                 if (i == 0)
                 {
@@ -553,9 +553,9 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            AtomicReader r = (AtomicReader)reader.Leaves()[0].Reader();
+            AtomicReader r = (AtomicReader)reader.Leaves[0].Reader;
             NumericDocValues ndv = r.GetNumericDocValues("ndv");
-            for (int i = 0; i < r.MaxDoc(); i++)
+            for (int i = 0; i < r.MaxDoc; i++)
             {
                 Assert.AreEqual(0, ndv.Get(i));
             }
@@ -633,7 +633,7 @@ namespace Lucene.Net.Index
             NumericDocValues ndv = r.GetNumericDocValues("ndv");
             SortedDocValues sdv = r.GetSortedDocValues("sorted");
             BytesRef scratch = new BytesRef();
-            for (int i = 0; i < r.MaxDoc(); i++)
+            for (int i = 0; i < r.MaxDoc; i++)
             {
                 Assert.AreEqual(17, ndv.Get(i));
                 sdv.Get(i, scratch);
@@ -680,7 +680,7 @@ namespace Lucene.Net.Index
             DirectoryReader reader = DirectoryReader.Open(dir);
             AtomicReader r = SlowCompositeReaderWrapper.Wrap(reader);
             NumericDocValues ndv = r.GetNumericDocValues("ndv");
-            for (int i = 0; i < r.MaxDoc(); i++)
+            for (int i = 0; i < r.MaxDoc; i++)
             {
                 Assert.AreEqual(3, ndv.Get(i));
             }
@@ -754,12 +754,12 @@ namespace Lucene.Net.Index
                     reader = DirectoryReader.Open(writer, true);
                 }
 
-                Assert.AreEqual(1, reader.Leaves().Count);
-                AtomicReader r = (AtomicReader)reader.Leaves()[0].Reader();
+                Assert.AreEqual(1, reader.Leaves.Count);
+                AtomicReader r = (AtomicReader)reader.Leaves[0].Reader;
                 Assert.IsNull(r.LiveDocs, "index should have no deletes after forceMerge");
                 NumericDocValues ndv = r.GetNumericDocValues("ndv");
                 Assert.IsNotNull(ndv);
-                for (int i = 0; i < r.MaxDoc(); i++)
+                for (int i = 0; i < r.MaxDoc; i++)
                 {
                     Assert.AreEqual(value, ndv.Get(i));
                 }
@@ -793,7 +793,7 @@ namespace Lucene.Net.Index
             DirectoryReader reader = DirectoryReader.Open(dir);
             AtomicReader r = SlowCompositeReaderWrapper.Wrap(reader);
             NumericDocValues ndv = r.GetNumericDocValues("ndv");
-            for (int i = 0; i < r.MaxDoc(); i++)
+            for (int i = 0; i < r.MaxDoc; i++)
             {
                 Assert.AreEqual(3, ndv.Get(i));
             }
@@ -896,10 +896,10 @@ namespace Lucene.Net.Index
                 reader.Dispose();
                 reader = newReader;
                 //      System.out.println("[" + Thread.currentThread().getName() + "]: reopened reader: " + reader);
-                Assert.IsTrue(reader.NumDocs() > 0); // we delete at most one document per round
-                foreach (AtomicReaderContext context in reader.Leaves())
+                Assert.IsTrue(reader.NumDocs > 0); // we delete at most one document per round
+                foreach (AtomicReaderContext context in reader.Leaves)
                 {
-                    AtomicReader r = (AtomicReader)context.Reader();
+                    AtomicReader r = context.AtomicReader;
                     //        System.out.println(((SegmentReader) r).getSegmentName());
                     Bits liveDocs = r.LiveDocs;
                     for (int field = 0; field < fieldValues.Length; field++)
@@ -908,7 +908,7 @@ namespace Lucene.Net.Index
                         NumericDocValues ndv = r.GetNumericDocValues(f);
                         Bits docsWithField = r.GetDocsWithField(f);
                         Assert.IsNotNull(ndv);
-                        int maxDoc = r.MaxDoc();
+                        int maxDoc = r.MaxDoc;
                         for (int doc = 0; doc < maxDoc; doc++)
                         {
                             if (liveDocs == null || liveDocs.Get(doc))
@@ -973,9 +973,9 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext context in reader.Leaves())
+            foreach (AtomicReaderContext context in reader.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 NumericDocValues ndv = r.GetNumericDocValues("ndv");
                 Bits docsWithField = r.GetDocsWithField("ndv");
                 Assert.IsNotNull(docsWithField);
@@ -1020,11 +1020,11 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext context in reader.Leaves())
+            foreach (AtomicReaderContext context in reader.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 NumericDocValues ndv = r.GetNumericDocValues("ndv");
-                for (int i = 0; i < r.MaxDoc(); i++)
+                for (int i = 0; i < r.MaxDoc; i++)
                 {
                     Assert.AreEqual(5L, ndv.Get(i));
                 }
@@ -1052,7 +1052,7 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader r = DirectoryReader.Open(dir);
-            NumericDocValues ndv = ((AtomicReader)r.Leaves()[0].Reader()).GetNumericDocValues("f");
+            NumericDocValues ndv = ((AtomicReader)r.Leaves[0].Reader).GetNumericDocValues("f");
             Assert.AreEqual(17, ndv.Get(0));
             r.Dispose();
 
@@ -1160,9 +1160,9 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext context in reader.Leaves())
+            foreach (AtomicReaderContext context in reader.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 for (int i = 0; i < numThreads; i++)
                 {
                     NumericDocValues ndv = r.GetNumericDocValues("f" + i);
@@ -1170,7 +1170,7 @@ namespace Lucene.Net.Index
                     Bits docsWithNdv = r.GetDocsWithField("f" + i);
                     Bits docsWithControl = r.GetDocsWithField("cf" + i);
                     Bits liveDocs = r.LiveDocs;
-                    for (int j = 0; j < r.MaxDoc(); j++)
+                    for (int j = 0; j < r.MaxDoc; j++)
                     {
                         if (liveDocs == null || liveDocs.Get(j))
                         {
@@ -1340,12 +1340,12 @@ namespace Lucene.Net.Index
                 writer.UpdateNumericDocValue(t, "f", value);
                 writer.UpdateNumericDocValue(t, "cf", value * 2);
                 DirectoryReader reader = DirectoryReader.Open(writer, true);
-                foreach (AtomicReaderContext context in reader.Leaves())
+                foreach (AtomicReaderContext context in reader.Leaves)
                 {
-                    AtomicReader r = (AtomicReader)context.Reader();
+                    AtomicReader r = context.AtomicReader;
                     NumericDocValues fndv = r.GetNumericDocValues("f");
                     NumericDocValues cfndv = r.GetNumericDocValues("cf");
-                    for (int j = 0; j < r.MaxDoc(); j++)
+                    for (int j = 0; j < r.MaxDoc; j++)
                     {
                         Assert.AreEqual(cfndv.Get(j), fndv.Get(j) * 2);
                     }
@@ -1477,12 +1477,12 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader_ = DirectoryReader.Open(dir2);
-            foreach (AtomicReaderContext context in reader_.Leaves())
+            foreach (AtomicReaderContext context in reader_.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 NumericDocValues ndv = r.GetNumericDocValues("ndv");
                 NumericDocValues control = r.GetNumericDocValues("control");
-                for (int i = 0; i < r.MaxDoc(); i++)
+                for (int i = 0; i < r.MaxDoc; i++)
                 {
                     Assert.AreEqual(ndv.Get(i) * 2, control.Get(i));
                 }
@@ -1510,7 +1510,7 @@ namespace Lucene.Net.Index
             int numFiles = dir.ListAll().Length;
 
             DirectoryReader r = DirectoryReader.Open(dir);
-            Assert.AreEqual(2L, ((AtomicReader)r.Leaves()[0].Reader()).GetNumericDocValues("f").Get(0));
+            Assert.AreEqual(2L, ((AtomicReader)r.Leaves[0].Reader).GetNumericDocValues("f").Get(0));
             r.Dispose();
 
             // create second gen of update files, first gen should be deleted
@@ -1519,7 +1519,7 @@ namespace Lucene.Net.Index
             Assert.AreEqual(numFiles, dir.ListAll().Length);
 
             r = DirectoryReader.Open(dir);
-            Assert.AreEqual(5L, ((AtomicReader)r.Leaves()[0].Reader()).GetNumericDocValues("f").Get(0));
+            Assert.AreEqual(5L, ((AtomicReader)r.Leaves[0].Reader).GetNumericDocValues("f").Get(0));
             r.Dispose();
 
             writer.Dispose();
@@ -1586,14 +1586,14 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext context in reader.Leaves())
+            foreach (AtomicReaderContext context in reader.Leaves)
             {
                 for (int i = 0; i < numNumericFields; i++)
                 {
-                    AtomicReader r = (AtomicReader)context.Reader();
+                    AtomicReader r = context.AtomicReader;
                     NumericDocValues f = r.GetNumericDocValues("f" + i);
                     NumericDocValues cf = r.GetNumericDocValues("cf" + i);
-                    for (int j = 0; j < r.MaxDoc(); j++)
+                    for (int j = 0; j < r.MaxDoc; j++)
                     {
                         Assert.AreEqual(cf.Get(j), f.Get(j) * 2, "reader=" + r + ", field=f" + i + ", doc=" + j);
                     }
@@ -1625,8 +1625,8 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(4, ((AtomicReader)reader.Leaves()[0].Reader()).GetNumericDocValues("f1").Get(0));
-            Assert.AreEqual(3, ((AtomicReader)reader.Leaves()[0].Reader()).GetNumericDocValues("f2").Get(0));
+            Assert.AreEqual(4, ((AtomicReader)reader.Leaves[0].Reader).GetNumericDocValues("f1").Get(0));
+            Assert.AreEqual(3, ((AtomicReader)reader.Leaves[0].Reader).GetNumericDocValues("f2").Get(0));
             reader.Dispose();
 
             dir.Dispose();
@@ -1651,8 +1651,8 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(1, reader.Leaves().Count);
-            Assert.AreEqual(2L, ((AtomicReader)reader.Leaves()[0].Reader()).GetNumericDocValues("f1").Get(0));
+            Assert.AreEqual(1, reader.Leaves.Count);
+            Assert.AreEqual(2L, ((AtomicReader)reader.Leaves[0].Reader).GetNumericDocValues("f1").Get(0));
             reader.Dispose();
 
             dir.Dispose();
@@ -1675,8 +1675,8 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir);
-            Assert.AreEqual(1, reader.Leaves().Count);
-            Assert.AreEqual(1L, ((AtomicReader)reader.Leaves()[0].Reader()).GetNumericDocValues("f1").Get(0));
+            Assert.AreEqual(1, reader.Leaves.Count);
+            Assert.AreEqual(1L, ((AtomicReader)reader.Leaves[0].Reader).GetNumericDocValues("f1").Get(0));
             reader.Dispose();
 
             dir.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestOmitNorms.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestOmitNorms.cs b/src/Lucene.Net.Tests/core/Index/TestOmitNorms.cs
index 9b9a833..85192b0 100644
--- a/src/Lucene.Net.Tests/core/Index/TestOmitNorms.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestOmitNorms.cs
@@ -316,7 +316,7 @@ namespace Lucene.Net.Index
             }
             else
             {
-                for (int docID = 0; docID < ir1.MaxDoc(); docID++)
+                for (int docID = 0; docID < ir1.MaxDoc; docID++)
                 {
                     Assert.AreEqual(norms1.Get(docID), norms2.Get(docID));
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestParallelCompositeReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestParallelCompositeReader.cs b/src/Lucene.Net.Tests/core/Index/TestParallelCompositeReader.cs
index 8d76978..473f8a5 100644
--- a/src/Lucene.Net.Tests/core/Index/TestParallelCompositeReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestParallelCompositeReader.cs
@@ -157,11 +157,11 @@ namespace Lucene.Net.Index
 
             int[] listenerClosedCount = new int[1];
 
-            Assert.AreEqual(3, pr.Leaves().Count);
+            Assert.AreEqual(3, pr.Leaves.Count);
 
-            foreach (AtomicReaderContext cxt in pr.Leaves())
+            foreach (AtomicReaderContext cxt in pr.Leaves)
             {
-                cxt.Reader().AddReaderClosedListener(new ReaderClosedListenerAnonymousInnerClassHelper(this, listenerClosedCount));
+                cxt.Reader.AddReaderClosedListener(new ReaderClosedListenerAnonymousInnerClassHelper(this, listenerClosedCount));
             }
             pr.Dispose();
             ir1.Dispose();
@@ -199,11 +199,11 @@ namespace Lucene.Net.Index
 
             int[] listenerClosedCount = new int[1];
 
-            Assert.AreEqual(3, pr.Leaves().Count);
+            Assert.AreEqual(3, pr.Leaves.Count);
 
-            foreach (AtomicReaderContext cxt in pr.Leaves())
+            foreach (AtomicReaderContext cxt in pr.Leaves)
             {
-                cxt.Reader().AddReaderClosedListener(new ReaderClosedListenerAnonymousInnerClassHelper2(this, listenerClosedCount));
+                cxt.Reader.AddReaderClosedListener(new ReaderClosedListenerAnonymousInnerClassHelper2(this, listenerClosedCount));
             }
             pr.Dispose();
             Assert.AreEqual(3, listenerClosedCount[0]);
@@ -549,15 +549,15 @@ namespace Lucene.Net.Index
             {
                 rd1 = new MultiReader(DirectoryReader.Open(Dir1), DirectoryReader.Open(Dir1));
                 rd2 = new MultiReader(DirectoryReader.Open(Dir2), DirectoryReader.Open(Dir2));
-                Assert.AreEqual(2, rd1.Context.Children().Count);
-                Assert.AreEqual(2, rd2.Context.Children().Count);
+                Assert.AreEqual(2, rd1.Context.Children.Count);
+                Assert.AreEqual(2, rd2.Context.Children.Count);
             }
             else
             {
                 rd1 = DirectoryReader.Open(Dir1);
                 rd2 = DirectoryReader.Open(Dir2);
-                Assert.AreEqual(3, rd1.Context.Children().Count);
-                Assert.AreEqual(3, rd2.Context.Children().Count);
+                Assert.AreEqual(3, rd1.Context.Children.Count);
+                Assert.AreEqual(3, rd2.Context.Children.Count);
             }
             ParallelCompositeReader pr = new ParallelCompositeReader(rd1, rd2);
             return NewSearcher(pr);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestParallelReaderEmptyIndex.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestParallelReaderEmptyIndex.cs b/src/Lucene.Net.Tests/core/Index/TestParallelReaderEmptyIndex.cs
index c9d7160..2562f92 100644
--- a/src/Lucene.Net.Tests/core/Index/TestParallelReaderEmptyIndex.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestParallelReaderEmptyIndex.cs
@@ -118,8 +118,8 @@ namespace Lucene.Net.Index
                 writer.DeleteDocuments(new Term("id", "1"));
                 writer.Dispose();
                 IndexReader ir = DirectoryReader.Open(rd1);
-                Assert.AreEqual(2, ir.MaxDoc());
-                Assert.AreEqual(1, ir.NumDocs());
+                Assert.AreEqual(2, ir.MaxDoc);
+                Assert.AreEqual(1, ir.NumDocs);
                 ir.Dispose();
 
                 iw = new IndexWriter(rd1, NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random())).SetOpenMode(OpenMode_e.APPEND));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestParallelTermEnum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestParallelTermEnum.cs b/src/Lucene.Net.Tests/core/Index/TestParallelTermEnum.cs
index bd97439..9c509cd 100644
--- a/src/Lucene.Net.Tests/core/Index/TestParallelTermEnum.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestParallelTermEnum.cs
@@ -103,7 +103,7 @@ namespace Lucene.Net.Index
 
             Bits liveDocs = pr.LiveDocs;
 
-            Fields fields = pr.Fields();
+            Fields fields = pr.Fields;
             IEnumerator<string> fe = fields.GetEnumerator();
 
             fe.MoveNext();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestPostingsOffsets.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestPostingsOffsets.cs b/src/Lucene.Net.Tests/core/Index/TestPostingsOffsets.cs
index d3c0a0f..26f0ffc 100644
--- a/src/Lucene.Net.Tests/core/Index/TestPostingsOffsets.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestPostingsOffsets.cs
@@ -321,12 +321,12 @@ namespace Lucene.Net.Index
             w.Dispose();
 
             string[] terms = new string[] { "a", "b", "c", "d" };
-            foreach (AtomicReaderContext ctx in r.Leaves())
+            foreach (AtomicReaderContext ctx in r.Leaves)
             {
                 // TODO: improve this
-                AtomicReader sub = (AtomicReader)ctx.Reader();
+                AtomicReader sub = (AtomicReader)ctx.Reader;
                 //System.out.println("\nsub=" + sub);
-                TermsEnum termsEnum = sub.Fields().Terms("content").Iterator(null);
+                TermsEnum termsEnum = sub.Fields.Terms("content").Iterator(null);
                 DocsEnum docs = null;
                 DocsAndPositionsEnum docsAndPositions = null;
                 DocsAndPositionsEnum docsAndPositionsAndOffsets = null;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestRollback.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestRollback.cs b/src/Lucene.Net.Tests/core/Index/TestRollback.cs
index d591d75..42bd03c 100644
--- a/src/Lucene.Net.Tests/core/Index/TestRollback.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestRollback.cs
@@ -59,7 +59,7 @@ namespace Lucene.Net.Index
             w.Rollback();
 
             IndexReader r = DirectoryReader.Open(dir);
-            Assert.AreEqual(5, r.NumDocs(), "index should contain same number of docs post rollback");
+            Assert.AreEqual(5, r.NumDocs, "index should contain same number of docs post rollback");
             r.Dispose();
             dir.Dispose();
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestRollingUpdates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestRollingUpdates.cs b/src/Lucene.Net.Tests/core/Index/TestRollingUpdates.cs
index 6908c31..9f980f2 100644
--- a/src/Lucene.Net.Tests/core/Index/TestRollingUpdates.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestRollingUpdates.cs
@@ -149,7 +149,7 @@ namespace Lucene.Net.Index
                     {
                         s = null;
                     }
-                    Assert.IsTrue(!applyDeletions || r.NumDocs() == SIZE, "applyDeletions=" + applyDeletions + " r.NumDocs()=" + r.NumDocs() + " vs SIZE=" + SIZE);
+                    Assert.IsTrue(!applyDeletions || r.NumDocs == SIZE, "applyDeletions=" + applyDeletions + " r.NumDocs=" + r.NumDocs + " vs SIZE=" + SIZE);
                     updateCount = 0;
                 }
             }
@@ -215,7 +215,7 @@ namespace Lucene.Net.Index
             }
 
             IndexReader open = DirectoryReader.Open(dir);
-            Assert.AreEqual(1, open.NumDocs());
+            Assert.AreEqual(1, open.NumDocs);
             open.Dispose();
             docs.Dispose();
             dir.Dispose();
@@ -257,7 +257,7 @@ namespace Lucene.Net.Index
                                 open.Dispose();
                                 open = reader;
                             }
-                            Assert.AreEqual(1, open.NumDocs(), "iter: " + i + " numDocs: " + open.NumDocs() + " del: " + open.NumDeletedDocs() + " max: " + open.MaxDoc());
+                            Assert.AreEqual(1, open.NumDocs, "iter: " + i + " numDocs: " + open.NumDocs + " del: " + open.NumDeletedDocs + " max: " + open.MaxDoc);
                         }
                     }
                     if (open != null)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestSegmentMerger.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestSegmentMerger.cs b/src/Lucene.Net.Tests/core/Index/TestSegmentMerger.cs
index c4b215b..b044411 100644
--- a/src/Lucene.Net.Tests/core/Index/TestSegmentMerger.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestSegmentMerger.cs
@@ -101,7 +101,7 @@ namespace Lucene.Net.Index
             //Should be able to open a new SegmentReader against the new directory
             SegmentReader mergedReader = new SegmentReader(new SegmentCommitInfo(new SegmentInfo(MergedDir, Constants.LUCENE_MAIN_VERSION, MergedSegment, docsMerged, false, codec, null), 0, -1L, -1L), DirectoryReader.DEFAULT_TERMS_INDEX_DIVISOR, NewIOContext(Random()));
             Assert.IsTrue(mergedReader != null);
-            Assert.IsTrue(mergedReader.NumDocs() == 2);
+            Assert.IsTrue(mergedReader.NumDocs == 2);
             Document newDoc1 = mergedReader.Document(0);
             Assert.IsTrue(newDoc1 != null);
             //There are 2 unstored fields on the document
@@ -148,11 +148,11 @@ namespace Lucene.Net.Index
 
         private static bool Equals(MergeState.DocMap map1, MergeState.DocMap map2)
         {
-            if (map1.MaxDoc() != map2.MaxDoc())
+            if (map1.MaxDoc != map2.MaxDoc)
             {
                 return false;
             }
-            for (int i = 0; i < map1.MaxDoc(); ++i)
+            for (int i = 0; i < map1.MaxDoc; ++i)
             {
                 if (map1.Get(i) != map2.Get(i))
                 {
@@ -184,9 +184,9 @@ namespace Lucene.Net.Index
 
             MergeState.DocMap docMap = MergeState.DocMap.Build(maxDoc, liveDocs);
 
-            Assert.AreEqual(maxDoc, docMap.MaxDoc());
-            Assert.AreEqual(numDocs, docMap.NumDocs());
-            Assert.AreEqual(numDeletedDocs, docMap.NumDeletedDocs());
+            Assert.AreEqual(maxDoc, docMap.MaxDoc);
+            Assert.AreEqual(numDocs, docMap.NumDocs);
+            Assert.AreEqual(numDeletedDocs, docMap.NumDeletedDocs);
             // assert the mapping is compact
             for (int i = 0, del = 0; i < maxDoc; ++i)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs b/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs
index a28f97e..d90e8cb 100644
--- a/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestSegmentReader.cs
@@ -67,8 +67,8 @@ namespace Lucene.Net.Index
         [Test]
         public virtual void TestDocument()
         {
-            Assert.IsTrue(Reader.NumDocs() == 1);
-            Assert.IsTrue(Reader.MaxDoc() >= 1);
+            Assert.IsTrue(Reader.NumDocs == 1);
+            Assert.IsTrue(Reader.MaxDoc >= 1);
             Document result = Reader.Document(0);
             Assert.IsTrue(result != null);
             //There are 2 unstored fields on the document that are not preserved across writing
@@ -220,13 +220,13 @@ namespace Lucene.Net.Index
 
             Fields results = Reader.GetTermVectors(0);
             Assert.IsTrue(results != null);
-            Assert.AreEqual(3, results.Size(), "We do not have 3 term freq vectors");
+            Assert.AreEqual(3, results.Size, "We do not have 3 term freq vectors");
         }
 
         [Test]
         public virtual void TestOutOfBoundsAccess()
         {
-            int numDocs = Reader.MaxDoc();
+            int numDocs = Reader.MaxDoc;
             try
             {
                 Reader.Document(-1);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestSegmentTermDocs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestSegmentTermDocs.cs b/src/Lucene.Net.Tests/core/Index/TestSegmentTermDocs.cs
index 161e6ae..301c64f 100644
--- a/src/Lucene.Net.Tests/core/Index/TestSegmentTermDocs.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestSegmentTermDocs.cs
@@ -72,7 +72,7 @@ namespace Lucene.Net.Index
             Assert.IsTrue(reader != null);
             Assert.AreEqual(indexDivisor, reader.TermInfosIndexDivisor);
 
-            TermsEnum terms = reader.Fields().Terms(DocHelper.TEXT_FIELD_2_KEY).Iterator(null);
+            TermsEnum terms = reader.Fields.Terms(DocHelper.TEXT_FIELD_2_KEY).Iterator(null);
             terms.SeekCeil(new BytesRef("field"));
             DocsEnum termDocs = TestUtil.Docs(Random(), terms, reader.LiveDocs, null, DocsEnum.FLAG_FREQS);
             if (termDocs.NextDoc() != DocIdSetIterator.NO_MORE_DOCS)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestSegmentTermEnum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestSegmentTermEnum.cs b/src/Lucene.Net.Tests/core/Index/TestSegmentTermEnum.cs
index 529d9f2..a4a7d19 100644
--- a/src/Lucene.Net.Tests/core/Index/TestSegmentTermEnum.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestSegmentTermEnum.cs
@@ -87,7 +87,7 @@ namespace Lucene.Net.Index
             AddDoc(writer, "aaa bbb");
             writer.Dispose();
             SegmentReader reader = GetOnlySegmentReader(DirectoryReader.Open(Dir));
-            TermsEnum terms = reader.Fields().Terms("content").Iterator(null);
+            TermsEnum terms = reader.Fields.Terms("content").Iterator(null);
             Assert.IsNotNull(terms.Next());
             Assert.AreEqual("aaa", terms.Term().Utf8ToString());
             Assert.IsNotNull(terms.Next());

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs b/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
index eddd3bb..eb6d125 100644
--- a/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
@@ -64,7 +64,7 @@ namespace Lucene.Net.Index
             IndexReader reader = DirectoryReader.Open(commit);
             try
             {
-                Assert.AreEqual(expectedMaxDoc, reader.MaxDoc());
+                Assert.AreEqual(expectedMaxDoc, reader.MaxDoc);
             }
             finally
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/TestStressAdvance.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestStressAdvance.cs b/src/Lucene.Net.Tests/core/Index/TestStressAdvance.cs
index 66e43a0..9f88a40 100644
--- a/src/Lucene.Net.Tests/core/Index/TestStressAdvance.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestStressAdvance.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Index
                 IList<int> bDocIDs = new List<int>();
 
                 DirectoryReader r = w.Reader;
-                int[] idToDocID = new int[r.MaxDoc()];
+                int[] idToDocID = new int[r.MaxDoc];
                 for (int docID = 0; docID < idToDocID.Length; docID++)
                 {
                     int id = Convert.ToInt32(r.Document(docID).Get("id"));
@@ -91,7 +91,7 @@ namespace Lucene.Net.Index
                         bDocIDs.Add(docID);
                     }
                 }
-                TermsEnum te = GetOnlySegmentReader(r).Fields().Terms("field").Iterator(null);
+                TermsEnum te = GetOnlySegmentReader(r).Fields.Terms("field").Iterator(null);
 
                 DocsEnum de = null;
                 for (int iter2 = 0; iter2 < 10; iter2++)


Mime
View raw message