lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [23/39] lucenenet git commit: Lucene.Net.Analysis.Miscellaneous.SingleTokenTokenStream refactor: changed Token property to GetToken() and SetToken(Token) (makes a clone each way)
Date Sat, 04 Feb 2017 20:32:42 GMT
Lucene.Net.Analysis.Miscellaneous.SingleTokenTokenStream refactor: changed Token property to
GetToken() and SetToken(Token) (makes a clone each way)


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

Branch: refs/heads/api-work
Commit: 0697c7a4c14b6ba341ebff33e3409e375e826bd2
Parents: 4abfb34
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Feb 5 00:39:07 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Sun Feb 5 00:39:07 2017 +0700

----------------------------------------------------------------------
 .../Analysis/Miscellaneous/SingleTokenTokenStream.cs      | 10 +++++++---
 .../Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs  |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0697c7a4/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
index cf8b0b9..ff1a0ca 100644
--- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
+++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/SingleTokenTokenStream.cs
@@ -61,10 +61,14 @@ namespace Lucene.Net.Analysis.Miscellaneous
             exhausted = false;
         }
 
-        public Token Token // LUCENENET TODO: Change to GetToken() and SetToken() (conversion)
+        public Token GetToken() // LUCENENET NOTE: These remain methods because they make
a conversion of the value
         {
-            get { return (Token)singleToken.Clone(); }
-            set { this.singleToken = (Token)value.Clone(); }
+            return (Token)singleToken.Clone();
+        }
+
+        public void SetToken(Token token)
+        {
+            this.singleToken = (Token)token.Clone();
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/0697c7a4/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs
b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs
index 614e0b3..a3da13c 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Miscellaneous/TestSingleTokenTokenFilter.cs
@@ -38,7 +38,7 @@ namespace Lucene.Net.Analysis.Miscellaneous
             assertFalse(ts.IncrementToken());
 
             token = new Token("hallo", 10, 20, "someType");
-            ts.Token = token;
+            ts.SetToken(token);
             ts.Reset();
 
             assertTrue(ts.IncrementToken());


Mime
View raw message