lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [6/7] git commit: .NETification
Date Tue, 16 Sep 2014 20:20:54 GMT
.NETification


Project: http://git-wip-us.apache.org/repos/asf/lucenenet/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucenenet/commit/e2f44e8e
Tree: http://git-wip-us.apache.org/repos/asf/lucenenet/tree/e2f44e8e
Diff: http://git-wip-us.apache.org/repos/asf/lucenenet/diff/e2f44e8e

Branch: refs/heads/master
Commit: e2f44e8ee104d188c61fe16231269580cf63c907
Parents: f8ab0de
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Tue Sep 16 20:14:12 2014 +0300
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Tue Sep 16 20:14:12 2014 +0300

----------------------------------------------------------------------
 .../Codecs/BlockTreeTermsReader.cs              |   8 +-
 .../CompressingStoredFieldsWriter.cs            |   2 +-
 .../Compressing/CompressingTermVectorsReader.cs |  12 +-
 .../Compressing/CompressingTermVectorsWriter.cs |   6 +-
 src/Lucene.Net.Core/Codecs/DocValuesConsumer.cs |  28 +--
 .../Codecs/Lucene3x/Lucene3xFields.cs           |   9 +-
 .../Lucene3x/Lucene3xTermVectorsReader.cs       |  21 +-
 .../Lucene40/Lucene40StoredFieldsWriter.cs      |   4 +-
 .../Lucene40/Lucene40TermVectorsReader.cs       |  41 ++--
 .../Lucene40/Lucene40TermVectorsWriter.cs       |   4 +-
 .../Codecs/MappingMultiDocsEnum.cs              |   2 +-
 .../Codecs/Perfield/PerFieldPostingsFormat.cs   |   4 +-
 .../Codecs/StoredFieldsWriter.cs                |   2 +-
 src/Lucene.Net.Core/Codecs/TermVectorsWriter.cs |   4 +-
 src/Lucene.Net.Core/Index/AtomicReader.cs       |  12 +-
 .../Index/AtomicReaderContext.cs                |  21 +-
 .../Index/BaseCompositeReader.cs                |  25 ++-
 .../Index/BufferedUpdatesStream.cs              |   6 +-
 src/Lucene.Net.Core/Index/CheckIndex.cs         |  44 ++--
 .../Index/CompositeReaderContext.cs             |  41 ++--
 src/Lucene.Net.Core/Index/DocTermOrds.cs        |   8 +-
 src/Lucene.Net.Core/Index/Fields.cs             |   9 +-
 src/Lucene.Net.Core/Index/FilterAtomicReader.cs |  42 ++--
 src/Lucene.Net.Core/Index/IndexReader.cs        |  21 +-
 src/Lucene.Net.Core/Index/IndexReaderContext.cs |   8 +-
 src/Lucene.Net.Core/Index/IndexWriter.cs        |  23 +-
 src/Lucene.Net.Core/Index/MergePolicy.cs        |   2 +-
 src/Lucene.Net.Core/Index/MergeState.cs         |  34 +--
 src/Lucene.Net.Core/Index/MultiDocValues.cs     |  30 +--
 src/Lucene.Net.Core/Index/MultiFields.cs        |  24 +--
 .../Index/ParallelAtomicReader.cs               |  47 +++--
 .../Index/ParallelCompositeReader.cs            |  10 +-
 src/Lucene.Net.Core/Index/ReadersAndUpdates.cs  |  10 +-
 src/Lucene.Net.Core/Index/SegmentMerger.cs      |  12 +-
 src/Lucene.Net.Core/Index/SegmentReader.cs      |  39 ++--
 .../Index/SlowCompositeReaderWrapper.cs         |  43 ++--
 .../Index/StandardDirectoryReader.cs            |   6 +-
 src/Lucene.Net.Core/Index/TermContext.cs        |   8 +-
 src/Lucene.Net.Core/Search/BooleanQuery.cs      |   4 +-
 .../Search/CachingWrapperFilter.cs              |   8 +-
 .../Search/CollectionStatistics.cs              |   4 +-
 .../Search/ConstantScoreAutoRewrite.cs          |   2 +-
 .../Search/ConstantScoreQuery.cs                |   2 +-
 .../Search/DocTermOrdsRangeFilter.cs            |  10 +-
 .../Search/DocTermOrdsRewriteMethod.cs          |   4 +-
 src/Lucene.Net.Core/Search/FieldCacheImpl.cs    |  34 +--
 .../Search/FieldCacheRangeFilter.cs             |  64 +++---
 .../Search/FieldCacheRewriteMethod.cs           |   4 +-
 .../Search/FieldCacheTermsFilter.cs             |   4 +-
 src/Lucene.Net.Core/Search/FieldComparator.cs   |  20 +-
 src/Lucene.Net.Core/Search/FieldValueFilter.cs  |   8 +-
 src/Lucene.Net.Core/Search/FilteredQuery.cs     |   2 +-
 src/Lucene.Net.Core/Search/IndexSearcher.cs     |  20 +-
 src/Lucene.Net.Core/Search/MatchAllDocsQuery.cs |   4 +-
 src/Lucene.Net.Core/Search/MultiPhraseQuery.cs  |   4 +-
 .../Search/MultiTermQueryWrapperFilter.cs       |   6 +-
 .../Search/Payloads/PayloadNearQuery.cs         |   2 +-
 .../Search/Payloads/PayloadSpanUtil.cs          |   4 +-
 .../Search/Payloads/PayloadTermQuery.cs         |   2 +-
 src/Lucene.Net.Core/Search/PhraseQuery.cs       |   2 +-
 src/Lucene.Net.Core/Search/QueryRescorer.cs     |   4 +-
 .../Search/Similarities/BM25Similarity.cs       |   8 +-
 .../Search/Similarities/SimilarityBase.cs       |   2 +-
 .../Search/Similarities/TFIDFSimilarity.cs      |   4 +-
 src/Lucene.Net.Core/Search/SortRescorer.cs      |   4 +-
 .../Search/Spans/SpanTermQuery.cs               |   2 +-
 .../Search/TermCollectingRewrite.cs             |   4 +-
 .../Util/FieldCacheSanityChecker.cs             |   4 +-
 .../Codecs/asserting/AssertingPostingsFormat.cs |   4 +-
 .../Codecs/ramonly/RAMOnlyPostingsFormat.cs     |   4 +-
 .../Index/AllDeletedFilterReader.cs             |   8 +-
 .../Index/AssertingAtomicReader.cs              |  35 ++--
 .../Index/BaseDocValuesFormatTestCase.cs        | 208 +++++++++----------
 .../Index/BaseStoredFieldsFormatTestCase.cs     |  14 +-
 .../Index/BaseTermVectorsFormatTestCase.cs      |   2 +-
 .../Index/FieldFilterAtomicReader.cs            |  18 +-
 .../Index/RandomIndexWriter.cs                  |   2 +-
 .../ThreadedIndexingAndSearchingTestCase.cs     |  10 +-
 .../Search/CheckHits.cs                         |   2 +-
 .../Search/QueryUtils.cs                        |  18 +-
 .../Search/SearchEquivalenceTestBase.cs         |   4 +-
 .../Search/ShardSearchingTestBase.cs            |   8 +-
 .../Store/MockDirectoryWrapper.cs               |   4 +-
 .../Util/LuceneTestCase.cs                      |  46 ++--
 src/Lucene.Net.TestFramework/Util/TestUtil.cs   |   4 +-
 .../core/Codecs/Lucene40/TestReuseDocsEnum.cs   |  26 +--
 .../Codecs/Lucene41/TestBlockPostingsFormat3.cs |   4 +-
 .../Perfield/TestPerFieldDocValuesFormat.cs     |   6 +-
 .../Perfield/TestPerFieldPostingsFormat2.cs     |   2 +-
 .../core/Index/Test2BBinaryDocValues.cs         |  12 +-
 src/Lucene.Net.Tests/core/Index/Test2BDocs.cs   |   4 +-
 .../core/Index/Test2BNumericDocValues.cs        |   6 +-
 .../core/Index/Test2BSortedDocValues.cs         |  12 +-
 .../core/Index/TestAddIndexes.cs                |  76 +++----
 .../core/Index/TestAtomicUpdate.cs              |   4 +-
 .../core/Index/TestBagOfPositions.cs            |   4 +-
 .../core/Index/TestBagOfPostings.cs             |   6 +-
 .../core/Index/TestBinaryDocValuesUpdates.cs    | 110 +++++-----
 .../core/Index/TestCodecHoldsOpenFiles.cs       |   8 +-
 src/Lucene.Net.Tests/core/Index/TestCodecs.cs   |   4 +-
 .../core/Index/TestConcurrentMergeScheduler.cs  |   6 +-
 src/Lucene.Net.Tests/core/Index/TestCrash.cs    |  12 +-
 .../core/Index/TestCustomNorms.cs               |   2 +-
 .../core/Index/TestDeletionPolicy.cs            |  24 +--
 .../core/Index/TestDirectoryReader.cs           |  38 ++--
 .../core/Index/TestDirectoryReaderReopen.cs     |  16 +-
 src/Lucene.Net.Tests/core/Index/TestDoc.cs      |   4 +-
 src/Lucene.Net.Tests/core/Index/TestDocCount.cs |   2 +-
 .../core/Index/TestDocTermOrds.cs               |  20 +-
 .../core/Index/TestDocValuesIndexing.cs         |   6 +-
 .../core/Index/TestDocValuesWithThreads.cs      |   6 +-
 .../core/Index/TestDocsAndPositions.cs          |  26 +--
 .../core/Index/TestFilterAtomicReader.cs        |   4 +-
 src/Lucene.Net.Tests/core/Index/TestFlex.cs     |   2 +-
 .../core/Index/TestIndexReaderClose.cs          |   2 +-
 .../core/Index/TestIndexWriter.cs               |  74 +++----
 .../core/Index/TestIndexWriterCommit.cs         |  52 ++---
 .../core/Index/TestIndexWriterDelete.cs         |  42 ++--
 .../core/Index/TestIndexWriterExceptions.cs     |  48 ++---
 .../core/Index/TestIndexWriterForceMerge.cs     |   4 +-
 .../core/Index/TestIndexWriterMergePolicy.cs    |   2 +-
 .../core/Index/TestIndexWriterMerging.cs        |  34 +--
 .../core/Index/TestIndexWriterNRTIsCurrent.cs   |   2 +-
 .../TestIndexWriterOutOfFileDescriptors.cs      |   4 +-
 .../core/Index/TestIndexWriterReader.cs         |  46 ++--
 .../core/Index/TestIndexWriterUnicode.cs        |   4 +-
 .../core/Index/TestIndexWriterWithThreads.cs    |   4 +-
 .../core/Index/TestLongPostings.cs              |   4 +-
 .../core/Index/TestMaxTermFrequency.cs          |   2 +-
 .../core/Index/TestMixedCodecs.cs               |   2 +-
 .../core/Index/TestMixedDocValuesUpdates.cs     |  26 +--
 .../core/Index/TestNRTThreads.cs                |   6 +-
 src/Lucene.Net.Tests/core/Index/TestNorms.cs    |   6 +-
 .../core/Index/TestNumericDocValuesUpdates.cs   | 110 +++++-----
 .../core/Index/TestOmitNorms.cs                 |   2 +-
 .../core/Index/TestParallelCompositeReader.cs   |  20 +-
 .../core/Index/TestParallelReaderEmptyIndex.cs  |   4 +-
 .../core/Index/TestParallelTermEnum.cs          |   2 +-
 .../core/Index/TestPostingsOffsets.cs           |   6 +-
 src/Lucene.Net.Tests/core/Index/TestRollback.cs |   2 +-
 .../core/Index/TestRollingUpdates.cs            |   6 +-
 .../core/Index/TestSegmentMerger.cs             |  12 +-
 .../core/Index/TestSegmentReader.cs             |   8 +-
 .../core/Index/TestSegmentTermDocs.cs           |   2 +-
 .../core/Index/TestSegmentTermEnum.cs           |   2 +-
 .../core/Index/TestSnapshotDeletionPolicy.cs    |   2 +-
 .../core/Index/TestStressAdvance.cs             |   4 +-
 .../core/Index/TestStressIndexing2.cs           |  20 +-
 .../core/Index/TestTermVectorsReader.cs         |   4 +-
 .../core/Index/TestTermVectorsWriter.cs         |   2 +-
 .../core/Index/TestTermsEnum.cs                 |  10 +-
 .../core/Index/TestThreadedForceMerge.cs        |   8 +-
 .../core/Index/TestTieredMergePolicy.cs         |  20 +-
 .../core/Index/TestTransactionRollback.cs       |   4 +-
 .../core/Index/TestTransactions.cs              |   4 +-
 src/Lucene.Net.Tests/core/Search/MockFilter.cs  |   2 +-
 .../core/Search/SingleDocTestFilter.cs          |   2 +-
 .../core/Search/Spans/MultiSpansWrapper.cs      |  14 +-
 .../core/Search/Spans/TestNearSpansOrdered.cs   |   4 +-
 .../core/Search/Spans/TestSpans.cs              |   4 +-
 .../core/Search/Spans/TestSpansAdvanced2.cs     |   2 +-
 .../core/Search/TestBooleanOr.cs                |   4 +-
 .../core/Search/TestCachingWrapperFilter.cs     |  30 +--
 .../core/Search/TestDisjunctionMaxQuery.cs      |   4 +-
 .../core/Search/TestDocValuesScoring.cs         |   2 +-
 .../core/Search/TestElevationComparator.cs      |   2 +-
 .../core/Search/TestFieldCacheRangeFilter.cs    |  16 +-
 .../core/Search/TestFieldCacheTermsFilter.cs    |   2 +-
 .../core/Search/TestFilteredQuery.cs            |   6 +-
 .../core/Search/TestFilteredSearch.cs           |   4 +-
 .../core/Search/TestIndexSearcher.cs            |   2 +-
 .../core/Search/TestMinShouldMatch2.cs          |   2 +-
 .../core/Search/TestMultiTermConstantScore.cs   |   4 +-
 .../core/Search/TestMultiThreadTermVectors.cs   |   2 +-
 .../core/Search/TestNumericRangeQuery32.cs      |   6 +-
 .../core/Search/TestNumericRangeQuery64.cs      |   6 +-
 .../core/Search/TestQueryRescorer.cs            |   4 +-
 .../core/Search/TestSameScoresWithThreads.cs    |   2 +-
 .../core/Search/TestSearchAfter.cs              |   2 +-
 .../core/Search/TestSearcherManager.cs          |   4 +-
 .../core/Search/TestShardSearching.cs           |   8 +-
 .../core/Search/TestSimilarityProvider.cs       |   2 +-
 .../core/Search/TestSortRandom.cs               |   6 +-
 .../core/Search/TestSubScorerFreqs.cs           |   6 +-
 .../core/Search/TestTermRangeFilter.cs          |   4 +-
 .../core/Search/TestTermScorer.cs               |   6 +-
 .../core/Search/TestTermVectors.cs              |   4 +-
 .../core/Search/TestTopDocsMerge.cs             |   6 +-
 .../core/Store/TestFileSwitchDirectory.cs       |   2 +-
 .../core/Store/TestNRTCachingDirectory.cs       |   2 +-
 .../core/Store/TestRAMDirectory.cs              |   4 +-
 191 files changed, 1318 insertions(+), 1243 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs b/src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs
