lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [4/7] .NETification
Date Tue, 16 Sep 2014 20:20:52 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs b/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs
index 1fbfdb0..649a0e4 100644
--- a/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs
+++ b/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs
@@ -35,16 +35,19 @@ namespace Lucene.Net.Index
             : base(@in)
         {
             // check some basic reader sanity
-            Debug.Assert(@in.MaxDoc() >= 0);
-            Debug.Assert(@in.NumDocs() <= @in.MaxDoc());
-            Debug.Assert(@in.NumDeletedDocs() + @in.NumDocs() == @in.MaxDoc());
-            Debug.Assert(!@in.HasDeletions() || @in.NumDeletedDocs() > 0 && @in.NumDocs() < @in.MaxDoc());
+            Debug.Assert(@in.MaxDoc >= 0);
+            Debug.Assert(@in.NumDocs <= @in.MaxDoc);
+            Debug.Assert(@in.NumDeletedDocs + @in.NumDocs == @in.MaxDoc);
+            Debug.Assert(!@in.HasDeletions || @in.NumDeletedDocs > 0 && @in.NumDocs < @in.MaxDoc);
         }
 
-        public override Fields Fields()
+        public override Fields Fields
         {
-            Fields fields = base.Fields();
-            return fields == null ? null : new AssertingFields(fields);
+            get
+            {
+                Fields fields = base.Fields;
+                return fields == null ? null : new AssertingFields(fields);
+            }
         }
 
         public override Fields GetTermVectors(int docID)
@@ -622,7 +625,7 @@ namespace Lucene.Net.Index
             {
                 Debug.Assert(fi != null);
                 Debug.Assert(fi.DocValuesType == FieldInfo.DocValuesType_e.NUMERIC);
-                return new AssertingNumericDocValues(dv, MaxDoc());
+                return new AssertingNumericDocValues(dv, MaxDoc);
             }
             else
             {
@@ -639,7 +642,7 @@ namespace Lucene.Net.Index
             {
                 Debug.Assert(fi != null);
                 Debug.Assert(fi.DocValuesType == FieldInfo.DocValuesType_e.BINARY);
-                return new AssertingBinaryDocValues(dv, MaxDoc());
+                return new AssertingBinaryDocValues(dv, MaxDoc);
             }
             else
             {
@@ -656,7 +659,7 @@ namespace Lucene.Net.Index
             {
                 Debug.Assert(fi != null);
                 Debug.Assert(fi.DocValuesType == FieldInfo.DocValuesType_e.SORTED);
-                return new AssertingSortedDocValues(dv, MaxDoc());
+                return new AssertingSortedDocValues(dv, MaxDoc);
             }
             else
             {
@@ -673,7 +676,7 @@ namespace Lucene.Net.Index
             {
                 Debug.Assert(fi != null);
                 Debug.Assert(fi.DocValuesType == FieldInfo.DocValuesType_e.SORTED_SET);
-                return new AssertingSortedSetDocValues(dv, MaxDoc());
+                return new AssertingSortedSetDocValues(dv, MaxDoc);
             }
             else
             {
@@ -690,7 +693,7 @@ namespace Lucene.Net.Index
             {
                 Debug.Assert(fi != null);
                 Debug.Assert(fi.HasNorms());
-                return new AssertingNumericDocValues(dv, MaxDoc());
+                return new AssertingNumericDocValues(dv, MaxDoc);
             }
             else
             {
@@ -729,13 +732,13 @@ namespace Lucene.Net.Index
                 Bits liveDocs = base.LiveDocs;
                 if (liveDocs != null)
                 {
-                    Debug.Assert(MaxDoc() == liveDocs.Length());
+                    Debug.Assert(MaxDoc == liveDocs.Length());
                     liveDocs = new AssertingBits(liveDocs);
                 }
                 else
                 {
-                    Debug.Assert(MaxDoc() == NumDocs());
-                    Debug.Assert(!HasDeletions());
+                    Debug.Assert(MaxDoc == NumDocs);
+                    Debug.Assert(!HasDeletions);
                 }
                 return liveDocs;
             }
@@ -749,7 +752,7 @@ namespace Lucene.Net.Index
             {
                 Debug.Assert(fi != null);
                 Debug.Assert(fi.HasDocValues());
-                Debug.Assert(MaxDoc() == docsWithField.Length());
+                Debug.Assert(MaxDoc == docsWithField.Length());
                 docsWithField = new AssertingBits(docsWithField);
             }
             else

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
index 3c6c02d..bf74ea8 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs
@@ -110,8 +110,8 @@ namespace Lucene.Net.Index
             {
                 Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
                 Assert.AreEqual(text, hitDoc.Get("fieldname"));
-                Debug.Assert(ireader.Leaves().Count == 1);
-                NumericDocValues dv = ((AtomicReader)((AtomicReader)((AtomicReader)ireader.Leaves()[0].Reader()))).GetNumericDocValues("dv");
+                Debug.Assert(ireader.Leaves.Count == 1);
+                NumericDocValues dv = ((AtomicReader)((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader))).GetNumericDocValues("dv");
                 Assert.AreEqual(5, dv.Get(hits.ScoreDocs[i].Doc));
             }
 
@@ -145,8 +145,8 @@ namespace Lucene.Net.Index
             {
                 Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
                 Assert.AreEqual(text, hitDoc.Get("fieldname"));
-                Debug.Assert(ireader.Leaves().Count == 1);
-                NumericDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves()[0].Reader())).GetNumericDocValues("dv");
+                Debug.Assert(ireader.Leaves.Count == 1);
+                NumericDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetNumericDocValues("dv");
                 Assert.AreEqual(Number.FloatToIntBits(5.7f), dv.Get(hits.ScoreDocs[i].Doc));
             }
 
@@ -181,10 +181,10 @@ namespace Lucene.Net.Index
             {
                 Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
                 Assert.AreEqual(text, hitDoc.Get("fieldname"));
-                Debug.Assert(ireader.Leaves().Count == 1);
-                NumericDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves()[0].Reader())).GetNumericDocValues("dv1");
+                Debug.Assert(ireader.Leaves.Count == 1);
+                NumericDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetNumericDocValues("dv1");
                 Assert.AreEqual(5, dv.Get(hits.ScoreDocs[i].Doc));
-                dv = ((AtomicReader)((AtomicReader)ireader.Leaves()[0].Reader())).GetNumericDocValues("dv2");
+                dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetNumericDocValues("dv2");
                 Assert.AreEqual(17, dv.Get(hits.ScoreDocs[i].Doc));
             }
 
@@ -219,12 +219,12 @@ namespace Lucene.Net.Index
             {
                 Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
                 Assert.AreEqual(text, hitDoc.Get("fieldname"));
-                Debug.Assert(ireader.Leaves().Count == 1);
-                BinaryDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves()[0].Reader())).GetBinaryDocValues("dv1");
+                Debug.Assert(ireader.Leaves.Count == 1);
+                BinaryDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetBinaryDocValues("dv1");
                 BytesRef scratch = new BytesRef();
                 dv.Get(hits.ScoreDocs[i].Doc, scratch);
                 Assert.AreEqual(new BytesRef(longTerm), scratch);
-                dv = ((AtomicReader)((AtomicReader)ireader.Leaves()[0].Reader())).GetBinaryDocValues("dv2");
+                dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetBinaryDocValues("dv2");
                 dv.Get(hits.ScoreDocs[i].Doc, scratch);
                 Assert.AreEqual(new BytesRef(text), scratch);
             }
@@ -261,10 +261,10 @@ namespace Lucene.Net.Index
             {
                 Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
                 Assert.AreEqual(text, hitDoc.Get("fieldname"));
-                Debug.Assert(ireader.Leaves().Count == 1);
-                NumericDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves()[0].Reader())).GetNumericDocValues("dv1");
+                Debug.Assert(ireader.Leaves.Count == 1);
+                NumericDocValues dv = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetNumericDocValues("dv1");
                 Assert.AreEqual(5, dv.Get(hits.ScoreDocs[i].Doc));
-                BinaryDocValues dv2 = ((AtomicReader)((AtomicReader)ireader.Leaves()[0].Reader())).GetBinaryDocValues("dv2");
+                BinaryDocValues dv2 = ((AtomicReader)((AtomicReader)ireader.Leaves[0].Reader)).GetBinaryDocValues("dv2");
                 dv2.Get(hits.ScoreDocs[i].Doc, scratch);
                 Assert.AreEqual(new BytesRef("hello world"), scratch);
             }
