lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [09/50] [abbrv] lucenenet git commit: Fixed Substring bugs because of the difference between the Java and .NET Substring function.
Date Sun, 11 Sep 2016 21:30:40 GMT
Fixed Substring bugs because of the difference between the Java and .NET Substring function.


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

Branch: refs/heads/master
Commit: 11ecedc63aa53beed200d573357d9fc56b6987fb
Parents: 4e04b59
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sun Jul 31 21:07:05 2016 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Fri Sep 2 22:30:10 2016 +0700

----------------------------------------------------------------------
 Lucene.Net.QueryParser/Classic/QueryParser.cs           | 4 ++--
 Lucene.Net.QueryParser/Classic/QueryParserBase.cs       | 4 ++--
 Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/11ecedc6/Lucene.Net.QueryParser/Classic/QueryParser.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.QueryParser/Classic/QueryParser.cs b/Lucene.Net.QueryParser/Classic/QueryParser.cs
index f8b414f..e86c716 100644
--- a/Lucene.Net.QueryParser/Classic/QueryParser.cs
+++ b/Lucene.Net.QueryParser/Classic/QueryParser.cs
@@ -485,7 +485,7 @@ namespace Lucene.Net.QueryParser.Classic
                     bool endOpen = false;
                     if (goop1.kind == RegexpToken.RANGE_QUOTED)
                     {
-                        goop1.image = goop1.image.Substring(1, goop1.image.Length - 1);
+                        goop1.image = goop1.image.Substring(1, goop1.image.Length - 2);
                     }
                     else if ("*".Equals(goop1.image))
                     {
@@ -493,7 +493,7 @@ namespace Lucene.Net.QueryParser.Classic
                     }
                     if (goop2.kind == RegexpToken.RANGE_QUOTED)
                     {
-                        goop2.image = goop2.image.Substring(1, goop2.image.Length - 1);
+                        goop2.image = goop2.image.Substring(1, goop2.image.Length - 2);
                     }
                     else if ("*".Equals(goop2.image))
                     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/11ecedc6/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.QueryParser/Classic/QueryParserBase.cs b/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
index 8445c38..0449187 100644
--- a/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
+++ b/Lucene.Net.QueryParser/Classic/QueryParserBase.cs
@@ -817,7 +817,7 @@ namespace Lucene.Net.QueryParser.Classic
             }
             else if (regexp)
             {
-                q = GetRegexpQuery(qfield, term.image.Substring(1, term.image.Length - 1));
+                q = GetRegexpQuery(qfield, term.image.Substring(1, term.image.Length - 2));
             }
             else if (fuzzy)
             {
@@ -863,7 +863,7 @@ namespace Lucene.Net.QueryParser.Classic
                 }
                 catch (Exception ignored) { }
             }
-            return GetFieldQuery(qfield, DiscardEscapeChar(term.image.Substring(1, term.image.Length
- 1)), s);
+            return GetFieldQuery(qfield, DiscardEscapeChar(term.image.Substring(1, term.image.Length
- 2)), s);
         }
 
         // extracted from the .jj grammar

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/11ecedc6/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
----------------------------------------------------------------------
diff --git a/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs b/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
index 495391a..235c8ae 100644
--- a/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
+++ b/Lucene.Net.Tests.QueryParser/Classic/TestQueryParser.cs
@@ -184,7 +184,7 @@ namespace Lucene.Net.QueryParser.Classic
                     float fms = FuzzyMinSim;
                     try
                     {
-                        fms = float.Parse(fuzzySlop.image.Substring(1, fuzzySlop.image.Length
- 1));
+                        fms = float.Parse(fuzzySlop.image.Substring(1, fuzzySlop.image.Length
- 2));
                     }
                     catch (Exception ignored) { }
                     float value = float.Parse(termImage);


Mime
View raw message