index a2055dd..b56fb28 100644
--- a/src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs
+++ b/src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs
@@ -293,9 +293,9 @@ namespace Lucene.Net.Codecs
             return ret;
         }
 
-        public override int Size()
+        public override int Size
         {
-            return Fields.Count;
+            get { return Fields.Count; }
         }
 
         // for debugging
@@ -2651,12 +2651,12 @@ namespace Lucene.Net.Codecs
 
                 public override void SeekExact(long ord)
                 {
-                    throw new System.NotSupportedException();
+                    throw new NotSupportedException();
                 }
 
                 public override long Ord()
                 {
-                    throw new System.NotSupportedException();
+                    throw new NotSupportedException();
                 }
 
                 // Not static -- references term, postingsReader,

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsWriter.cs b/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsWriter.cs
index 28ba659..c556d59 100644
--- a/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsWriter.cs
@@ -448,7 +448,7 @@ namespace Lucene.Net.Codecs.Compressing
                     }
                 }
 
-                int maxDoc = reader.MaxDoc();
+                int maxDoc = reader.MaxDoc;
                 Bits liveDocs = reader.LiveDocs;
 
                 if (matchingFieldsReader == null || matchingFieldsReader.Version != VERSION_CURRENT || matchingFieldsReader.CompressionMode != CompressionMode || matchingFieldsReader.ChunkSize != ChunkSize) // the way data is decompressed depends on the chunk size -  means reader version is not the same as the writer version

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsReader.cs b/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsReader.cs
index 9b2a0fc..058a094 100644
--- a/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsReader.cs
+++ b/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsReader.cs
@@ -1,3 +1,4 @@
+using System.Linq;
 using Lucene.Net.Index;
 using Lucene.Net.Store;
 using Lucene.Net.Support;
@@ -766,9 +767,9 @@ namespace Lucene.Net.Codecs.Compressing
                 return new TVTerms(OuterInstance, NumTerms[idx], FieldFlags[idx], PrefixLengths[idx], SuffixLengths[idx], TermFreqs[idx], PositionIndex[idx], Positions[idx], StartOffsets[idx], Lengths[idx], PayloadIndex[idx], PayloadBytes, new BytesRef(SuffixBytes.Bytes, SuffixBytes.Offset + fieldOff, fieldLen));
             }
 
-            public override int Size()
+            public override int Size
             {
-                return FieldNumOffs.Length;
+                get { return FieldNumOffs.Length; }
             }
         }
 
@@ -1192,12 +1193,7 @@ namespace Lucene.Net.Codecs.Compressing
 
         private static int Sum(int[] arr)
         {
-            int sum = 0;
-            foreach (int el in arr)
-            {
-                sum += el;
-            }
-            return sum;
+            return arr.Sum();
         }
 
         public override long RamBytesUsed()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsWriter.cs b/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsWriter.cs
index d89f8b3..d94e1b9 100644
--- a/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsWriter.cs
@@ -882,7 +882,7 @@ namespace Lucene.Net.Codecs.Compressing
                     }
                 }
 
-                int maxDoc = reader.MaxDoc();
+                int maxDoc = reader.MaxDoc;
                 Bits liveDocs = reader.LiveDocs;
 
                 if (matchingVectorsReader == null || matchingVectorsReader.Version != VERSION_CURRENT || matchingVectorsReader.CompressionMode != CompressionMode || matchingVectorsReader.ChunkSize != ChunkSize || matchingVectorsReader.PackedIntsVersion != PackedInts.VERSION_CURRENT)