@@ -302,14 +302,14 @@ namespace Lucene.Net.Index
             {
                 Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
                 Assert.AreEqual(text, hitDoc.Get("fieldname"));
-                Debug.Assert(ireader.Leaves().Count == 1);
-                SortedDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv1");
+                Debug.Assert(ireader.Leaves.Count == 1);
+                SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv1");
                 int ord = dv.GetOrd(0);
                 dv.LookupOrd(ord, scratch);
                 Assert.AreEqual(new BytesRef("hello hello"), scratch);
-                NumericDocValues dv2 = ((AtomicReader)ireader.Leaves()[0].Reader()).GetNumericDocValues("dv2");
+                NumericDocValues dv2 = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv2");
                 Assert.AreEqual(5, dv2.Get(hits.ScoreDocs[i].Doc));
-                BinaryDocValues dv3 = ((AtomicReader)ireader.Leaves()[0].Reader()).GetBinaryDocValues("dv3");
+                BinaryDocValues dv3 = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv3");
                 dv3.Get(hits.ScoreDocs[i].Doc, scratch);
                 Assert.AreEqual(new BytesRef("hello world"), scratch);
             }
@@ -347,14 +347,14 @@ namespace Lucene.Net.Index
             {
                 Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
                 Assert.AreEqual(text, hitDoc.Get("fieldname"));
-                Debug.Assert(ireader.Leaves().Count == 1);
-                SortedDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv2");
+                Debug.Assert(ireader.Leaves.Count == 1);
+                SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv2");
                 int ord = dv.GetOrd(0);
                 dv.LookupOrd(ord, scratch);
                 Assert.AreEqual(new BytesRef("hello hello"), scratch);
-                NumericDocValues dv2 = ((AtomicReader)ireader.Leaves()[0].Reader()).GetNumericDocValues("dv3");
+                NumericDocValues dv2 = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv3");
                 Assert.AreEqual(5, dv2.Get(hits.ScoreDocs[i].Doc));
-                BinaryDocValues dv3 = ((AtomicReader)ireader.Leaves()[0].Reader()).GetBinaryDocValues("dv1");
+                BinaryDocValues dv3 = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv1");
                 dv3.Get(hits.ScoreDocs[i].Doc, scratch);
                 Assert.AreEqual(new BytesRef("hello world"), scratch);
             }
@@ -383,8 +383,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            NumericDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetNumericDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            NumericDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv");
             Assert.AreEqual(1, dv.Get(0));
             Assert.AreEqual(2, dv.Get(1));
 
