lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [39/50] [abbrv] lucenenet git commit: BUG: Lucene.Net.Core.Analysis.TokenStream: Return false in the case where IncrementToken doesn't exist.
Date Wed, 15 Mar 2017 23:50:21 GMT
BUG: Lucene.Net.Core.Analysis.TokenStream: Return false in the case where IncrementToken doesn't
exist.


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

Branch: refs/heads/api-work
Commit: 2608d1613fd66ccb403531629268dc12ad598956
Parents: 8319239
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Mar 15 22:05:14 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Mar 15 22:05:14 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Analysis/TokenStream.cs | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/2608d161/src/Lucene.Net.Core/Analysis/TokenStream.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Analysis/TokenStream.cs b/src/Lucene.Net.Core/Analysis/TokenStream.cs
index 75a4bef..f32092f 100644
--- a/src/Lucene.Net.Core/Analysis/TokenStream.cs
+++ b/src/Lucene.Net.Core/Analysis/TokenStream.cs
@@ -125,7 +125,10 @@ namespace Lucene.Net.Analysis
                 throw new InvalidOperationException("TokenStream implementation classes or
at least their IncrementToken() implementation must be marked sealed");
             }
 
-            return true;
+            // type.GetMethod returns null if the method doesn't exist.
+            // To emulate Lucene (which catches a NoSuchMethodException),
+            // we need to return false in that case.
+            return method != null;
         }
 
         /// <summary>


Mime
View raw message