@@ -916,8 +916,8 @@ namespace Lucene.Net.Codecs.Compressing
                         {
                             int docBase = vectorsStream.ReadVInt();
                             int chunkDocs = vectorsStream.ReadVInt();
-                            Debug.Assert(docBase + chunkDocs <= matchingSegmentReader.MaxDoc());
-                            if (docBase + chunkDocs < matchingSegmentReader.MaxDoc() && NextDeletedDoc(docBase, liveDocs, docBase + chunkDocs) == docBase + chunkDocs)
+                            Debug.Assert(docBase + chunkDocs <= matchingSegmentReader.MaxDoc);
+                            if (docBase + chunkDocs < matchingSegmentReader.MaxDoc && NextDeletedDoc(docBase, liveDocs, docBase + chunkDocs) == docBase + chunkDocs)
                             {
                                 long chunkEnd = index.GetStartPointer(docBase + chunkDocs);
                                 long chunkLength = chunkEnd - vectorsStream.FilePointer;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/DocValuesConsumer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/DocValuesConsumer.cs b/src/Lucene.Net.Core/Codecs/DocValuesConsumer.cs
index 324c8d9..65614ea 100644
--- a/src/Lucene.Net.Core/Codecs/DocValuesConsumer.cs
+++ b/src/Lucene.Net.Core/Codecs/DocValuesConsumer.cs
@@ -132,7 +132,7 @@ namespace Lucene.Net.Codecs
                     yield break;
                 }
 
-                if (currentReader == null || docIDUpto == currentReader.MaxDoc())
+                if (currentReader == null || docIDUpto == currentReader.MaxDoc)
                 {
                     readerUpto++;
                     if (readerUpto < toMerge.Count)
@@ -226,7 +226,7 @@ namespace Lucene.Net.Codecs
 					return false;
 				  }
 
-				  if (currentReader == null || docIDUpto == currentReader.MaxDoc())
+				  if (currentReader == null || docIDUpto == currentReader.MaxDoc)
 				  {
 					readerUpto++;
 					if (readerUpto < OuterInstance.ToMerge.Count)
@@ -288,7 +288,7 @@ namespace Lucene.Net.Codecs
                     yield break;
                 }
 
-                if (currentReader == null || docIDUpto == currentReader.MaxDoc())
+                if (currentReader == null || docIDUpto == currentReader.MaxDoc)
                 {
                     readerUpto++;
                     if (readerUpto < toMerge.Count)
@@ -386,7 +386,7 @@ namespace Lucene.Net.Codecs
                       return false;
                     }
 
-                    if (currentReader == null || docIDUpto == currentReader.MaxDoc())
+                    if (currentReader == null || docIDUpto == currentReader.MaxDoc)
                     {
                       readerUpto++;
                       if (readerUpto < OuterInstance.ToMerge.Count)
@@ -447,7 +447,7 @@ namespace Lucene.Net.Codecs
                 else
                 {
                     LongBitSet bitset = new LongBitSet(dv.ValueCount);
-                    for (int i = 0; i < reader.MaxDoc(); i++)
+                    for (int i = 0; i < reader.MaxDoc; i++)
                     {
                         if (liveDocs.Get(i))
                         {
@@ -501,7 +501,7 @@ namespace Lucene.Net.Codecs
                     yield break;
                 }
 
-                if (currentReader == null || docIDUpTo == currentReader.MaxDoc())
+                if (currentReader == null || docIDUpTo == currentReader.MaxDoc)
                 {
                     readerUpTo++;
                     if (readerUpTo < readers.Length)
@@ -653,7 +653,7 @@ namespace Lucene.Net.Codecs
                       return false;
                     }
 
-                    if (currentReader == null || docIDUpto == currentReader.MaxDoc())
+                    if (currentReader == null || docIDUpto == currentReader.MaxDoc)
                     {
                       readerUpto++;
                       if (readerUpto < OuterInstance.Readers.Length)
@@ -705,7 +705,7 @@ namespace Lucene.Net.Codecs
                 else
                 {
                     LongBitSet bitset = new LongBitSet(dv.ValueCount);
-                    for (int i = 0; i < reader.MaxDoc(); i++)
+                    for (int i = 0; i < reader.MaxDoc; i++)
                     {
                         if (liveDocs.Get(i))
                         {
@@ -762,7 +762,7 @@ namespace Lucene.Net.Codecs
                     yield break;
                 }
 
-                if (currentReader == null || docIDUpto == currentReader.MaxDoc())
+                if (currentReader == null || docIDUpto == currentReader.MaxDoc)
                 {
                     readerUpto++;
                     if (readerUpto < readers.Length)
@@ -816,7 +816,7 @@ namespace Lucene.Net.Codecs
                     continue;
                 }
 
-                if (currentReader == null || docIDUpto == currentReader.MaxDoc())
+                if (currentReader == null || docIDUpto == currentReader.MaxDoc)
                 {
                     readerUpto++;
                     if (readerUpto < readers.Length)
@@ -830,7 +830,7 @@ namespace Lucene.Net.Codecs
 
                 if (currentLiveDocs == null || currentLiveDocs.Get(docIDUpto))
                 {
-                    Debug.Assert(docIDUpto < currentReader.MaxDoc());
+                    Debug.Assert(docIDUpto < currentReader.MaxDoc);
                     SortedSetDocValues dv = dvs[readerUpto];
                     dv.Document = docIDUpto;
                     ordUpto = ordLength = 0;
@@ -978,7 +978,7 @@ namespace Lucene.Net.Codecs
                       return false;
                     }
 
-                    if (currentReader == null || docIDUpto == currentReader.MaxDoc())
+                    if (currentReader == null || docIDUpto == currentReader.MaxDoc)
                     {
                       readerUpto++;
                       if (readerUpto < OuterInstance.Readers.Length)
@@ -1091,7 +1091,7 @@ namespace Lucene.Net.Codecs
                       return true;
                     }
 
-                    if (currentReader == null || docIDUpto == currentReader.MaxDoc())
+                    if (currentReader == null || docIDUpto == currentReader.MaxDoc)
                     {
                       readerUpto++;
                       if (readerUpto < OuterInstance.Readers.Length)
@@ -1105,7 +1105,7 @@ namespace Lucene.Net.Codecs
 
                     if (currentLiveDocs == null || currentLiveDocs.Get(docIDUpto))
                     {
-                      Debug.Assert(docIDUpto < currentReader.MaxDoc());
+                      Debug.Assert(docIDUpto < currentReader.MaxDoc);
                       SortedSetDocValues dv = OuterInstance.Dvs[readerUpto];
                       dv.Document = docIDUpto;
                       ordUpto = ordLength = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xFields.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xFields.cs b/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xFields.cs
index fe13536..26fbfa1 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xFields.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xFields.cs
@@ -154,10 +154,13 @@ namespace Lucene.Net.Codecs.Lucene3x
             return ret;
         }
 
-        public override int Size()
+        public override int Size
         {
-            Debug.Assert(PreTerms_.Count == Fields.Count);
-            return Fields.Count;
+            get
+            {
+                Debug.Assert(PreTerms_.Count == Fields.Count);
+                return Fields.Count;
+            }
         }
 
         public override long UniqueTermCount

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xTermVectorsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xTermVectorsReader.cs b/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xTermVectorsReader.cs
index 7eb3f93..ae4796e 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xTermVectorsReader.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xTermVectorsReader.cs
@@ -78,7 +78,7 @@ namespace Lucene.Net.Codecs.Lucene3x
         /// Extension of vectors index file </summary>
         public const string VECTORS_INDEX_EXTENSION = "tvx";
 
-        private FieldInfos FieldInfos;
+        private readonly FieldInfos FieldInfos;
 
         private IndexInput Tvx;
         private IndexInput Tvd;
@@ -336,15 +336,18 @@ namespace Lucene.Net.Codecs.Lucene3x
                 return new TVTerms(OuterInstance, FieldFPs[fieldIndex]);
             }
 
-            public override int Size()
+            public override int Size
             {
-                if (FieldNumbers == null)
-                {
-                    return 0;
-                }
-                else
+                get
                 {
-                    return FieldNumbers.Length;
+                    if (FieldNumbers == null)
+                    {
+                        return 0;
+                    }
+                    else
+                    {
+                        return FieldNumbers.Length;
+                    }
                 }
             }
         }
@@ -862,7 +865,7 @@ namespace Lucene.Net.Codecs.Lucene3x
             if (Tvx != null)
             {
                 Fields fields = new TVFields(this, docID);
-                if (fields.Size() == 0)
+                if (fields.Size == 0)
                 {
                     // TODO: we can improve writer here, eg write 0 into
                     // tvx file, so we know on first read from tvx that

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
index d54dae7..1a76a6f 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsWriter.cs
@@ -316,7 +316,7 @@ namespace Lucene.Net.Codecs.Lucene40
         private int CopyFieldsWithDeletions(MergeState mergeState, AtomicReader reader, Lucene40StoredFieldsReader matchingFieldsReader, int[] rawDocLengths)
         {
             int docCount = 0;
-            int maxDoc = reader.MaxDoc();
+            int maxDoc = reader.MaxDoc;
             Bits liveDocs = reader.LiveDocs;
             Debug.Assert(liveDocs != null);
             if (matchingFieldsReader != null)
@@ -380,7 +380,7 @@ namespace Lucene.Net.Codecs.Lucene40
 
         private int CopyFieldsNoDeletions(MergeState mergeState, AtomicReader reader, Lucene40StoredFieldsReader matchingFieldsReader, int[] rawDocLengths)
         {
-            int maxDoc = reader.MaxDoc();
+            int maxDoc = reader.MaxDoc;
             int docCount = 0;
             if (matchingFieldsReader != null)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40TermVectorsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40TermVectorsReader.cs b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40TermVectorsReader.cs
index 6a1d7d8..7b259a7 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40TermVectorsReader.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40TermVectorsReader.cs
@@ -320,15 +320,18 @@ namespace Lucene.Net.Codecs.Lucene40
                 return new TVTerms(OuterInstance, FieldFPs[fieldIndex]);
             }
 
-            public override int Size()
+            public override int Size
             {
-                if (FieldNumbers == null)
-                {
-                    return 0;
-                }
-                else
+                get
                 {
-                    return FieldNumbers.Length;
+                    if (FieldNumbers == null)
+                    {
+                        return 0;
+                    }
+                    else
+                    {
+                        return FieldNumbers.Length;
+                    }
                 }
             }
         }
@@ -439,17 +442,17 @@ namespace Lucene.Net.Codecs.Lucene40
         {
             private readonly Lucene40TermVectorsReader OuterInstance;
 
-            internal readonly IndexInput OrigTVF;
-            internal readonly IndexInput Tvf;
-            internal int NumTerms;
-            internal int NextTerm;
-            internal int Freq;
-            internal BytesRef LastTerm = new BytesRef();
-            internal BytesRef Term_Renamed = new BytesRef();
-            internal bool StorePositions;
-            internal bool StoreOffsets;
-            internal bool StorePayloads;
-            internal long TvfFP;
+            private readonly IndexInput OrigTVF;
+            private readonly IndexInput Tvf;
+            private int NumTerms;
+            private int NextTerm;
+            private int Freq;
+            private BytesRef LastTerm = new BytesRef();
+            private BytesRef Term_Renamed = new BytesRef();
+            private bool StorePositions;
+            private bool StoreOffsets;
+            private bool StorePayloads;
+            private long TvfFP;
 
             internal int[] Positions;
             internal int[] StartOffsets;
@@ -848,7 +851,7 @@ namespace Lucene.Net.Codecs.Lucene40
             if (Tvx != null)
             {
                 Fields fields = new TVFields(this, docID);
-                if (fields.Size() == 0)
+                if (fields.Size == 0)
                 {
                     // TODO: we can improve writer here, eg write 0 into
                     // tvx file, so we know on first read from tvx that

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40TermVectorsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40TermVectorsWriter.cs b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40TermVectorsWriter.cs
index 4a93369..bc5dea0 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40TermVectorsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40TermVectorsWriter.cs
@@ -396,7 +396,7 @@ namespace Lucene.Net.Codecs.Lucene40
 
         private int CopyVectorsWithDeletions(MergeState mergeState, Lucene40TermVectorsReader matchingVectorsReader, AtomicReader reader, int[] rawDocLengths, int[] rawDocLengths2)
         {
-            int maxDoc = reader.MaxDoc();
+            int maxDoc = reader.MaxDoc;
             Bits liveDocs = reader.LiveDocs;
             int totalNumDocs = 0;
             if (matchingVectorsReader != null)
@@ -457,7 +457,7 @@ namespace Lucene.Net.Codecs.Lucene40
 
         private int CopyVectorsNoDeletions(MergeState mergeState, Lucene40TermVectorsReader matchingVectorsReader, AtomicReader reader, int[] rawDocLengths, int[] rawDocLengths2)
         {
-            int maxDoc = reader.MaxDoc();
+            int maxDoc = reader.MaxDoc;
             if (matchingVectorsReader != null)
             {
                 // We can bulk-copy because the fieldInfos are "congruent"

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/MappingMultiDocsEnum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/MappingMultiDocsEnum.cs b/src/Lucene.Net.Core/Codecs/MappingMultiDocsEnum.cs
index fa74ac7..ecdf5ca 100644
--- a/src/Lucene.Net.Core/Codecs/MappingMultiDocsEnum.cs
+++ b/src/Lucene.Net.Core/Codecs/MappingMultiDocsEnum.cs
@@ -121,7 +121,7 @@ namespace Lucene.Net.Codecs
                         Current = Subs_Renamed[Upto].DocsEnum;
                         CurrentBase = MergeState_Renamed.DocBase[reader];
                         CurrentMap = MergeState_Renamed.DocMaps[reader];
-                        Debug.Assert(CurrentMap.MaxDoc() == Subs_Renamed[Upto].Slice.Length, "readerIndex=" + reader + " subs.len=" + Subs_Renamed.Length + " len1=" + CurrentMap.MaxDoc() + " vs " + Subs_Renamed[Upto].Slice.Length);
+                        Debug.Assert(CurrentMap.MaxDoc == Subs_Renamed[Upto].Slice.Length, "readerIndex=" + reader + " subs.len=" + Subs_Renamed.Length + " len1=" + CurrentMap.MaxDoc + " vs " + Subs_Renamed[Upto].Slice.Length);
                     }
                 }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/Perfield/PerFieldPostingsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Perfield/PerFieldPostingsFormat.cs b/src/Lucene.Net.Core/Codecs/Perfield/PerFieldPostingsFormat.cs
index c77eaf7..f21de45 100644
--- a/src/Lucene.Net.Core/Codecs/Perfield/PerFieldPostingsFormat.cs
+++ b/src/Lucene.Net.Core/Codecs/Perfield/PerFieldPostingsFormat.cs
@@ -243,9 +243,9 @@ namespace Lucene.Net.Codecs.Perfield
                 return fieldsProducer == null ? null : fieldsProducer.Terms(field);
             }
 
-            public override int Size()
+            public override int Size
             {
-                return Fields.Count;
+                get { return Fields.Count; }
             }
 
             public override void Dispose()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs b/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
index d1a3ff4..02a52b7 100644
--- a/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/StoredFieldsWriter.cs
@@ -101,7 +101,7 @@ namespace Lucene.Net.Codecs
             int docCount = 0;
             foreach (AtomicReader reader in mergeState.Readers)
             {
-                int maxDoc = reader.MaxDoc();
+                int maxDoc = reader.MaxDoc;
                 Bits liveDocs = reader.LiveDocs;
                 for (int i = 0; i < maxDoc; i++)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Codecs/TermVectorsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/TermVectorsWriter.cs b/src/Lucene.Net.Core/Codecs/TermVectorsWriter.cs
index e141669..bd4431f 100644
--- a/src/Lucene.Net.Core/Codecs/TermVectorsWriter.cs
+++ b/src/Lucene.Net.Core/Codecs/TermVectorsWriter.cs
@@ -221,7 +221,7 @@ namespace Lucene.Net.Codecs
             for (int i = 0; i < mergeState.Readers.Count; i++)
             {
                 AtomicReader reader = mergeState.Readers[i];
-                int maxDoc = reader.MaxDoc();
+                int maxDoc = reader.MaxDoc;
                 Bits liveDocs = reader.LiveDocs;
 
                 for (int docID = 0; docID < maxDoc; docID++)
@@ -256,7 +256,7 @@ namespace Lucene.Net.Codecs
                 return;
             }
 
-            int numFields = vectors.Size();
+            int numFields = vectors.Size;
             if (numFields == -1)
             {
                 // count manually! TODO: Maybe enforce that Fields.size() returns something valid?

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/AtomicReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/AtomicReader.cs b/src/Lucene.Net.Core/Index/AtomicReader.cs
index 65b9d31..a48a1bb 100644
--- a/src/Lucene.Net.Core/Index/AtomicReader.cs
+++ b/src/Lucene.Net.Core/Index/AtomicReader.cs
@@ -105,11 +105,11 @@ namespace Lucene.Net.Index
         /// this method may return null if the reader has no
         /// postings.
         /// </summary>
-        public abstract Fields Fields();
+        public abstract Fields Fields { get; }
 
         public override sealed int DocFreq(Term term)
         {
-            Fields fields = Fields();
+            Fields fields = Fields;
             if (fields == null)
             {
                 return 0;
@@ -139,7 +139,7 @@ namespace Lucene.Net.Index
         /// </summary>
         public override sealed long TotalTermFreq(Term term)
         {
-            Fields fields = Fields();
+            Fields fields = Fields;
             if (fields == null)
             {
                 return 0;
@@ -194,7 +194,7 @@ namespace Lucene.Net.Index
         /// this may return null if the field does not exist. </summary>
         public Terms Terms(string field)
         {
-            Fields fields = Fields();
+            Fields fields = Fields;
             if (fields == null)
             {
                 return null;
@@ -211,7 +211,7 @@ namespace Lucene.Net.Index
         {
             Debug.Assert(term.Field() != null);
             Debug.Assert(term.Bytes() != null);
-            Fields fields = Fields();
+            Fields fields = Fields;
             if (fields != null)
             {
                 Terms terms = fields.Terms(term.Field());
@@ -236,7 +236,7 @@ namespace Lucene.Net.Index
         {
             Debug.Assert(term.Field() != null);
             Debug.Assert(term.Bytes() != null);
-            Fields fields = Fields();
+            Fields fields = Fields;
             if (fields != null)
             {
                 Terms terms = fields.Terms(term.Field());

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/AtomicReaderContext.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/AtomicReaderContext.cs b/src/Lucene.Net.Core/Index/AtomicReaderContext.cs
index ca6d558..a03c839 100644
--- a/src/Lucene.Net.Core/Index/AtomicReaderContext.cs
+++ b/src/Lucene.Net.Core/Index/AtomicReaderContext.cs
@@ -53,24 +53,27 @@ namespace Lucene.Net.Index
         {
         }
 
-        public override IList<AtomicReaderContext> Leaves()
+        public override IList<AtomicReaderContext> Leaves
         {
-            if (!IsTopLevel)
+            get
             {
-                throw new System.NotSupportedException("this is not a top-level context.");
+                if (!IsTopLevel)
+                {
+                    throw new System.NotSupportedException("this is not a top-level context.");
+                }
+                Debug.Assert(leaves != null);
+                return leaves;
             }
-            Debug.Assert(leaves != null);
-            return leaves;
         }
 
-        public override IList<IndexReaderContext> Children()
+        public override IList<IndexReaderContext> Children
         {
-            return null;
+            get { return null; }
         }
 
-        public override IndexReader Reader()
+        public override IndexReader Reader
         {
-            return reader;
+            get { return reader; }
         }
 
         // .NET Port: Can't change return type on override like Java, so adding helper property

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/BaseCompositeReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/BaseCompositeReader.cs b/src/Lucene.Net.Core/Index/BaseCompositeReader.cs
index eefc474..c5c0e31 100644
--- a/src/Lucene.Net.Core/Index/BaseCompositeReader.cs
+++ b/src/Lucene.Net.Core/Index/BaseCompositeReader.cs
@@ -1,3 +1,4 @@
+using System;
 using System.Collections.Generic;
 using System.Linq;
 
@@ -75,12 +76,12 @@ namespace Lucene.Net.Index
             {
                 Starts[i] = maxDoc;
                 IndexReader r = subReaders[i];
-                maxDoc += r.MaxDoc(); // compute maxDocs
+                maxDoc += r.MaxDoc; // compute maxDocs
                 if (maxDoc < 0) // overflow
                 {
-                    throw new System.ArgumentException("Too many documents, composite IndexReaders cannot exceed " + int.MaxValue);
+                    throw new ArgumentException("Too many documents, composite IndexReaders cannot exceed " + int.MaxValue);
                 }
-                numDocs += r.NumDocs(); // compute numDocs
+                numDocs += r.NumDocs; // compute numDocs
                 r.RegisterParentReader(this);
             }
             Starts[subReaders.Length] = maxDoc;
@@ -95,16 +96,22 @@ namespace Lucene.Net.Index
             return SubReaders[i].GetTermVectors(docID - Starts[i]); // dispatch to subreader
         }
 
-        public override sealed int NumDocs()
+        public override sealed int NumDocs
         {
-            // Don't call ensureOpen() here (it could affect performance)
-            return numDocs;
+            get
+            {
+                // Don't call ensureOpen() here (it could affect performance)
+                return numDocs;
+            }
         }
 
-        public override sealed int MaxDoc()
+        public override sealed int MaxDoc
         {
-            // Don't call ensureOpen() here (it could affect performance)
-            return maxDoc;
+            get
+            {
+                // Don't call ensureOpen() here (it could affect performance)
+                return maxDoc;
+            }
         }
 
         public override sealed void Document(int docID, StoredFieldVisitor visitor)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs b/src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs
index c37b73c..dd32e73 100644
--- a/src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs
+++ b/src/Lucene.Net.Core/Index/BufferedUpdatesStream.cs
@@ -459,7 +459,7 @@ namespace Lucene.Net.Index
             lock (this)
             {
                 long delCount = 0;
-                Fields fields = reader.Fields();
+                Fields fields = reader.Fields;
                 if (fields == null)
                 {
                     // this reader has no postings
@@ -548,7 +548,7 @@ namespace Lucene.Net.Index
         {
             lock (this)
             {
-                Fields fields = reader.Fields();
+                Fields fields = reader.Fields;
                 if (fields == null)
                 {
                     // this reader has no postings
@@ -618,7 +618,7 @@ namespace Lucene.Net.Index
                         DocValuesFieldUpdates dvUpdates = dvUpdatesContainer.GetUpdates(update.Field, update.Type);
                         if (dvUpdates == null)
                         {
-                            dvUpdates = dvUpdatesContainer.NewUpdates(update.Field, update.Type, reader.MaxDoc());
+                            dvUpdates = dvUpdatesContainer.NewUpdates(update.Field, update.Type, reader.MaxDoc);
                         }
                         int doc;
                         while ((doc = docsEnum.NextDoc()) != DocIdSetIterator.NO_MORE_DOCS)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/CheckIndex.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/CheckIndex.cs b/src/Lucene.Net.Core/Index/CheckIndex.cs
index b8dc100..bbefe6e 100644
--- a/src/Lucene.Net.Core/Index/CheckIndex.cs
+++ b/src/Lucene.Net.Core/Index/CheckIndex.cs
@@ -717,17 +717,17 @@ namespace Lucene.Net.Index
                     {
                         infoStream.Write("    test: check live docs.....");
                     }
-                    int numDocs = reader.NumDocs();
+                    int numDocs = reader.NumDocs;
                     toLoseDocCount = numDocs;
-                    if (reader.HasDeletions())
+                    if (reader.HasDeletions)
                     {
-                        if (reader.NumDocs() != info.Info.DocCount - info.DelCount)
+                        if (reader.NumDocs != info.Info.DocCount - info.DelCount)
                         {
-                            throw new Exception("delete count mismatch: info=" + (info.Info.DocCount - info.DelCount) + " vs reader=" + reader.NumDocs());
+                            throw new Exception("delete count mismatch: info=" + (info.Info.DocCount - info.DelCount) + " vs reader=" + reader.NumDocs);
                         }
-                        if ((info.Info.DocCount - reader.NumDocs()) > reader.MaxDoc())
+                        if ((info.Info.DocCount - reader.NumDocs) > reader.MaxDoc)
                         {
-                            throw new Exception("too many deleted docs: maxDoc()=" + reader.MaxDoc() + " vs del count=" + (info.Info.DocCount - reader.NumDocs()));
+                            throw new Exception("too many deleted docs: maxDoc()=" + reader.MaxDoc + " vs del count=" + (info.Info.DocCount - reader.NumDocs));
                         }
                         if (info.Info.DocCount - numDocs != info.DelCount)
                         {
@@ -777,9 +777,9 @@ namespace Lucene.Net.Index
                         }
                         Msg(infoStream, "OK");
                     }
-                    if (reader.MaxDoc() != info.Info.DocCount)
+                    if (reader.MaxDoc != info.Info.DocCount)
                     {
-                        throw new Exception("SegmentReader.maxDoc() " + reader.MaxDoc() + " != SegmentInfos.docCount " + info.Info.DocCount);
+                        throw new Exception("SegmentReader.maxDoc() " + reader.MaxDoc + " != SegmentInfos.docCount " + info.Info.DocCount);
                     }
 
                     // Test getFieldInfos()
@@ -1539,7 +1539,7 @@ namespace Lucene.Net.Index
                 }
             }
 
-            int fieldCount = fields.Size();
+            int fieldCount = fields.Size;
 
             if (fieldCount != -1)
             {
@@ -1599,7 +1599,7 @@ namespace Lucene.Net.Index
             // crossCheckTermVectors is on...
 
             Status.TermIndexStatus status;
-            int maxDoc = reader.MaxDoc();
+            int maxDoc = reader.MaxDoc;
             Bits liveDocs = reader.LiveDocs;
 
             try
@@ -1609,7 +1609,7 @@ namespace Lucene.Net.Index
                     infoStream.Write("    test: terms, freq, prox...");
                 }
 
-                Fields fields = reader.Fields();
+                Fields fields = reader.Fields;
                 FieldInfos fieldInfos = reader.FieldInfos;
                 status = CheckFields(fields, liveDocs, maxDoc, fieldInfos, true, false, infoStream, verbose);
                 if (liveDocs != null)
@@ -1652,7 +1652,7 @@ namespace Lucene.Net.Index
 
                 // Scan stored fields for all documents
                 Bits liveDocs = reader.LiveDocs;
-                for (int j = 0; j < reader.MaxDoc(); ++j)
+                for (int j = 0; j < reader.MaxDoc; ++j)
                 {
                     // Intentionally pull even deleted documents to
                     // make sure they too are not corrupt:
@@ -1665,7 +1665,7 @@ namespace Lucene.Net.Index
                 }
 
                 // Validate docCount
-                if (status.DocCount != reader.NumDocs())
+                if (status.DocCount != reader.NumDocs)
                 {
                     throw new Exception("docCount=" + status.DocCount + " but saw " + status.DocCount + " undeleted docs");
                 }
@@ -1731,7 +1731,7 @@ namespace Lucene.Net.Index
         private static void CheckBinaryDocValues(string fieldName, AtomicReader reader, BinaryDocValues dv, Bits docsWithField)
         {
             BytesRef scratch = new BytesRef();
-            for (int i = 0; i < reader.MaxDoc(); i++)
+            for (int i = 0; i < reader.MaxDoc; i++)
             {
                 dv.Get(i, scratch);
                 Debug.Assert(scratch.Valid);
@@ -1748,7 +1748,7 @@ namespace Lucene.Net.Index
             int maxOrd = dv.ValueCount - 1;
             FixedBitSet seenOrds = new FixedBitSet(dv.ValueCount);
             int maxOrd2 = -1;
-            for (int i = 0; i < reader.MaxDoc(); i++)
+            for (int i = 0; i < reader.MaxDoc; i++)
             {
                 int ord = dv.GetOrd(i);
                 if (ord == -1)
@@ -1802,7 +1802,7 @@ namespace Lucene.Net.Index
             long maxOrd = dv.ValueCount - 1;
             LongBitSet seenOrds = new LongBitSet(dv.ValueCount);
             long maxOrd2 = -1;
-            for (int i = 0; i < reader.MaxDoc(); i++)
+            for (int i = 0; i < reader.MaxDoc; i++)
             {
                 dv.Document = i;
                 long lastOrd = -1;
@@ -1891,7 +1891,7 @@ namespace Lucene.Net.Index
 
         private static void CheckNumericDocValues(string fieldName, AtomicReader reader, NumericDocValues ndv, Bits docsWithField)
         {
-            for (int i = 0; i < reader.MaxDoc(); i++)
+            for (int i = 0; i < reader.MaxDoc; i++)
             {
                 long value = ndv.Get(i);
                 if (docsWithField.Get(i) == false && value != 0)
@@ -1908,9 +1908,9 @@ namespace Lucene.Net.Index
             {
                 throw new Exception(fi.Name + " docsWithField does not exist");
             }
-            else if (docsWithField.Length() != reader.MaxDoc())
+            else if (docsWithField.Length() != reader.MaxDoc)
             {
-                throw new Exception(fi.Name + " docsWithField has incorrect length: " + docsWithField.Length() + ",expected: " + reader.MaxDoc());
+                throw new Exception(fi.Name + " docsWithField has incorrect length: " + docsWithField.Length() + ",expected: " + reader.MaxDoc);
             }
             switch (fi.DocValuesType)
             {
@@ -1960,7 +1960,7 @@ namespace Lucene.Net.Index
             switch (fi.NormType)
             {
                 case FieldInfo.DocValuesType_e.NUMERIC:
-                    CheckNumericDocValues(fi.Name, reader, reader.GetNormValues(fi.Name), new Lucene.Net.Util.Bits_MatchAllBits(reader.MaxDoc()));
+                    CheckNumericDocValues(fi.Name, reader, reader.GetNormValues(fi.Name), new Lucene.Net.Util.Bits_MatchAllBits(reader.MaxDoc));
                     break;
 
                 default:
@@ -2007,7 +2007,7 @@ namespace Lucene.Net.Index
                 // TODO: testTermsIndex
                 if (crossCheckTermVectors)
                 {
-                    postingsFields = reader.Fields();
+                    postingsFields = reader.Fields;
                 }
                 else
                 {
@@ -2017,7 +2017,7 @@ namespace Lucene.Net.Index
                 TermsEnum termsEnum = null;
                 TermsEnum postingsTermsEnum = null;
 
-                for (int j = 0; j < reader.MaxDoc(); ++j)
+                for (int j = 0; j < reader.MaxDoc; ++j)
                 {
                     // Intentionally pull/visit (but don't count in
                     // stats) deleted documents to make sure they too

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/CompositeReaderContext.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/CompositeReaderContext.cs b/src/Lucene.Net.Core/Index/CompositeReaderContext.cs
index f971d7a..b507aad 100644
--- a/src/Lucene.Net.Core/Index/CompositeReaderContext.cs
+++ b/src/Lucene.Net.Core/Index/CompositeReaderContext.cs
@@ -57,35 +57,38 @@ namespace Lucene.Net.Index
             : base(parent, ordInParent, docbaseInParent)
         {
             this.children = children.ToArray();
-            this.leaves = leaves ?? null;
+            this.leaves = leaves;
             this.reader = reader;
         }
 
-        public override IList<AtomicReaderContext> Leaves()
+        public override IList<AtomicReaderContext> Leaves
         {
-            if (!IsTopLevel)
+            get
             {
-                throw new System.NotSupportedException("this is not a top-level context.");
+                if (!IsTopLevel)
+                {
+                    throw new System.NotSupportedException("this is not a top-level context.");
+                }
+                Debug.Assert(leaves != null);
+                return leaves;
             }
-            Debug.Assert(leaves != null);
-            return leaves;
         }
 
-        public override IList<IndexReaderContext> Children()
+        public override IList<IndexReaderContext> Children
         {
-            return children;
+            get { return children; }
         }
 
-        public override IndexReader Reader()
+        public override IndexReader Reader
         {
-            return reader;
+            get { return reader; }
         }
 
         public sealed class Builder
         {
-            internal readonly CompositeReader Reader;
-            internal readonly IList<AtomicReaderContext> Leaves = new List<AtomicReaderContext>();
-            internal int LeafDocBase = 0;
+            private readonly CompositeReader Reader;
+            private readonly IList<AtomicReaderContext> Leaves = new List<AtomicReaderContext>();
+            private int LeafDocBase = 0;
 
             public Builder(CompositeReader reader)
             {
@@ -99,12 +102,12 @@ namespace Lucene.Net.Index
 
             internal IndexReaderContext Build(CompositeReaderContext parent, IndexReader reader, int ord, int docBase)
             {
-                if (reader is AtomicReader)
+                var ar = reader as AtomicReader;
+                if (ar != null)
                 {
-                    AtomicReader ar = (AtomicReader)reader;
-                    AtomicReaderContext atomic = new AtomicReaderContext(parent, ar, ord, docBase, Leaves.Count, LeafDocBase);
+                    var atomic = new AtomicReaderContext(parent, ar, ord, docBase, Leaves.Count, LeafDocBase);
                     Leaves.Add(atomic);
-                    LeafDocBase += reader.MaxDoc();
+                    LeafDocBase += reader.MaxDoc;
                     return atomic;
                 }
                 else
@@ -126,9 +129,9 @@ namespace Lucene.Net.Index
                     {
                         IndexReader r = sequentialSubReaders[i];
                         children[i] = Build(newParent, r, i, newDocBase);
-                        newDocBase += r.MaxDoc();
+                        newDocBase += r.MaxDoc;
                     }
-                    Debug.Assert(newDocBase == cr.MaxDoc());
+                    Debug.Assert(newDocBase == cr.MaxDoc);
                     return newParent;
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/DocTermOrds.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/DocTermOrds.cs b/src/Lucene.Net.Core/Index/DocTermOrds.cs
index d93d04b..bc1ec9f 100644
--- a/src/Lucene.Net.Core/Index/DocTermOrds.cs
+++ b/src/Lucene.Net.Core/Index/DocTermOrds.cs
@@ -271,7 +271,7 @@ namespace Lucene.Net.Index
             if (IndexedTermsArray == null)
             {
                 //System.out.println("GET normal enum");
-                Fields fields = reader.Fields();
+                Fields fields = reader.Fields;
                 if (fields == null)
                 {
                     return null;
@@ -340,12 +340,12 @@ namespace Lucene.Net.Index
             long startTime = DateTime.Now.Millisecond;
             Prefix = termPrefix == null ? null : BytesRef.DeepCopyOf(termPrefix);
 
-            int maxDoc = reader.MaxDoc();
+            int maxDoc = reader.MaxDoc;
             int[] index = new int[maxDoc]; // immediate term numbers, or the index into the byte[] representing the last number
             int[] lastTerm = new int[maxDoc]; // last term we saw for this document
             sbyte[][] bytes = new sbyte[maxDoc][]; // list of term numbers for the doc (delta encoded vInts)
 
-            Fields fields = reader.Fields();
+            Fields fields = reader.Fields;
             if (fields == null)
             {
                 // No terms
@@ -755,7 +755,7 @@ namespace Lucene.Net.Index
                     InstanceFieldsInitialized = true;
                 }
                 Debug.Assert(outerInstance.IndexedTermsArray != null);
-                TermsEnum = reader.Fields().Terms(outerInstance.Field).Iterator(null);
+                TermsEnum = reader.Fields.Terms(outerInstance.Field).Iterator(null);
             }
 
             public override IComparer<BytesRef> Comparator

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/Fields.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/Fields.cs b/src/Lucene.Net.Core/Index/Fields.cs
index e5d0c9c..7ed6cc5 100644
--- a/src/Lucene.Net.Core/Index/Fields.cs
+++ b/src/Lucene.Net.Core/Index/Fields.cs
@@ -53,11 +53,11 @@ namespace Lucene.Net.Index
         public abstract Terms Terms(string field);
 
         /// <summary>
-        /// Returns the number of fields or -1 if the number of
+        /// Gets the number of fields or -1 if the number of
         /// distinct field names is unknown. If &gt;= 0,
         /// <seealso cref="#iterator"/> will return as many field names.
         /// </summary>
-        public abstract int Size();
+        public abstract int Size { get; }
 
         /// <summary>
         /// Returns the number of terms for all fields, or -1 if this
@@ -69,7 +69,7 @@ namespace Lucene.Net.Index
         ///   to access this statistic for 3.x indexes, which do not
         ///   have this statistic per-field.
         ///  <seealso cref= Terms#size()  </seealso>
-        [Obsolete("iterate fields and add their size() instead.")]
+        [Obsolete("iterate fields and add their Size() instead.")]
         public virtual long UniqueTermCount
         {
             get
@@ -94,7 +94,8 @@ namespace Lucene.Net.Index
         }
 
         /// <summary>
-        /// Zero-length {@code Fields} array. </summary>
+        /// Zero-length {@code Fields} array.
+        /// </summary>
         public static readonly Fields[] EMPTY_ARRAY = new Fields[0];
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/FilterAtomicReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/FilterAtomicReader.cs b/src/Lucene.Net.Core/Index/FilterAtomicReader.cs
index a0e8e91..f142fb8 100644
--- a/src/Lucene.Net.Core/Index/FilterAtomicReader.cs
+++ b/src/Lucene.Net.Core/Index/FilterAtomicReader.cs
@@ -1,5 +1,6 @@
 using System.Collections.Generic;
 using System.Text;
+using Lucene.Net.Search;
 
 namespace Lucene.Net.Index
 {
@@ -66,29 +67,29 @@ namespace Lucene.Net.Index
         {
             /// <summary>
             /// The underlying Fields instance. </summary>
-            protected internal readonly Fields @in;
+            protected internal readonly Fields input;
 
             /// <summary>
             /// Creates a new FilterFields. </summary>
             /// <param name="in"> the underlying Fields instance. </param>
             public FilterFields(Fields @in)
             {
-                this.@in = @in;
+                this.input = @in;
             }
 
             public override IEnumerator<string> GetEnumerator()
             {
-                return @in.GetEnumerator();
+                return input.GetEnumerator();
             }
 
             public override Terms Terms(string field)
             {
-                return @in.Terms(field);
+                return input.Terms(field);
             }
 
-            public override int Size()
+            public override int Size
             {
-                return @in.Size();
+                get { return input.Size; }
             }
         }
 
@@ -420,16 +421,24 @@ namespace Lucene.Net.Index
             return @in.GetTermVectors(docID);
         }
 
-        public override int NumDocs()
+        public override int NumDocs
         {
-            // Don't call ensureOpen() here (it could affect performance)
-            return @in.NumDocs();
+            get
+            {
+                {
+                    // Don't call ensureOpen() here (it could affect performance)
+                    return @in.NumDocs;
+                }
+            }
         }
 
-        public override int MaxDoc()
+        public override int MaxDoc
         {
-            // Don't call ensureOpen() here (it could affect performance)
-            return @in.MaxDoc();
+            get
+            {
+                // Don't call ensureOpen() here (it could affect performance)
+                return @in.MaxDoc;
+            }
         }
 
         public override void Document(int docID, StoredFieldVisitor visitor)
@@ -443,10 +452,13 @@ namespace Lucene.Net.Index
             @in.Dispose();
         }
 
-        public override Fields Fields()
+        public override Fields Fields
         {
-            EnsureOpen();
-            return @in.Fields();
+            get
+            {
+                EnsureOpen();
+                return @in.Fields;
+            }
         }
 
         public override string ToString()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/IndexReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/IndexReader.cs b/src/Lucene.Net.Core/Index/IndexReader.cs
index 8229a6d..f0fd9fa 100644
--- a/src/Lucene.Net.Core/Index/IndexReader.cs
+++ b/src/Lucene.Net.Core/Index/IndexReader.cs
@@ -467,20 +467,20 @@ namespace Lucene.Net.Index
 
         /// <summary>
         /// Returns the number of documents in this index. </summary>
-        public abstract int NumDocs();
+        public abstract int NumDocs { get; }
 
         /// <summary>
         /// Returns one greater than the largest possible document number.
         /// this may be used to, e.g., determine how big to allocate an array which
         /// will have an element for every document number in an index.
         /// </summary>
-        public abstract int MaxDoc();
+        public abstract int MaxDoc { get; }
 
         /// <summary>
         /// Returns the number of deleted documents. </summary>
-        public int NumDeletedDocs()
+        public int NumDeletedDocs
         {
-            return MaxDoc() - NumDocs();
+            get { return MaxDoc - NumDocs; }
         }
 
         /// <summary>
@@ -536,9 +536,14 @@ namespace Lucene.Net.Index
         ///  consider overriding this method if <seealso cref="#maxDoc()"/> or <seealso cref="#numDocs()"/>
         ///  are not constant-time operations.
         /// </summary>
-        public virtual bool HasDeletions()
+        public virtual bool HasDeletions
         {
-            return NumDeletedDocs() > 0;
+            get
+            {
+                {
+                    return NumDeletedDocs > 0;
+                }
+            }
         }
 
         /// <summary> Closes files associated with this index.
@@ -595,9 +600,9 @@ namespace Lucene.Net.Index
         /// Returns the reader's leaves, or itself if this reader is atomic.
         /// this is a convenience method calling {@code this.getContext().leaves()}. </summary>
         /// <seealso cref= IndexReaderContext#leaves() </seealso>
-        public IList<AtomicReaderContext> Leaves()
+        public IList<AtomicReaderContext> Leaves
         {
-            return Context.Leaves();
+            get { return Context.Leaves; }
         }
 
         /// <summary>

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/IndexReaderContext.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/IndexReaderContext.cs b/src/Lucene.Net.Core/Index/IndexReaderContext.cs
index 9962385..a467762 100644
--- a/src/Lucene.Net.Core/Index/IndexReaderContext.cs
+++ b/src/Lucene.Net.Core/Index/IndexReaderContext.cs
@@ -56,7 +56,7 @@ namespace Lucene.Net.Index
 
         /// <summary>
         /// Returns the <seealso cref="IndexReader"/>, this context represents. </summary>
-        public abstract IndexReader Reader();
+        public abstract IndexReader Reader { get; }
 
         /// <summary>
         /// Returns the context's leaves if this context is a top-level context.
@@ -64,14 +64,14 @@ namespace Lucene.Net.Index
         /// returns itself as the only leaf.
         /// <p>Note: this is convenience method since leaves can always be obtained by
         /// walking the context tree using <seealso cref="#children()"/>. </summary>
-        /// <exception cref="UnsupportedOperationException"> if this is not a top-level context. </exception>
+        /// <exception cref="InvalidOperationException"> if this is not a top-level context. </exception>
         /// <seealso cref= #children() </seealso>
-        public abstract IList<AtomicReaderContext> Leaves();
+        public abstract IList<AtomicReaderContext> Leaves { get; }
 
         /// <summary>
         /// Returns the context's children iff this context is a composite context
         /// otherwise <code>null</code>.
         /// </summary>
-        public abstract IList<IndexReaderContext> Children();
+        public abstract IList<IndexReaderContext> Children { get; }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/IndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/IndexWriter.cs b/src/Lucene.Net.Core/Index/IndexWriter.cs
index 6c7c1ec..a393fc5 100644
--- a/src/Lucene.Net.Core/Index/IndexWriter.cs
+++ b/src/Lucene.Net.Core/Index/IndexWriter.cs
@@ -1329,12 +1329,15 @@ namespace Lucene.Net.Index
         ///  docs not yet flushed (still in the RAM buffer),
         ///  not counting deletions. </summary>
         ///  <seealso> cref= #numDocs  </seealso>
-        public virtual int MaxDoc()
+        public virtual int MaxDoc
         {
-            lock (this)
+            get
             {
-                EnsureOpen();
-                return DocWriter.NumDocs + segmentInfos.TotalDocCount();
+                lock (this)
+                {
+                    EnsureOpen();
+                    return DocWriter.NumDocs + segmentInfos.TotalDocCount();
+                }
             }
         }
 
@@ -1630,12 +1633,12 @@ namespace Lucene.Net.Index
                 else
                 {
                     // Composite reader: lookup sub-reader and re-base docID:
-                    IList<AtomicReaderContext> leaves = readerIn.Leaves();
+                    IList<AtomicReaderContext> leaves = readerIn.Leaves;
                     int subIndex = ReaderUtil.SubIndex(docID, leaves);
                     reader = leaves[subIndex].AtomicReader;
                     docID -= leaves[subIndex].DocBase;
                     Debug.Assert(docID >= 0);
-                    Debug.Assert(docID < reader.MaxDoc());
+                    Debug.Assert(docID < reader.MaxDoc);
                 }
 
                 if (!(reader is SegmentReader))
@@ -3221,8 +3224,8 @@ namespace Lucene.Net.Index
                 IList<AtomicReader> mergeReaders = new List<AtomicReader>();
                 foreach (IndexReader indexReader in readers)
                 {
-                    numDocs += indexReader.NumDocs();
-                    foreach (AtomicReaderContext ctx in indexReader.Leaves())
+                    numDocs += indexReader.NumDocs;
+                    foreach (AtomicReaderContext ctx in indexReader.Leaves)
                     {
                         mergeReaders.Add(ctx.AtomicReader);
                     }
@@ -5012,10 +5015,10 @@ namespace Lucene.Net.Index
                     // before we got a read-only copy of the segment's actual live docs
                     // (taking pending deletes into account). In that case we need to
                     // make a new reader with updated live docs and del count.
-                    if (reader.NumDeletedDocs() != delCount)
+                    if (reader.NumDeletedDocs != delCount)
                     {
                         // fix the reader's live docs and del count
-                        Debug.Assert(delCount > reader.NumDeletedDocs()); // beware of zombies
+                        Debug.Assert(delCount > reader.NumDeletedDocs); // beware of zombies
 
                         SegmentReader newReader = new SegmentReader(info, reader, liveDocs, info.Info.DocCount - delCount);
                         bool released = false;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/MergePolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/MergePolicy.cs b/src/Lucene.Net.Core/Index/MergePolicy.cs
index b72b81c..1b98ce4 100644
--- a/src/Lucene.Net.Core/Index/MergePolicy.cs
+++ b/src/Lucene.Net.Core/Index/MergePolicy.cs
@@ -174,7 +174,7 @@ namespace Lucene.Net.Index
                     IList<AtomicReader> readers = new List<AtomicReader>(this.Readers.Count);
                     foreach (AtomicReader reader in this.Readers)
                     {
-                        if (reader.NumDocs() > 0)
+                        if (reader.NumDocs > 0)
                         {
                             readers.Add(reader);
                         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/MergeState.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/MergeState.cs b/src/Lucene.Net.Core/Index/MergeState.cs
index ea7152e..3ea8198 100644
--- a/src/Lucene.Net.Core/Index/MergeState.cs
+++ b/src/Lucene.Net.Core/Index/MergeState.cs
@@ -50,24 +50,24 @@ namespace Lucene.Net.Index
             /// Returns the total number of documents, ignoring
             ///  deletions.
             /// </summary>
-            public abstract int MaxDoc();
+            public abstract int MaxDoc { get; }
 
             /// <summary>
             /// Returns the number of not-deleted documents. </summary>
-            public int NumDocs()
+            public int NumDocs
             {
-                return MaxDoc() - NumDeletedDocs();
+                get { return MaxDoc - NumDeletedDocs; }
             }
 
             /// <summary>
             /// Returns the number of deleted documents. </summary>
-            public abstract int NumDeletedDocs();
+            public abstract int NumDeletedDocs { get; }
 
             /// <summary>
             /// Returns true if there are any deletions. </summary>
             public virtual bool HasDeletions()
             {
-                return NumDeletedDocs() > 0;
+                return NumDeletedDocs > 0;
             }
 
             /// <summary>
@@ -76,8 +76,8 @@ namespace Lucene.Net.Index
             /// </summary>
             public static DocMap Build(AtomicReader reader)
             {
-                int maxDoc = reader.MaxDoc();
-                if (!reader.HasDeletions())
+                int maxDoc = reader.MaxDoc;
+                if (!reader.HasDeletions)
                 {
                     return new NoDelDocMap(maxDoc);
                 }
@@ -128,25 +128,25 @@ namespace Lucene.Net.Index
                     return (int)DocMap.Get(docID);
                 }
 
-                public override int MaxDoc()
+                public override int MaxDoc
                 {
-                    return maxDoc;
+                    get { return maxDoc; }
                 }
 
-                public override int NumDeletedDocs()
+                public override int NumDeletedDocs
                 {
-                    return numDeletedDocs;
+                    get { return numDeletedDocs; }
                 }
             }
         }
 
         private sealed class NoDelDocMap : DocMap
         {
-            internal readonly int MaxDoc_Renamed;
+            internal readonly int maxDoc;
 
             internal NoDelDocMap(int maxDoc)
             {
-                this.MaxDoc_Renamed = maxDoc;
+                this.maxDoc = maxDoc;
             }
 
             public override int Get(int docID)
@@ -154,14 +154,14 @@ namespace Lucene.Net.Index
                 return docID;
             }
 
-            public override int MaxDoc()
+            public override int MaxDoc
             {
-                return MaxDoc_Renamed;
+                get { return maxDoc; }
             }
 
-            public override int NumDeletedDocs()
+            public override int NumDeletedDocs
             {
-                return 0;
+                get { return 0; }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/MultiDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/MultiDocValues.cs b/src/Lucene.Net.Core/Index/MultiDocValues.cs
index d6d66fa..7b340c8 100644
--- a/src/Lucene.Net.Core/Index/MultiDocValues.cs
+++ b/src/Lucene.Net.Core/Index/MultiDocValues.cs
@@ -60,7 +60,7 @@ namespace Lucene.Net.Index
         /// </summary>
         public static NumericDocValues GetNormValues(IndexReader r, string field)
         {
-            IList<AtomicReaderContext> leaves = r.Leaves();
+            IList<AtomicReaderContext> leaves = r.Leaves;
             int size = leaves.Count;
             if (size == 0)
             {
@@ -94,7 +94,7 @@ namespace Lucene.Net.Index
                 values[i] = v;
                 starts[i] = context.DocBase;
             }
-            starts[size] = r.MaxDoc();
+            starts[size] = r.MaxDoc;
 
             Debug.Assert(anyReal);
 
@@ -129,7 +129,7 @@ namespace Lucene.Net.Index
         /// </summary>
         public static NumericDocValues GetNumericValues(IndexReader r, string field)
         {
-            IList<AtomicReaderContext> leaves = r.Leaves();
+            IList<AtomicReaderContext> leaves = r.Leaves;
             int size = leaves.Count;
             if (size == 0)
             {
@@ -158,7 +158,7 @@ namespace Lucene.Net.Index
                 values[i] = v;
                 starts[i] = context.DocBase;
             }
-            starts[size] = r.MaxDoc();
+            starts[size] = r.MaxDoc;
 
             if (!anyReal)
             {
@@ -198,7 +198,7 @@ namespace Lucene.Net.Index
         /// </summary>
         public static Bits GetDocsWithField(IndexReader r, string field)
         {
-            IList<AtomicReaderContext> leaves = r.Leaves();
+            IList<AtomicReaderContext> leaves = r.Leaves;
             int size = leaves.Count;
             if (size == 0)
             {
@@ -219,7 +219,7 @@ namespace Lucene.Net.Index
                 Bits v = context.AtomicReader.GetDocsWithField(field);
                 if (v == null)
                 {
-                    v = new Lucene.Net.Util.Bits_MatchNoBits(context.Reader().MaxDoc());
+                    v = new Lucene.Net.Util.Bits_MatchNoBits(context.Reader.MaxDoc);
                     anyMissing = true;
                 }
                 else
@@ -233,7 +233,7 @@ namespace Lucene.Net.Index
                 values[i] = v;
                 starts[i] = context.DocBase;
             }
-            starts[size] = r.MaxDoc();
+            starts[size] = r.MaxDoc;
 
             if (!anyReal)
             {
@@ -241,7 +241,7 @@ namespace Lucene.Net.Index
             }
             else if (!anyMissing)
             {
-                return new Lucene.Net.Util.Bits_MatchAllBits(r.MaxDoc());
+                return new Lucene.Net.Util.Bits_MatchAllBits(r.MaxDoc);
             }
             else
             {
@@ -258,7 +258,7 @@ namespace Lucene.Net.Index
         /// </summary>
         public static BinaryDocValues GetBinaryValues(IndexReader r, string field)
         {
-            IList<AtomicReaderContext> leaves = r.Leaves();
+            IList<AtomicReaderContext> leaves = r.Leaves;
             int size = leaves.Count;
 
             if (size == 0)
@@ -288,7 +288,7 @@ namespace Lucene.Net.Index
                 values[i] = v;
                 starts[i] = context.DocBase;
             }
-            starts[size] = r.MaxDoc();
+            starts[size] = r.MaxDoc;
 
             if (!anyReal)
             {
@@ -327,7 +327,7 @@ namespace Lucene.Net.Index
         /// </summary>
         public static SortedDocValues GetSortedValues(IndexReader r, string field)
         {
-            IList<AtomicReaderContext> leaves = r.Leaves();
+            IList<AtomicReaderContext> leaves = r.Leaves;
             int size = leaves.Count;
 
             if (size == 0)
@@ -340,7 +340,7 @@ namespace Lucene.Net.Index
             }
 
             bool anyReal = false;
-            SortedDocValues[] values = new SortedDocValues[size];
+            var values = new SortedDocValues[size];
             int[] starts = new int[size + 1];
             for (int i = 0; i < size; i++)
             {
@@ -357,7 +357,7 @@ namespace Lucene.Net.Index
                 values[i] = v;
                 starts[i] = context.DocBase;
             }
-            starts[size] = r.MaxDoc();
+            starts[size] = r.MaxDoc;
 
             if (!anyReal)
             {
@@ -384,7 +384,7 @@ namespace Lucene.Net.Index
         /// </summary>
         public static SortedSetDocValues GetSortedSetValues(IndexReader r, string field)
         {
-            IList<AtomicReaderContext> leaves = r.Leaves();
+            IList<AtomicReaderContext> leaves = r.Leaves;
             int size = leaves.Count;
 
             if (size == 0)
@@ -414,7 +414,7 @@ namespace Lucene.Net.Index
                 values[i] = v;
                 starts[i] = context.DocBase;
             }
-            starts[size] = r.MaxDoc();
+            starts[size] = r.MaxDoc;
 
             if (!anyReal)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/MultiFields.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/MultiFields.cs b/src/Lucene.Net.Core/Index/MultiFields.cs
index b450f1f..71be66d 100644
--- a/src/Lucene.Net.Core/Index/MultiFields.cs
+++ b/src/Lucene.Net.Core/Index/MultiFields.cs
@@ -61,7 +61,7 @@ namespace Lucene.Net.Index
         /// </summary>
         public static Fields GetFields(IndexReader reader)
         {
-            IList<AtomicReaderContext> leaves = reader.Leaves();
+            var leaves = reader.Leaves;
             switch (leaves.Count)
             {
                 case 0:
@@ -70,7 +70,7 @@ namespace Lucene.Net.Index
 
                 case 1:
                     // already an atomic reader / reader with one leave
-                    return leaves[0].AtomicReader.Fields();
+                    return leaves[0].AtomicReader.Fields;
 
                 default:
                     IList<Fields> fields = new List<Fields>();
@@ -78,11 +78,11 @@ namespace Lucene.Net.Index
                     foreach (AtomicReaderContext ctx in leaves)
                     {
                         AtomicReader r = ctx.AtomicReader;
-                        Fields f = r.Fields();
+                        Fields f = r.Fields;
                         if (f != null)
                         {
                             fields.Add(f);
-                            slices.Add(new ReaderSlice(ctx.DocBase, r.MaxDoc(), fields.Count - 1));
+                            slices.Add(new ReaderSlice(ctx.DocBase, r.MaxDoc, fields.Count - 1));
                         }
                     }
                     if (fields.Count == 0)
@@ -113,16 +113,16 @@ namespace Lucene.Net.Index
         /// </summary>
         public static Bits GetLiveDocs(IndexReader reader)
         {
-            if (reader.HasDeletions())
+            if (reader.HasDeletions)
             {
-                IList<AtomicReaderContext> leaves = reader.Leaves();
+                IList<AtomicReaderContext> leaves = reader.Leaves;
                 int size = leaves.Count;
                 Debug.Assert(size > 0, "A reader with deletions must have at least one leave");
                 if (size == 1)
                 {
                     return leaves[0].AtomicReader.LiveDocs;
                 }
-                Bits[] liveDocs = new Bits[size];
+                var liveDocs = new Bits[size];
                 int[] starts = new int[size + 1];
                 for (int i = 0; i < size; i++)
                 {
@@ -131,7 +131,7 @@ namespace Lucene.Net.Index
                     liveDocs[i] = ctx.AtomicReader.LiveDocs;
                     starts[i] = ctx.DocBase;
                 }
-                starts[size] = reader.MaxDoc();
+                starts[size] = reader.MaxDoc;
                 return new MultiBits(liveDocs, starts, true);
             }
             else
@@ -284,9 +284,9 @@ namespace Lucene.Net.Index
             return result;
         }
 
-        public override int Size()
+        public override int Size
         {
-            return -1;
+            get { return -1; }
         }
 
         /// <summary>
@@ -300,8 +300,8 @@ namespace Lucene.Net.Index
         /// </summary>
         public static FieldInfos GetMergedFieldInfos(IndexReader reader)
         {
-            FieldInfos.Builder builder = new FieldInfos.Builder();
-            foreach (AtomicReaderContext ctx in reader.Leaves())
+            var builder = new FieldInfos.Builder();
+            foreach (AtomicReaderContext ctx in reader.Leaves)
             {
                 builder.Add(ctx.AtomicReader.FieldInfos);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2f44e8e/src/Lucene.Net.Core/Index/ParallelAtomicReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/ParallelAtomicReader.cs b/src/Lucene.Net.Core/Index/ParallelAtomicReader.cs
index 5db8267..4364cd8 100644
--- a/src/Lucene.Net.Core/Index/ParallelAtomicReader.cs
+++ b/src/Lucene.Net.Core/Index/ParallelAtomicReader.cs
@@ -58,7 +58,7 @@ namespace Lucene.Net.Index
         private readonly AtomicReader[] ParallelReaders, StoredFieldsReaders;
         private readonly ISet<AtomicReader> CompleteReaderSet = new IdentityHashSet<AtomicReader>();
         private readonly bool CloseSubReaders;
-        private readonly int MaxDoc_Renamed, NumDocs_Renamed;
+        private readonly int maxDoc, numDocs;
         private readonly bool hasDeletions;
         private readonly IDictionary<string, AtomicReader> FieldToReader = new SortedDictionary<string, AtomicReader>();
         private readonly IDictionary<string, AtomicReader> TvFieldToReader = new SortedDictionary<string, AtomicReader>();
@@ -113,13 +113,13 @@ namespace Lucene.Net.Index
             if (ParallelReaders.Length > 0)
             {
                 AtomicReader first = ParallelReaders[0];
-                this.MaxDoc_Renamed = first.MaxDoc();
-                this.NumDocs_Renamed = first.NumDocs();
-                this.hasDeletions = first.HasDeletions();
+                this.maxDoc = first.MaxDoc;
+                this.numDocs = first.NumDocs;
+                this.hasDeletions = first.HasDeletions;
             }
             else
             {
-                this.MaxDoc_Renamed = this.NumDocs_Renamed = 0;
+                this.maxDoc = this.numDocs = 0;
                 this.hasDeletions = false;
             }
             CollectionsHelper.AddAll(CompleteReaderSet, this.ParallelReaders);
@@ -128,9 +128,9 @@ namespace Lucene.Net.Index
             // check compatibility:
             foreach (AtomicReader reader in CompleteReaderSet)
             {
-                if (reader.MaxDoc() != MaxDoc_Renamed)
+                if (reader.MaxDoc != maxDoc)
                 {
-                    throw new System.ArgumentException("All readers must have same maxDoc: " + MaxDoc_Renamed + "!=" + reader.MaxDoc());
+                    throw new System.ArgumentException("All readers must have same maxDoc: " + maxDoc + "!=" + reader.MaxDoc);
                 }
             }
 
@@ -159,7 +159,7 @@ namespace Lucene.Net.Index
             // build Fields instance
             foreach (AtomicReader reader in this.ParallelReaders)
             {
-                Fields readerFields = reader.Fields();
+                Fields readerFields = reader.Fields;
                 if (readerFields != null)
                 {
                     foreach (string field in readerFields)
@@ -232,9 +232,9 @@ namespace Lucene.Net.Index
                 return ret;
             }
 
-            public override int Size()
+            public override int Size
             {
-                return Fields.Count;
+                get { return Fields.Count; }
             }
         }
 
@@ -263,22 +263,31 @@ namespace Lucene.Net.Index
             }
         }
 
-        public override Fields Fields()
+        public override Fields Fields
         {
-            EnsureOpen();
-            return Fields_Renamed;
+            get
+            {
+                EnsureOpen();
+                return Fields_Renamed;
+            }
         }
 
-        public override int NumDocs()
+        public override int NumDocs
         {
-            // Don't call ensureOpen() here (it could affect performance)
-            return NumDocs_Renamed;
+            get
+            {
+                // Don't call ensureOpen() here (it could affect performance)
+                return numDocs;
+            }
         }
 
-        public override int MaxDoc()
+        public override int MaxDoc
         {
-            // Don't call ensureOpen() here (it could affect performance)
-            return MaxDoc_Renamed;
+            get
+            {
+                // Don't call ensureOpen() here (it could affect performance)
+                return maxDoc;
+            }
         }
 
         public override void Document(int docID, StoredFieldVisitor visitor)


Mime
View raw message