@@ -415,11 +415,11 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            NumericDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetNumericDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            NumericDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv");
             for (int i = 0; i < 2; i++)
             {
-                Document doc2 = ((AtomicReader)ireader.Leaves()[0].Reader()).Document(i);
+                Document doc2 = ((AtomicReader)ireader.Leaves[0].Reader).Document(i);
                 long expected;
                 if (doc2.Get("id").Equals("0"))
                 {
@@ -456,8 +456,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            NumericDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetNumericDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            NumericDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv");
             Assert.AreEqual(long.MinValue, dv.Get(0));
             Assert.AreEqual(long.MaxValue, dv.Get(1));
 
@@ -485,8 +485,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            NumericDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetNumericDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            NumericDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv");
             Assert.AreEqual(-8841491950446638677L, dv.Get(0));
             Assert.AreEqual(9062230939892376225L, dv.Get(1));
 
@@ -524,8 +524,8 @@ namespace Lucene.Net.Index
             {
                 Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
                 Assert.AreEqual(text, hitDoc.Get("fieldname"));
-                Debug.Assert(ireader.Leaves().Count == 1);
-                BinaryDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetBinaryDocValues("dv");
+                Debug.Assert(ireader.Leaves.Count == 1);
+                BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
                 dv.Get(hits.ScoreDocs[i].Doc, scratch);
                 Assert.AreEqual(new BytesRef("hello world"), scratch);
             }
@@ -557,12 +557,12 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            BinaryDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetBinaryDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
             BytesRef scratch = new BytesRef();
             for (int i = 0; i < 2; i++)
             {
-                Document doc2 = ((AtomicReader)ireader.Leaves()[0].Reader()).Document(i);
+                Document doc2 = ((AtomicReader)ireader.Leaves[0].Reader).Document(i);
                 string expected;
                 if (doc2.Get("id").Equals("0"))
                 {
@@ -610,8 +610,8 @@ namespace Lucene.Net.Index
             {
                 Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
                 Assert.AreEqual(text, hitDoc.Get("fieldname"));
-                Debug.Assert(ireader.Leaves().Count == 1);
-                SortedDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv");
+                Debug.Assert(ireader.Leaves.Count == 1);
+                SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
                 dv.LookupOrd(dv.GetOrd(hits.ScoreDocs[i].Doc), scratch);
                 Assert.AreEqual(new BytesRef("hello world"), scratch);
             }
@@ -640,8 +640,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            SortedDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
             BytesRef scratch = new BytesRef();
             dv.LookupOrd(dv.GetOrd(0), scratch);
             Assert.AreEqual("hello world 1", scratch.Utf8ToString());
@@ -675,8 +675,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            SortedDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
             Assert.AreEqual(2, dv.ValueCount);
             BytesRef scratch = new BytesRef();
             Assert.AreEqual(0, dv.GetOrd(0));
@@ -714,8 +714,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            SortedDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
             Assert.AreEqual(2, dv.ValueCount); // 2 ords
             BytesRef scratch = new BytesRef();
             dv.LookupOrd(0, scratch);
@@ -724,7 +724,7 @@ namespace Lucene.Net.Index
             Assert.AreEqual(new BytesRef("hello world 2"), scratch);
             for (int i = 0; i < 2; i++)
             {
-                Document doc2 = ((AtomicReader)ireader.Leaves()[0].Reader()).Document(i);
+                Document doc2 = ((AtomicReader)ireader.Leaves[0].Reader).Document(i);
                 string expected;
                 if (doc2.Get("id").Equals("0"))
                 {
@@ -800,8 +800,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            BinaryDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetBinaryDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
             BytesRef scratch = new BytesRef();
             dv.Get(0, scratch);
             Assert.AreEqual(new BytesRef("hello\nworld\r1"), scratch);
@@ -828,8 +828,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            SortedDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
             BytesRef scratch = new BytesRef();
             dv.LookupOrd(dv.GetOrd(0), scratch);
             Assert.AreEqual(new BytesRef("hello world 2"), scratch);
@@ -936,8 +936,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            SortedDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            SortedDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
             BytesRef scratch = new BytesRef();
             Assert.AreEqual(0, dv.GetOrd(0));
             Assert.AreEqual(0, dv.GetOrd(1));
@@ -968,8 +968,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            BinaryDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetBinaryDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
             BytesRef scratch = new BytesRef();
             dv.Get(0, scratch);
             Assert.AreEqual("", scratch.Utf8ToString());
@@ -999,8 +999,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            BinaryDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetBinaryDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
             BytesRef scratch = new BytesRef();
             dv.Get(0, scratch);
             Assert.AreEqual(new BytesRef(bytes), scratch);
@@ -1028,8 +1028,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            BinaryDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
             BytesRef scratch = new BytesRef();
             dv.Get(0, scratch);
             Assert.AreEqual(new BytesRef(bytes), scratch);
@@ -1053,8 +1053,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            BinaryDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetBinaryDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
             sbyte[] mybytes = new sbyte[20];
             BytesRef scratch = new BytesRef(mybytes);
             dv.Get(0, scratch);
@@ -1081,8 +1081,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            BinaryDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
             sbyte[] mybytes = new sbyte[20];
             BytesRef scratch = new BytesRef(mybytes);
             dv.Get(0, scratch);
@@ -1112,8 +1112,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            BinaryDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetBinaryDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv");
             BytesRef scratch = new BytesRef();
             dv.Get(0, scratch);
             Assert.AreEqual("foo!", scratch.Utf8ToString());
@@ -1147,8 +1147,8 @@ namespace Lucene.Net.Index
 
             // Now search the index:
             IndexReader ireader = DirectoryReader.Open(directory); // read-only=true
-            Debug.Assert(ireader.Leaves().Count == 1);
-            BinaryDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetSortedDocValues("dv");
+            Debug.Assert(ireader.Leaves.Count == 1);
+            BinaryDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetSortedDocValues("dv");
             BytesRef scratch = new BytesRef();
             dv.Get(0, scratch);
             Assert.AreEqual("foo!", scratch.Utf8ToString());
@@ -1187,7 +1187,7 @@ namespace Lucene.Net.Index
             writer.Dispose();
 
             DirectoryReader reader = DirectoryReader.Open(dir, 1);
-            Assert.AreEqual(1, reader.Leaves().Count);
+            Assert.AreEqual(1, reader.Leaves.Count);
 
             IndexSearcher searcher = new IndexSearcher(reader);
 
@@ -1386,11 +1386,11 @@ namespace Lucene.Net.Index
 
             // compare
             DirectoryReader ir = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext context in ir.Leaves())
+            foreach (AtomicReaderContext context in ir.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 NumericDocValues docValues = r.GetNumericDocValues("dv");
-                for (int i = 0; i < r.MaxDoc(); i++)
+                for (int i = 0; i < r.MaxDoc; i++)
                 {
                     long storedValue = Convert.ToInt64(r.Document(i).Get("stored"));
                     Assert.AreEqual(storedValue, docValues.Get(i));
@@ -1477,9 +1477,9 @@ namespace Lucene.Net.Index
 
             // compare
             DirectoryReader ir = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext context in ir.Leaves())
+            foreach (AtomicReaderContext context in ir.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 Bits expected = FieldCache_Fields.DEFAULT.GetDocsWithField(r, "indexed");
                 Bits actual = FieldCache_Fields.DEFAULT.GetDocsWithField(r, "dv");
                 Assert.AreEqual(expected, actual);
@@ -1627,11 +1627,11 @@ namespace Lucene.Net.Index
 
             // compare
             DirectoryReader ir = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext context in ir.Leaves())
+            foreach (AtomicReaderContext context in ir.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 BinaryDocValues docValues = r.GetBinaryDocValues("dv");
-                for (int i = 0; i < r.MaxDoc(); i++)
+                for (int i = 0; i < r.MaxDoc; i++)
                 {
                     BytesRef binaryValue = r.Document(i).GetBinaryValue("stored");
                     BytesRef scratch = new BytesRef();
@@ -1713,11 +1713,11 @@ namespace Lucene.Net.Index
 
             // compare
             DirectoryReader ir = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext context in ir.Leaves())
+            foreach (AtomicReaderContext context in ir.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 BinaryDocValues docValues = r.GetSortedDocValues("dv");
-                for (int i = 0; i < r.MaxDoc(); i++)
+                for (int i = 0; i < r.MaxDoc; i++)
                 {
                     BytesRef binaryValue = r.Document(i).GetBinaryValue("stored");
                     BytesRef scratch = new BytesRef();
@@ -1777,12 +1777,12 @@ namespace Lucene.Net.Index
 
             // compare
             DirectoryReader ir = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext context in ir.Leaves())
+            foreach (AtomicReaderContext context in ir.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 SortedDocValues expected = FieldCache_Fields.DEFAULT.GetTermsIndex(r, "indexed");
                 SortedDocValues actual = r.GetSortedDocValues("dv");
-                AssertEquals(r.MaxDoc(), expected, actual);
+                AssertEquals(r.MaxDoc, expected, actual);
             }
             ir.Dispose();
             dir.Dispose();
@@ -2364,12 +2364,12 @@ namespace Lucene.Net.Index
 
             // compare
             DirectoryReader ir = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext context in ir.Leaves())
+            foreach (AtomicReaderContext context in ir.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 SortedSetDocValues docValues = r.GetSortedSetDocValues("dv");
                 BytesRef scratch = new BytesRef();
-                for (int i = 0; i < r.MaxDoc(); i++)
+                for (int i = 0; i < r.MaxDoc; i++)
                 {
                     string[] stringValues = r.Document(i).GetValues("stored");
                     if (docValues != null)
@@ -2625,12 +2625,12 @@ namespace Lucene.Net.Index
 
             // compare per-segment
             DirectoryReader ir = writer.Reader;
-            foreach (AtomicReaderContext context in ir.Leaves())
+            foreach (AtomicReaderContext context in ir.Leaves)
             {
-                AtomicReader r = (AtomicReader)context.Reader();
+                AtomicReader r = context.AtomicReader;
                 SortedSetDocValues expected = FieldCache_Fields.DEFAULT.GetDocTermOrds(r, "indexed");
                 SortedSetDocValues actual = r.GetSortedSetDocValues("dv");
-                AssertEquals(r.MaxDoc(), expected, actual);
+                AssertEquals(r.MaxDoc, expected, actual);
             }
             ir.Dispose();
 
@@ -2641,7 +2641,7 @@ namespace Lucene.Net.Index
             AtomicReader ar = GetOnlySegmentReader(ir);
             SortedSetDocValues expected_ = FieldCache_Fields.DEFAULT.GetDocTermOrds(ar, "indexed");
             SortedSetDocValues actual_ = ar.GetSortedSetDocValues("dv");
-            AssertEquals(ir.MaxDoc(), expected_, actual_);
+            AssertEquals(ir.MaxDoc, expected_, actual_);
             ir.Dispose();
 
             writer.Dispose();
@@ -2755,8 +2755,8 @@ namespace Lucene.Net.Index
             iw.Dispose();
 
             IndexReader ir = DirectoryReader.Open(directory);
-            Assert.AreEqual(1, ir.Leaves().Count);
-            AtomicReader ar = (AtomicReader)ir.Leaves()[0].Reader();
+            Assert.AreEqual(1, ir.Leaves.Count);
+            AtomicReader ar = (AtomicReader)ir.Leaves[0].Reader;
             NumericDocValues dv = ar.GetNumericDocValues("dv1");
             Assert.AreEqual(0, dv.Get(0));
             Assert.AreEqual(0, dv.Get(1));
@@ -2787,8 +2787,8 @@ namespace Lucene.Net.Index
             iw.Dispose();
 
             IndexReader ir = DirectoryReader.Open(directory);
-            Assert.AreEqual(1, ir.Leaves().Count);
-            AtomicReader ar = (AtomicReader)ir.Leaves()[0].Reader();
+            Assert.AreEqual(1, ir.Leaves.Count);
+            AtomicReader ar = (AtomicReader)ir.Leaves[0].Reader;
             NumericDocValues dv = ar.GetNumericDocValues("dv1");
             Assert.AreEqual(0, dv.Get(0));
             Assert.AreEqual(0, dv.Get(1));
@@ -2823,8 +2823,8 @@ namespace Lucene.Net.Index
             iw.Dispose();
 
             IndexReader ir = DirectoryReader.Open(directory);
-            Assert.AreEqual(1, ir.Leaves().Count);
-            AtomicReader ar = (AtomicReader)ir.Leaves()[0].Reader();
+            Assert.AreEqual(1, ir.Leaves.Count);
+            AtomicReader ar = (AtomicReader)ir.Leaves[0].Reader;
             NumericDocValues dv = ar.GetNumericDocValues("dv1");
             Assert.AreEqual(0, dv.Get(0));
             Assert.AreEqual(0, dv.Get(1));
@@ -2856,8 +2856,8 @@ namespace Lucene.Net.Index
             iw.Dispose();
 
             IndexReader ir = DirectoryReader.Open(directory);
-            Assert.AreEqual(1, ir.Leaves().Count);
-            AtomicReader ar = (AtomicReader)ir.Leaves()[0].Reader();
+            Assert.AreEqual(1, ir.Leaves.Count);
+            AtomicReader ar = (AtomicReader)ir.Leaves[0].Reader;
             BinaryDocValues dv = ar.GetBinaryDocValues("dv1");
             BytesRef @ref = new BytesRef();
             dv.Get(0, @ref);
@@ -2891,8 +2891,8 @@ namespace Lucene.Net.Index
             iw.Dispose();
 
             IndexReader ir = DirectoryReader.Open(directory);
-            Assert.AreEqual(1, ir.Leaves().Count);
-            AtomicReader ar = (AtomicReader)ir.Leaves()[0].Reader();
+            Assert.AreEqual(1, ir.Leaves.Count);
+            AtomicReader ar = (AtomicReader)ir.Leaves[0].Reader;
             BinaryDocValues dv = ar.GetBinaryDocValues("dv1");
             BytesRef @ref = new BytesRef();
             dv.Get(0, @ref);
@@ -2930,8 +2930,8 @@ namespace Lucene.Net.Index
             iw.Dispose();
 
             IndexReader ir = DirectoryReader.Open(directory);
-            Assert.AreEqual(1, ir.Leaves().Count);
-            AtomicReader ar = (AtomicReader)ir.Leaves()[0].Reader();
+            Assert.AreEqual(1, ir.Leaves.Count);
+            AtomicReader ar = (AtomicReader)ir.Leaves[0].Reader;
             BinaryDocValues dv = ar.GetBinaryDocValues("dv1");
             BytesRef @ref = new BytesRef();
             dv.Get(0, @ref);
@@ -3244,13 +3244,13 @@ namespace Lucene.Net.Index
                 try
                 {
                     StartingGun.@await();
-                    foreach (AtomicReaderContext context in Ir.Leaves())
+                    foreach (AtomicReaderContext context in Ir.Leaves)
                     {
-                        AtomicReader r = (AtomicReader)context.Reader();
+                        AtomicReader r = context.AtomicReader;
                         BinaryDocValues binaries = r.GetBinaryDocValues("dvBin");
                         SortedDocValues sorted = r.GetSortedDocValues("dvSorted");
                         NumericDocValues numerics = r.GetNumericDocValues("dvNum");
-                        for (int j = 0; j < r.MaxDoc(); j++)
+                        for (int j = 0; j < r.MaxDoc; j++)
                         {
                             BytesRef binaryValue = r.Document(j).GetBinaryValue("storedBin");
                             BytesRef scratch = new BytesRef();
@@ -3382,9 +3382,9 @@ namespace Lucene.Net.Index
                 try
                 {
                     StartingGun.@await();
-                    foreach (AtomicReaderContext context in Ir.Leaves())
+                    foreach (AtomicReaderContext context in Ir.Leaves)
                     {
-                        AtomicReader r = (AtomicReader)context.Reader();
+                        AtomicReader r = context.AtomicReader;
                         BinaryDocValues binaries = r.GetBinaryDocValues("dvBin");
                         Bits binaryBits = r.GetDocsWithField("dvBin");
                         SortedDocValues sorted = r.GetSortedDocValues("dvSorted");
@@ -3393,7 +3393,7 @@ namespace Lucene.Net.Index
                         Bits numericBits = r.GetDocsWithField("dvNum");
                         SortedSetDocValues sortedSet = r.GetSortedSetDocValues("dvSortedSet");
                         Bits sortedSetBits = r.GetDocsWithField("dvSortedSet");
-                        for (int j = 0; j < r.MaxDoc(); j++)
+                        for (int j = 0; j < r.MaxDoc; j++)
                         {
                             BytesRef binaryValue = r.Document(j).GetBinaryValue("storedBin");
                             if (binaryValue != null)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
index 1e0d93a..d9dc84a 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseStoredFieldsFormatTestCase.cs
@@ -325,13 +325,13 @@ namespace Lucene.Net.Index
             DirectoryReader r = w.Reader;
             w.Dispose();
 
-            Assert.AreEqual(numDocs, r.NumDocs());
+            Assert.AreEqual(numDocs, r.NumDocs);
 
-            foreach (AtomicReaderContext ctx in r.Leaves())
+            foreach (AtomicReaderContext ctx in r.Leaves)
             {
-                AtomicReader sub = (AtomicReader)ctx.Reader();
+                AtomicReader sub = (AtomicReader)ctx.Reader;
                 FieldCache_Fields.Ints ids = FieldCache_Fields.DEFAULT.GetInts(sub, "id", false);
-                for (int docID = 0; docID < sub.NumDocs(); docID++)
+                for (int docID = 0; docID < sub.NumDocs; docID++)
                 {
                     Document doc = sub.Document(docID);
                     Field f = (Field)doc.GetField("nf");
@@ -639,9 +639,9 @@ namespace Lucene.Net.Index
             iw.Commit();
 
             DirectoryReader ir = DirectoryReader.Open(dir);
-            Assert.IsTrue(ir.NumDocs() > 0);
+            Assert.IsTrue(ir.NumDocs > 0);
             int numDocs = 0;
-            for (int i = 0; i < ir.MaxDoc(); ++i)
+            for (int i = 0; i < ir.MaxDoc; ++i)
             {
                 Document doc = ir.Document(i);
                 if (doc == null)
@@ -659,7 +659,7 @@ namespace Lucene.Net.Index
                     Assert.AreEqual(arr, arr2);
                 }
             }
-            Assert.IsTrue(ir.NumDocs() <= numDocs);
+            Assert.IsTrue(ir.NumDocs <= numDocs);
             ir.Dispose();
 
             iw.DeleteAll();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
index 312e16c..49185e6 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
@@ -479,7 +479,7 @@ namespace Lucene.Net.Index
         {
             // compare field names
             Assert.AreEqual(doc == null, fields == null);
-            Assert.AreEqual(doc.FieldNames.Length, fields.Size());
+            Assert.AreEqual(doc.FieldNames.Length, fields.Size);
             HashSet<string> fields1 = new HashSet<string>();
             HashSet<string> fields2 = new HashSet<string>();
             for (int i = 0; i < doc.FieldNames.Length; ++i)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Index/FieldFilterAtomicReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/FieldFilterAtomicReader.cs b/src/Lucene.Net.TestFramework/Index/FieldFilterAtomicReader.cs
index 7955939..9965297 100644
--- a/src/Lucene.Net.TestFramework/Index/FieldFilterAtomicReader.cs
+++ b/src/Lucene.Net.TestFramework/Index/FieldFilterAtomicReader.cs
@@ -130,10 +130,13 @@ namespace Lucene.Net.Index
             }
         }
 
-        public override Fields Fields()
+        public override Fields Fields
         {
-            Fields f = base.Fields();
-            return (f == null) ? null : new FieldFilterFields(this, f);
+            get
+            {
+                Fields f = base.Fields;
+                return (f == null) ? null : new FieldFilterFields(this, f);
+            }
         }
 
         public override NumericDocValues GetNumericDocValues(string field)
@@ -182,10 +185,13 @@ namespace Lucene.Net.Index
                 this.OuterInstance = outerInstance;
             }
 
-            public override int Size()
+            public override int Size
             {
-                // this information is not cheap, return -1 like MultiFields does:
-                return -1;
+                get
+                {
+                    // this information is not cheap, return -1 like MultiFields does:
+                    return -1;
+                }
             }
 
             public override IEnumerator<string> GetEnumerator()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Index/RandomIndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/RandomIndexWriter.cs b/src/Lucene.Net.TestFramework/Index/RandomIndexWriter.cs
index b8ed542..b3f3e40 100644
--- a/src/Lucene.Net.TestFramework/Index/RandomIndexWriter.cs
+++ b/src/Lucene.Net.TestFramework/Index/RandomIndexWriter.cs
@@ -372,7 +372,7 @@ namespace Lucene.Net.Index
 
         public virtual int MaxDoc()
         {
-            return w.MaxDoc();
+            return w.MaxDoc;
         }
 
         public virtual void DeleteAll()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
index 824ca0e..f72b8f8 100644
--- a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs
@@ -449,9 +449,9 @@ namespace Lucene.Net.Index
                             // Verify 1) IW is correctly setting
                             // diagnostics, and 2) segment warming for
                             // merged segments is actually happening:
-                            foreach (AtomicReaderContext sub in s.IndexReader.Leaves())
+                            foreach (AtomicReaderContext sub in s.IndexReader.Leaves)
                             {
-                                SegmentReader segReader = (SegmentReader)sub.Reader();
+                                SegmentReader segReader = (SegmentReader)sub.Reader;
                                 IDictionary<string, string> diagnostics = segReader.SegmentInfo.Info.Diagnostics;
                                 Assert.IsNotNull(diagnostics);
                                 string source = diagnostics["source"];
@@ -461,7 +461,7 @@ namespace Lucene.Net.Index
                                     Assert.IsTrue(!OuterInstance.AssertMergedSegmentsWarmed || OuterInstance.Warmed.ContainsKey((SegmentCoreReaders)segReader.CoreCacheKey), "sub reader " + sub + " wasn't warmed: warmed=" + OuterInstance.Warmed + " diagnostics=" + diagnostics + " si=" + segReader.SegmentInfo);
                                 }
                             }
-                            if (s.IndexReader.NumDocs() > 0)
+                            if (s.IndexReader.NumDocs > 0)
                             {
                                 OuterInstance.SmokeTestSearcher(s);
                                 Fields fields = MultiFields.GetFields(s.IndexReader);
@@ -742,7 +742,7 @@ namespace Lucene.Net.Index
             }
             Assert.IsFalse(doFail);
 
-            Assert.AreEqual(AddCount.Get() - DelCount.Get(), s.IndexReader.NumDocs(), "index=" + Writer.SegString() + " addCount=" + AddCount + " delCount=" + DelCount);
+            Assert.AreEqual(AddCount.Get() - DelCount.Get(), s.IndexReader.NumDocs, "index=" + Writer.SegString() + " addCount=" + AddCount + " delCount=" + DelCount);
             ReleaseSearcher(s);
 
             Writer.Commit();
@@ -787,7 +787,7 @@ namespace Lucene.Net.Index
                     Console.WriteLine("TEST: now warm merged reader=" + reader);
                 }
                 OuterInstance.Warmed[(SegmentCoreReaders)reader.CoreCacheKey] = true;
-                int maxDoc = reader.MaxDoc();
+                int maxDoc = reader.MaxDoc;
                 Bits liveDocs = reader.LiveDocs;
                 int sum = 0;
                 int inc = Math.Max(1, maxDoc / 50);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Search/CheckHits.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/CheckHits.cs b/src/Lucene.Net.TestFramework/Search/CheckHits.cs
index 4e88bd2..d2d3f54 100644
--- a/src/Lucene.Net.TestFramework/Search/CheckHits.cs
+++ b/src/Lucene.Net.TestFramework/Search/CheckHits.cs
@@ -64,7 +64,7 @@ namespace Lucene.Net.Search
                 ignore.Add(Convert.ToInt32(results[i]));
             }
 
-            int maxDoc = searcher.IndexReader.MaxDoc();
+            int maxDoc = searcher.IndexReader.MaxDoc;
             for (int doc = 0; doc < maxDoc; doc++)
             {
                 if (ignore.Contains(Convert.ToInt32(doc)))

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
index d6cc5c5..1604347 100644
--- a/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
+++ b/src/Lucene.Net.TestFramework/Search/QueryUtils.cs
@@ -253,7 +253,7 @@ namespace Lucene.Net.Search
         public static void CheckSkipTo(Query q, IndexSearcher s)
         {
             //System.out.println("Checking "+q);
-            IList<AtomicReaderContext> readerContextArray = s.TopReaderContext.Leaves();
+            IList<AtomicReaderContext> readerContextArray = s.TopReaderContext.Leaves;
             if (s.CreateNormalizedWeight(q).ScoresDocsOutOfOrder()) // in this case order of skipTo() might differ from that of next().
             {
                 return;
@@ -287,7 +287,7 @@ namespace Lucene.Net.Search
                     indexSearcher.Similarity = s.Similarity;
                     Weight w = indexSearcher.CreateNormalizedWeight(q);
                     AtomicReaderContext ctx = (AtomicReaderContext)previousReader.Context;
-                    Scorer scorer = w.Scorer(ctx, ((AtomicReader)ctx.Reader()).LiveDocs);
+                    Scorer scorer = w.Scorer(ctx, ((AtomicReader)ctx.Reader).LiveDocs);
                     if (scorer != null)
                     {
                         bool more = scorer.Advance(lastDoc[0] + 1) != DocIdSetIterator.NO_MORE_DOCS;
@@ -344,7 +344,7 @@ namespace Lucene.Net.Search
                     {
                         Weight w = s.CreateNormalizedWeight(q);
                         AtomicReaderContext context = ReaderContextArray[leafPtr];
-                        scorer = w.Scorer(context, ((AtomicReader)context.Reader()).LiveDocs);
+                        scorer = w.Scorer(context, (context.AtomicReader).LiveDocs);
                     }
 
                     int op = Order[(Opidx[0]++) % Order.Length];
@@ -385,7 +385,7 @@ namespace Lucene.Net.Search
                         indexSearcher.Similarity = s.Similarity;
                         Weight w = indexSearcher.CreateNormalizedWeight(q);
                         AtomicReaderContext ctx = (AtomicReaderContext)indexSearcher.TopReaderContext;
-                        Scorer scorer = w.Scorer(ctx, ((AtomicReader)ctx.Reader()).LiveDocs);
+                        Scorer scorer = w.Scorer(ctx, ((AtomicReader)ctx.Reader).LiveDocs);
                         if (scorer != null)
                         {
                             bool more = scorer.Advance(LastDoc[0] + 1) != DocIdSetIterator.NO_MORE_DOCS;
@@ -393,8 +393,8 @@ namespace Lucene.Net.Search
                         }
                         leafPtr++;
                     }
-                    LastReader[0] = (AtomicReader)value.Reader();
-                    Debug.Assert(ReaderContextArray[leafPtr].Reader() == value.Reader());
+                    LastReader[0] = (AtomicReader)value.Reader;
+                    Debug.Assert(ReaderContextArray[leafPtr].Reader == value.Reader);
                     this.scorer = null;
                     LastDoc[0] = -1;
                 }
@@ -414,7 +414,7 @@ namespace Lucene.Net.Search
             const float maxDiff = 1e-3f;
             int[] lastDoc = new int[] { -1 };
             AtomicReader[] lastReader = new AtomicReader[] { null };
-            IList<AtomicReaderContext> context = s.TopReaderContext.Leaves();
+            IList<AtomicReaderContext> context = s.TopReaderContext.Leaves;
             s.Search(q, new CollectorAnonymousInnerClassHelper2(q, s, maxDiff, lastDoc, lastReader, context));
 
             if (lastReader[0] != null)
@@ -517,9 +517,9 @@ namespace Lucene.Net.Search
                         leafPtr++;
                     }
 
-                    LastReader[0] = (AtomicReader)value.Reader();
+                    LastReader[0] = (AtomicReader)value.Reader;
                     LastDoc[0] = -1;
-                    liveDocs = ((AtomicReader)value.Reader()).LiveDocs;
+                    liveDocs = ((AtomicReader)value.Reader).LiveDocs;
                 }
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs b/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
index 6836113..04b21e2 100644
--- a/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
+++ b/src/Lucene.Net.TestFramework/Search/SearchEquivalenceTestBase.cs
@@ -199,8 +199,8 @@ namespace Lucene.Net.Search
             }
 
             // not efficient, but simple!
-            TopDocs td1 = S1.Search(q1, filter, Reader.MaxDoc());
-            TopDocs td2 = S2.Search(q2, filter, Reader.MaxDoc());
+            TopDocs td1 = S1.Search(q1, filter, Reader.MaxDoc);
+            TopDocs td2 = S2.Search(q2, filter, Reader.MaxDoc);
             Assert.IsTrue(td1.TotalHits <= td2.TotalHits);
 
             // fill the superset into a bitset

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs b/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
index f7f46d0..9297798 100644
--- a/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
+++ b/src/Lucene.Net.TestFramework/Search/ShardSearchingTestBase.cs
@@ -137,7 +137,7 @@ namespace Lucene.Net.Search
         {
             if (VERBOSE)
             {
-                Console.WriteLine("REOPEN: nodeID=" + nodeID + " version=" + version + " maxDoc=" + newSearcher.IndexReader.MaxDoc());
+                Console.WriteLine("REOPEN: nodeID=" + nodeID + " version=" + version + " maxDoc=" + newSearcher.IndexReader.MaxDoc);
             }
 
             // Broadcast new collection stats for this node to all
@@ -406,8 +406,8 @@ namespace Lucene.Net.Search
                             sumDocFreq = -1;
                         }
 
-                        Debug.Assert(nodeStats.MaxDoc() >= 0);
-                        maxDoc += nodeStats.MaxDoc();
+                        Debug.Assert(nodeStats.MaxDoc >= 0);
+                        maxDoc += nodeStats.MaxDoc;
                     }
 
                     return new CollectionStatistics(field, maxDoc, docCount, sumTotalTermFreq, sumDocFreq);
@@ -463,7 +463,7 @@ namespace Lucene.Net.Search
                                 // request to a remote shard won't have reader.MaxDoc at hand, so
                                 // it will send some arbitrary value which will be fixed on the
                                 // other end.
-                                shardAfter.Doc = s.IndexReader.MaxDoc() - 1;
+                                shardAfter.Doc = s.IndexReader.MaxDoc - 1;
                             }
                             finally
                             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
index e1d9674..b3a7199 100644
--- a/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
+++ b/src/Lucene.Net.TestFramework/Store/MockDirectoryWrapper.cs
@@ -1054,11 +1054,11 @@ namespace Lucene.Net.Store
                             }
 
                             DirectoryReader ir1 = DirectoryReader.Open(this);
-                            int numDocs1 = ir1.NumDocs();
+                            int numDocs1 = ir1.NumDocs;
                             ir1.Dispose();
                             (new IndexWriter(this, new IndexWriterConfig(LuceneTestCase.TEST_VERSION_CURRENT, null))).Dispose();
                             DirectoryReader ir2 = DirectoryReader.Open(this);
-                            int numDocs2 = ir2.NumDocs();
+                            int numDocs2 = ir2.NumDocs;
                             ir2.Dispose();
                             Debug.Assert(numDocs1 == numDocs2, "numDocs changed after opening/closing IW: before=" + numDocs1 + " after=" + numDocs2);
                         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
index b725e9b..700433a 100644
--- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs
@@ -705,12 +705,12 @@ namespace Lucene.Net.Util
         /// </summary>
         public static SegmentReader GetOnlySegmentReader(DirectoryReader reader)
         {
-            IList<AtomicReaderContext> subReaders = reader.Leaves();
+            IList<AtomicReaderContext> subReaders = reader.Leaves;
             if (subReaders.Count != 1)
             {
                 throw new System.ArgumentException(reader + " has " + subReaders.Count + " segments instead of exactly one");
             }
-            AtomicReader r = (AtomicReader)subReaders[0].Reader();
+            AtomicReader r = (AtomicReader)subReaders[0].Reader;
             Assert.IsTrue(r is SegmentReader);
             return (SegmentReader)r;
         }
@@ -1748,10 +1748,10 @@ namespace Lucene.Net.Util
         public void AssertReaderStatisticsEquals(string info, IndexReader leftReader, IndexReader rightReader)
         {
             // Somewhat redundant: we never delete docs
-            Assert.AreEqual(leftReader.MaxDoc(), rightReader.MaxDoc(), info);
-            Assert.AreEqual(leftReader.NumDocs(), rightReader.NumDocs(), info);
-            Assert.AreEqual(leftReader.NumDeletedDocs(), rightReader.NumDeletedDocs(), info);
-            Assert.AreEqual(leftReader.HasDeletions(), rightReader.HasDeletions(), info);
+            Assert.AreEqual(leftReader.MaxDoc, rightReader.MaxDoc, info);
+            Assert.AreEqual(leftReader.NumDocs, rightReader.NumDocs, info);
+            Assert.AreEqual(leftReader.NumDeletedDocs, rightReader.NumDeletedDocs, info);
+            Assert.AreEqual(leftReader.HasDeletions, rightReader.HasDeletions, info);
         }
 
         /// <summary>
@@ -1787,9 +1787,9 @@ namespace Lucene.Net.Util
         /// </summary>
         public void AssertFieldStatisticsEquals(string info, Fields leftFields, Fields rightFields)
         {
-            if (leftFields.Size() != -1 && rightFields.Size() != -1)
+            if (leftFields.Size != -1 && rightFields.Size != -1)
             {
-                Assert.AreEqual(leftFields.Size(), rightFields.Size(), info);
+                Assert.AreEqual(leftFields.Size, rightFields.Size, info);
             }
         }
 
@@ -1891,7 +1891,7 @@ namespace Lucene.Net.Util
         public void AssertTermsEnumEquals(string info, IndexReader leftReader, TermsEnum leftTermsEnum, TermsEnum rightTermsEnum, bool deep)
         {
             BytesRef term;
-            Bits randomBits = new RandomBits(leftReader.MaxDoc(), Random().NextDouble(), Random());
+            Bits randomBits = new RandomBits(leftReader.MaxDoc, Random().NextDouble(), Random());
             DocsAndPositionsEnum leftPositions = null;
             DocsAndPositionsEnum rightPositions = null;
             DocsEnum leftDocs = null;
@@ -1994,7 +1994,7 @@ namespace Lucene.Net.Util
                 return;
             }
             int docid = -1;
-            int averageGap = leftReader.MaxDoc() / (1 + docFreq);
+            int averageGap = leftReader.MaxDoc / (1 + docFreq);
             int skipInterval = 16;
 
             while (true)
@@ -2037,7 +2037,7 @@ namespace Lucene.Net.Util
             }
 
             int docid = -1;
-            int averageGap = leftReader.MaxDoc() / (1 + docFreq);
+            int averageGap = leftReader.MaxDoc / (1 + docFreq);
             int skipInterval = 16;
 
             while (true)
@@ -2203,7 +2203,7 @@ namespace Lucene.Net.Util
                 NumericDocValues rightNorms = MultiDocValues.GetNormValues(rightReader, field);
                 if (leftNorms != null && rightNorms != null)
                 {
-                    AssertDocValuesEquals(info, leftReader.MaxDoc(), leftNorms, rightNorms);
+                    AssertDocValuesEquals(info, leftReader.MaxDoc, leftNorms, rightNorms);
                 }
                 else
                 {
@@ -2218,8 +2218,8 @@ namespace Lucene.Net.Util
         /// </summary>
         public void AssertStoredFieldsEquals(string info, IndexReader leftReader, IndexReader rightReader)
         {
-            Debug.Assert(leftReader.MaxDoc() == rightReader.MaxDoc());
-            for (int i = 0; i < leftReader.MaxDoc(); i++)
+            Debug.Assert(leftReader.MaxDoc == rightReader.MaxDoc);
+            for (int i = 0; i < leftReader.MaxDoc; i++)
             {
                 Document leftDoc = leftReader.Document(i);
                 Document rightDoc = rightReader.Document(i);
@@ -2261,8 +2261,8 @@ namespace Lucene.Net.Util
         /// </summary>
         public void AssertTermVectorsEquals(string info, IndexReader leftReader, IndexReader rightReader)
         {
-            Debug.Assert(leftReader.MaxDoc() == rightReader.MaxDoc());
-            for (int i = 0; i < leftReader.MaxDoc(); i++)
+            Debug.Assert(leftReader.MaxDoc == rightReader.MaxDoc);
+            for (int i = 0; i < leftReader.MaxDoc; i++)
             {
                 Fields leftFields = leftReader.GetTermVectors(i);
                 Fields rightFields = rightReader.GetTermVectors(i);
@@ -2301,7 +2301,7 @@ namespace Lucene.Net.Util
                     NumericDocValues rightValues = MultiDocValues.GetNumericValues(rightReader, field);
                     if (leftValues != null && rightValues != null)
                     {
-                        AssertDocValuesEquals(info, leftReader.MaxDoc(), leftValues, rightValues);
+                        AssertDocValuesEquals(info, leftReader.MaxDoc, leftValues, rightValues);
                     }
                     else
                     {
@@ -2317,7 +2317,7 @@ namespace Lucene.Net.Util
                     {
                         BytesRef scratchLeft = new BytesRef();
                         BytesRef scratchRight = new BytesRef();
-                        for (int docID = 0; docID < leftReader.MaxDoc(); docID++)
+                        for (int docID = 0; docID < leftReader.MaxDoc; docID++)
                         {
                             leftValues.Get(docID, scratchLeft);
                             rightValues.Get(docID, scratchRight);
@@ -2348,7 +2348,7 @@ namespace Lucene.Net.Util
                             Assert.AreEqual(scratchLeft, scratchRight, info);
                         }
                         // bytes
-                        for (int docID = 0; docID < leftReader.MaxDoc(); docID++)
+                        for (int docID = 0; docID < leftReader.MaxDoc; docID++)
                         {
                             leftValues.Get(docID, scratchLeft);
                             rightValues.Get(docID, scratchRight);
@@ -2379,7 +2379,7 @@ namespace Lucene.Net.Util
                             Assert.AreEqual(scratchLeft, scratchRight, info);
                         }
                         // ord lists
-                        for (int docID = 0; docID < leftReader.MaxDoc(); docID++)
+                        for (int docID = 0; docID < leftReader.MaxDoc; docID++)
                         {
                             leftValues.Document = docID;
                             rightValues.Document = docID;
@@ -2431,7 +2431,7 @@ namespace Lucene.Net.Util
         // TODO: this is kinda stupid, we don't delete documents in the test.
         public void AssertDeletedDocsEquals(string info, IndexReader leftReader, IndexReader rightReader)
         {
-            Debug.Assert(leftReader.NumDeletedDocs() == rightReader.NumDeletedDocs());
+            Debug.Assert(leftReader.NumDeletedDocs == rightReader.NumDeletedDocs);
             Bits leftBits = MultiFields.GetLiveDocs(leftReader);
             Bits rightBits = MultiFields.GetLiveDocs(rightReader);
 
@@ -2442,9 +2442,9 @@ namespace Lucene.Net.Util
                 return;
             }
 
-            Debug.Assert(leftReader.MaxDoc() == rightReader.MaxDoc());
+            Debug.Assert(leftReader.MaxDoc == rightReader.MaxDoc);
             Assert.AreEqual(leftBits.Length(), rightBits.Length(), info);
-            for (int i = 0; i < leftReader.MaxDoc(); i++)
+            for (int i = 0; i < leftReader.MaxDoc; i++)
             {
                 Assert.AreEqual(leftBits.Get(i), rightBits.Get(i), info);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.TestFramework/Util/TestUtil.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Util/TestUtil.cs b/src/Lucene.Net.TestFramework/Util/TestUtil.cs
index 1b34c2a..2fa35f1 100644
--- a/src/Lucene.Net.TestFramework/Util/TestUtil.cs
+++ b/src/Lucene.Net.TestFramework/Util/TestUtil.cs
@@ -273,9 +273,9 @@ namespace Lucene.Net.Util
         /// </summary>
         public static void CheckReader(IndexReader reader)
         {
-            foreach (AtomicReaderContext context in reader.Leaves())
+            foreach (AtomicReaderContext context in reader.Leaves)
             {
-                CheckReader((AtomicReader)context.Reader(), true);
+                CheckReader(context.AtomicReader, true);
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Codecs/Lucene40/TestReuseDocsEnum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Codecs/Lucene40/TestReuseDocsEnum.cs b/src/Lucene.Net.Tests/core/Codecs/Lucene40/TestReuseDocsEnum.cs
index b942d5f..a2ecdf0 100644
--- a/src/Lucene.Net.Tests/core/Codecs/Lucene40/TestReuseDocsEnum.cs
+++ b/src/Lucene.Net.Tests/core/Codecs/Lucene40/TestReuseDocsEnum.cs
@@ -63,16 +63,16 @@ namespace Lucene.Net.Codecs.Lucene40
             writer.Commit();
 
             DirectoryReader open = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext ctx in open.Leaves())
+            foreach (AtomicReaderContext ctx in open.Leaves)
             {
-                AtomicReader indexReader = (AtomicReader)ctx.Reader();
+                AtomicReader indexReader = (AtomicReader)ctx.Reader;
                 Terms terms = indexReader.Terms("body");
                 TermsEnum iterator = terms.Iterator(null);
                 IdentityHashMap<DocsEnum, bool?> enums = new IdentityHashMap<DocsEnum, bool?>();
-                MatchNoBits bits = new MatchNoBits(indexReader.MaxDoc());
+                MatchNoBits bits = new MatchNoBits(indexReader.MaxDoc);
                 while ((iterator.Next()) != null)
                 {
-                    DocsEnum docs = iterator.Docs(Random().NextBoolean() ? bits : new MatchNoBits(indexReader.MaxDoc()), null, Random().NextBoolean() ? DocsEnum.FLAG_FREQS : DocsEnum.FLAG_NONE);
+                    DocsEnum docs = iterator.Docs(Random().NextBoolean() ? bits : new MatchNoBits(indexReader.MaxDoc), null, Random().NextBoolean() ? DocsEnum.FLAG_FREQS : DocsEnum.FLAG_NONE);
                     enums[docs] = true;
                 }
 
@@ -93,12 +93,12 @@ namespace Lucene.Net.Codecs.Lucene40
             writer.Commit();
 
             DirectoryReader open = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext ctx in open.Leaves())
+            foreach (AtomicReaderContext ctx in open.Leaves)
             {
-                Terms terms = ((AtomicReader)ctx.Reader()).Terms("body");
+                Terms terms = ((AtomicReader)ctx.Reader).Terms("body");
                 TermsEnum iterator = terms.Iterator(null);
                 IdentityHashMap<DocsEnum, bool?> enums = new IdentityHashMap<DocsEnum, bool?>();
-                MatchNoBits bits = new MatchNoBits(open.MaxDoc());
+                MatchNoBits bits = new MatchNoBits(open.MaxDoc);
                 DocsEnum docs = null;
                 while ((iterator.Next()) != null)
                 {
@@ -112,7 +112,7 @@ namespace Lucene.Net.Codecs.Lucene40
                 docs = null;
                 while ((iterator.Next()) != null)
                 {
-                    docs = iterator.Docs(new MatchNoBits(open.MaxDoc()), docs, Random().NextBoolean() ? DocsEnum.FLAG_FREQS : DocsEnum.FLAG_NONE);
+                    docs = iterator.Docs(new MatchNoBits(open.MaxDoc), docs, Random().NextBoolean() ? DocsEnum.FLAG_FREQS : DocsEnum.FLAG_NONE);
                     enums[docs] = true;
                 }
                 Assert.AreEqual(terms.Size(), enums.Count);
@@ -146,15 +146,15 @@ namespace Lucene.Net.Codecs.Lucene40
 
             DirectoryReader firstReader = DirectoryReader.Open(dir);
             DirectoryReader secondReader = DirectoryReader.Open(dir);
-            IList<AtomicReaderContext> leaves = firstReader.Leaves();
-            IList<AtomicReaderContext> leaves2 = secondReader.Leaves();
+            IList<AtomicReaderContext> leaves = firstReader.Leaves;
+            IList<AtomicReaderContext> leaves2 = secondReader.Leaves;
 
             foreach (AtomicReaderContext ctx in leaves)
             {
-                Terms terms = ((AtomicReader)ctx.Reader()).Terms("body");
+                Terms terms = ((AtomicReader)ctx.Reader).Terms("body");
                 TermsEnum iterator = terms.Iterator(null);
                 IdentityHashMap<DocsEnum, bool?> enums = new IdentityHashMap<DocsEnum, bool?>();
-                MatchNoBits bits = new MatchNoBits(firstReader.MaxDoc());
+                MatchNoBits bits = new MatchNoBits(firstReader.MaxDoc);
                 iterator = terms.Iterator(null);
                 DocsEnum docs = null;
                 BytesRef term = null;
@@ -184,7 +184,7 @@ namespace Lucene.Net.Codecs.Lucene40
             {
                 return null;
             }
-            AtomicReader indexReader = (AtomicReader)readers[Random().Next(readers.Count)].Reader();
+            AtomicReader indexReader = (AtomicReader)readers[Random().Next(readers.Count)].Reader;
             Terms terms = indexReader.Terms(field);
             if (terms == null)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestBlockPostingsFormat3.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestBlockPostingsFormat3.cs b/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestBlockPostingsFormat3.cs
index 304f74b..ca67a17 100644
--- a/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestBlockPostingsFormat3.cs
+++ b/src/Lucene.Net.Tests/core/Codecs/Lucene41/TestBlockPostingsFormat3.cs
@@ -173,9 +173,9 @@ namespace Lucene.Net.Codecs.Lucene41
         private void Verify(Directory dir)
         {
             DirectoryReader ir = DirectoryReader.Open(dir);
-            foreach (AtomicReaderContext leaf in ir.Leaves())
+            foreach (AtomicReaderContext leaf in ir.Leaves)
             {
-                AtomicReader leafReader = (AtomicReader)leaf.Reader();
+                AtomicReader leafReader = (AtomicReader)leaf.Reader;
                 AssertTerms(leafReader.Terms("field1docs"), leafReader.Terms("field2freqs"), true);
                 AssertTerms(leafReader.Terms("field3positions"), leafReader.Terms("field4offsets"), true);
                 AssertTerms(leafReader.Terms("field4offsets"), leafReader.Terms("field5payloadsFixed"), true);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Codecs/Perfield/TestPerFieldDocValuesFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Codecs/Perfield/TestPerFieldDocValuesFormat.cs b/src/Lucene.Net.Tests/core/Codecs/Perfield/TestPerFieldDocValuesFormat.cs
index d65f306..f2898ab 100644
--- a/src/Lucene.Net.Tests/core/Codecs/Perfield/TestPerFieldDocValuesFormat.cs
+++ b/src/Lucene.Net.Tests/core/Codecs/Perfield/TestPerFieldDocValuesFormat.cs
@@ -115,10 +115,10 @@ namespace Lucene.Net.Codecs.Perfield
             {
                 Document hitDoc = isearcher.Doc(hits.ScoreDocs[i].Doc);
                 Assert.AreEqual(text, hitDoc.Get("fieldname"));
-                Debug.Assert(ireader.Leaves().Count == 1);
-                NumericDocValues dv = ((AtomicReader)ireader.Leaves()[0].Reader()).GetNumericDocValues("dv1");
+                Debug.Assert(ireader.Leaves.Count == 1);
+                NumericDocValues dv = ((AtomicReader)ireader.Leaves[0].Reader).GetNumericDocValues("dv1");
                 Assert.AreEqual(5, dv.Get(hits.ScoreDocs[i].Doc));
-                BinaryDocValues dv2 = ((AtomicReader)ireader.Leaves()[0].Reader()).GetBinaryDocValues("dv2");
+                BinaryDocValues dv2 = ((AtomicReader)ireader.Leaves[0].Reader).GetBinaryDocValues("dv2");
                 dv2.Get(hits.ScoreDocs[i].Doc, scratch);
                 Assert.AreEqual(new BytesRef("hello world"), scratch);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Codecs/Perfield/TestPerFieldPostingsFormat2.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Codecs/Perfield/TestPerFieldPostingsFormat2.cs b/src/Lucene.Net.Tests/core/Codecs/Perfield/TestPerFieldPostingsFormat2.cs
index 10a72d2..0af2059 100644
--- a/src/Lucene.Net.Tests/core/Codecs/Perfield/TestPerFieldPostingsFormat2.cs
+++ b/src/Lucene.Net.Tests/core/Codecs/Perfield/TestPerFieldPostingsFormat2.cs
@@ -281,7 +281,7 @@ namespace Lucene.Net.Codecs.Perfield
                     writer.ForceMerge(1);
                 }
                 writer.Commit();
-                Assert.AreEqual((i + 1) * docsPerRound, writer.MaxDoc());
+                Assert.AreEqual((i + 1) * docsPerRound, writer.MaxDoc);
                 writer.Dispose();
             }
             dir.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/Test2BBinaryDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/Test2BBinaryDocValues.cs b/src/Lucene.Net.Tests/core/Index/Test2BBinaryDocValues.cs
index 7fb5b2f..c634e78 100644
--- a/src/Lucene.Net.Tests/core/Index/Test2BBinaryDocValues.cs
+++ b/src/Lucene.Net.Tests/core/Index/Test2BBinaryDocValues.cs
@@ -81,12 +81,12 @@ namespace Lucene.Net.Index
 
             DirectoryReader r = DirectoryReader.Open(dir);
             int expectedValue = 0;
-            foreach (AtomicReaderContext context in r.Leaves())
+            foreach (AtomicReaderContext context in r.Leaves)
             {
-                AtomicReader reader = (AtomicReader)context.Reader();
+                AtomicReader reader = context.AtomicReader;
                 BytesRef scratch = new BytesRef();
                 BinaryDocValues dv = reader.GetBinaryDocValues("dv");
-                for (int i = 0; i < reader.MaxDoc(); i++)
+                for (int i = 0; i < reader.MaxDoc; i++)
                 {
                     bytes[0] = (sbyte)(expectedValue >> 24);
                     bytes[1] = (sbyte)(expectedValue >> 16);
@@ -144,12 +144,12 @@ namespace Lucene.Net.Index
             DirectoryReader r = DirectoryReader.Open(dir);
             int expectedValue = 0;
             ByteArrayDataInput input = new ByteArrayDataInput();
-            foreach (AtomicReaderContext context in r.Leaves())
+            foreach (AtomicReaderContext context in r.Leaves)
             {
-                AtomicReader reader = (AtomicReader)context.Reader();
+                AtomicReader reader = context.AtomicReader;
                 BytesRef scratch = new BytesRef(bytes);
                 BinaryDocValues dv = reader.GetBinaryDocValues("dv");
-                for (int i = 0; i < reader.MaxDoc(); i++)
+                for (int i = 0; i < reader.MaxDoc; i++)
                 {
                     dv.Get(i, scratch);
                     input.Reset((byte[])(Array)scratch.Bytes, scratch.Offset, scratch.Length);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/Test2BDocs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/Test2BDocs.cs b/src/Lucene.Net.Tests/core/Index/Test2BDocs.cs
index bc488e4..84f69f7 100644
--- a/src/Lucene.Net.Tests/core/Index/Test2BDocs.cs
+++ b/src/Lucene.Net.Tests/core/Index/Test2BDocs.cs
@@ -86,8 +86,8 @@ namespace Lucene.Net.Index
             Arrays.Fill(subReaders, ir);
             subReaders[subReaders.Length - 1] = ir2;
             MultiReader mr = new MultiReader(subReaders);
-            Assert.AreEqual(int.MaxValue, mr.MaxDoc());
-            Assert.AreEqual(int.MaxValue, mr.NumDocs());
+            Assert.AreEqual(int.MaxValue, mr.MaxDoc);
+            Assert.AreEqual(int.MaxValue, mr.NumDocs);
             ir.Dispose();
             ir2.Dispose();
             dir2.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/Test2BNumericDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/Test2BNumericDocValues.cs b/src/Lucene.Net.Tests/core/Index/Test2BNumericDocValues.cs
index df32b69..ac25286 100644
--- a/src/Lucene.Net.Tests/core/Index/Test2BNumericDocValues.cs
+++ b/src/Lucene.Net.Tests/core/Index/Test2BNumericDocValues.cs
@@ -74,11 +74,11 @@ namespace Lucene.Net.Index
 
             DirectoryReader r = DirectoryReader.Open(dir);
             long expectedValue = 0;
-            foreach (AtomicReaderContext context in r.Leaves())
+            foreach (AtomicReaderContext context in r.Leaves)
             {
-                AtomicReader reader = (AtomicReader)context.Reader();
+                AtomicReader reader = context.AtomicReader;
                 NumericDocValues dv = reader.GetNumericDocValues("dv");
-                for (int i = 0; i < reader.MaxDoc(); i++)
+                for (int i = 0; i < reader.MaxDoc; i++)
                 {
                     Assert.AreEqual(expectedValue, dv.Get(i));
                     expectedValue++;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Tests/core/Index/Test2BSortedDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/Test2BSortedDocValues.cs b/src/Lucene.Net.Tests/core/Index/Test2BSortedDocValues.cs
index a8dd384..cf666ad 100644
--- a/src/Lucene.Net.Tests/core/Index/Test2BSortedDocValues.cs
+++ b/src/Lucene.Net.Tests/core/Index/Test2BSortedDocValues.cs
@@ -76,12 +76,12 @@ namespace Lucene.Net.Index
 
             DirectoryReader r = DirectoryReader.Open(dir);
             int expectedValue = 0;
-            foreach (AtomicReaderContext context in r.Leaves())
+            foreach (AtomicReaderContext context in r.Leaves)
             {
-                AtomicReader reader = (AtomicReader)context.Reader();
+                AtomicReader reader = context.AtomicReader;
                 BytesRef scratch = new BytesRef();
                 BinaryDocValues dv = reader.GetSortedDocValues("dv");
-                for (int i = 0; i < reader.MaxDoc(); i++)
+                for (int i = 0; i < reader.MaxDoc; i++)
                 {
                     bytes[0] = (sbyte)(expectedValue >> 8);
                     bytes[1] = (sbyte)expectedValue;
@@ -136,12 +136,12 @@ namespace Lucene.Net.Index
 
             DirectoryReader r = DirectoryReader.Open(dir);
             int counter = 0;
-            foreach (AtomicReaderContext context in r.Leaves())
+            foreach (AtomicReaderContext context in r.Leaves)
             {
-                AtomicReader reader = (AtomicReader)context.Reader();
+                AtomicReader reader = context.AtomicReader;
                 BytesRef scratch = new BytesRef();
                 BinaryDocValues dv = reader.GetSortedDocValues("dv");
-                for (int i = 0; i < reader.MaxDoc(); i++)
+                for (int i = 0; i < reader.MaxDoc; i++)
                 {
                     bytes[0] = (sbyte)(counter >> 24);
                     bytes[1] = (sbyte)(counter >> 16);


Mime
View raw message