You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucenenet.apache.org by sy...@apache.org on 2014/09/19 16:19:38 UTC

[05/21] git commit: Fixed BaseDocIdSetTestCase.TestAgainstBitSet

Fixed BaseDocIdSetTestCase.TestAgainstBitSet

Arrays.Fill's exception logic changed to be exactly like Java's
Arrays.fill. Basically, the new logic allows fromIndex to be equal to
toIndex. This change prevents a harmless, but test-breaking exception
from failing this test.


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

Branch: refs/heads/master
Commit: 99262d730a5f89022f1e7a722232a7cb393cdd77
Parents: 021236d
Author: Prad Nelluru <pr...@microsoft.com>
Authored: Tue Sep 16 15:43:23 2014 -0700
Committer: Prad Nelluru <pr...@microsoft.com>
Committed: Tue Sep 16 15:43:23 2014 -0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Support/Arrays.cs | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/99262d73/src/Lucene.Net.Core/Support/Arrays.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Support/Arrays.cs b/src/Lucene.Net.Core/Support/Arrays.cs
index 97510ef..578e1f7 100644
--- a/src/Lucene.Net.Core/Support/Arrays.cs
+++ b/src/Lucene.Net.Core/Support/Arrays.cs
@@ -33,12 +33,10 @@ namespace Lucene.Net.Support
 
         public static void Fill<T>(T[] a, int fromIndex, int toIndex, T val)
         {
-            if (fromIndex < 0 || fromIndex >= a.Length)
+            //Java Arrays.fill exception logic
+            if(fromIndex > toIndex || fromIndex < 0 || toIndex > a.Length)
                 throw new ArgumentOutOfRangeException("fromIndex");
 
-            if (toIndex < 0 || toIndex > a.Length || toIndex < fromIndex)
-                throw new ArgumentOutOfRangeException("toIndex");
-
             for (int i = fromIndex; i < toIndex; i++)
             {
                 a[i] = val;