lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: Removing ugly method (still a few left to go)
Date Thu, 19 Feb 2015 10:49:30 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master a3220b511 -> 529416776


Removing ugly method (still a few left to go)


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

Branch: refs/heads/master
Commit: 52941677627fff826c2ded1e01247d2136f1d0ab
Parents: a3220b5
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Thu Feb 19 12:49:20 2015 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Thu Feb 19 12:49:20 2015 +0200

----------------------------------------------------------------------
 src/Lucene.Net.Core/Index/FilterAtomicReader.cs | 24 ++++++++------------
 .../Index/AssertingAtomicReader.cs              |  6 ++---
 2 files changed, 13 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52941677/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 2a993c5..2265b17 100644
--- a/src/Lucene.Net.Core/Index/FilterAtomicReader.cs
+++ b/src/Lucene.Net.Core/Index/FilterAtomicReader.cs
@@ -261,50 +261,46 @@ namespace Lucene.Net.Index
         public class FilterDocsEnum : DocsEnum
         {
             /// <summary>
-            /// The underlying DocsEnum instance. </summary>
-            protected internal readonly DocsEnum @in;
+            /// The underlying DocsEnum instance.
+            /// </summary>
+            public DocsEnum DocsEnum { get; private set; }
 
             /// <summary>
             /// Create a new FilterDocsEnum </summary>
             /// <param name="in"> the underlying DocsEnum instance. </param>
             public FilterDocsEnum(DocsEnum @in)
             {
-                this.@in = @in;
-            }
-
-            public DocsEnum DocsEnumIn_Nunit()
-            {
-                return @in;
+                this.DocsEnum = @in;
             }
 
             public override AttributeSource Attributes()
             {
-                return @in.Attributes();
+                return DocsEnum.Attributes();
             }
 
             public override int DocID()
             {
-                return @in.DocID();
+                return DocsEnum.DocID();
             }
 
             public override int Freq()
             {
-                return @in.Freq();
+                return DocsEnum.Freq();
             }
 
             public override int NextDoc()
             {
-                return @in.NextDoc();
+                return DocsEnum.NextDoc();
             }
 
             public override int Advance(int target)
             {
-                return @in.Advance(target);
+                return DocsEnum.Advance(target);
             }
 
             public override long Cost()
             {
-                return @in.Cost();
+                return DocsEnum.Cost();
             }
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/52941677/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 649a0e4..37c72c2 100644
--- a/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs
+++ b/src/Lucene.Net.TestFramework/Index/AssertingAtomicReader.cs
@@ -136,7 +136,7 @@ namespace Lucene.Net.Index
                 // and randomly *not* unwrap?
                 if (reuse is AssertingDocsEnum)
                 {
-                    reuse = ((AssertingDocsEnum)reuse).DocsEnumIn_Nunit();
+                    reuse = ((AssertingDocsEnum)reuse).DocsEnum;
                 }
                 DocsEnum docs = base.Docs(liveDocs, reuse, flags);
                 return docs == null ? null : new AssertingDocsEnum(docs);
@@ -291,7 +291,7 @@ namespace Lucene.Net.Index
             {
                 Debug.Assert(State != DocsEnumState.FINISHED, "nextDoc() called after NO_MORE_DOCS");
                 int nextDoc = base.NextDoc();
-                Debug.Assert(nextDoc > Doc, "backwards nextDoc from " + Doc + " to " +
nextDoc + " " + @in);
+                Debug.Assert(nextDoc > Doc, "backwards nextDoc from " + Doc + " to " +
nextDoc + " " + DocsEnum);
                 if (nextDoc == DocIdSetIterator.NO_MORE_DOCS)
                 {
                     State = DocsEnumState.FINISHED;
@@ -324,7 +324,7 @@ namespace Lucene.Net.Index
 
             public override int DocID()
             {
-                Debug.Assert(Doc == base.DocID(), " invalid docID() in " + @in.GetType()
+ " " + base.DocID() + " instead of " + Doc);
+                Debug.Assert(Doc == base.DocID(), " invalid docID() in " + DocsEnum.GetType()
+ " " + base.DocID() + " instead of " + Doc);
                 return Doc;
             }
 


Mime
View raw message