lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [32/45] lucenenet git commit: SWEEP: Consolidated all RectangularArrays calls to a static generic method in Lucene.Net.Support
Date Sun, 30 Apr 2017 21:56:11 GMT
SWEEP: Consolidated all RectangularArrays calls to a static generic method in Lucene.Net.Support


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

Branch: refs/heads/master
Commit: 609ce6dbb0cf5ce97bb1cb2b818083ab1011fd91
Parents: fd338f6
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Sat Apr 29 16:48:19 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Mon May 1 04:48:35 2017 +0700

----------------------------------------------------------------------
 .../Egothor.Stemmer/Diff.cs                     |  7 +-
 .../Lucene.Net.Analysis.Stempel.csproj          |  6 +-
 .../RectangularArrays.cs                        | 52 --------------
 src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj  |  8 +--
 .../Memory/FSTOrdTermsReader.cs                 |  2 +-
 src/Lucene.Net.Codecs/RectangularArrays.cs      | 29 --------
 .../Lucene.Net.Highlighter.csproj               |  6 +-
 .../PostingsHighlight/PostingsHighlighter.cs    |  2 +-
 src/Lucene.Net.Highlighter/RectangularArrays.cs | 29 --------
 .../Spell/LuceneLevenshteinDistance.cs          | 23 +-----
 .../TestPostingsHighlighter.cs                  |  2 +-
 .../SimpleFragmentsBuilderTest.cs               |  2 +-
 .../Suggest/Analyzing/FuzzySuggesterTest.cs     | 22 +-----
 .../Index/TestConsistentFieldNumbers.cs         |  2 +-
 src/Lucene.Net.Tests/Lucene.Net.Tests.csproj    |  3 -
 src/Lucene.Net.Tests/RectangularArrays.cs       | 73 --------------------
 src/Lucene.Net.Tests/Search/TestFieldCache.cs   |  2 +-
 .../Util/Automaton/TestLevenshteinAutomata.cs   |  3 +-
 src/Lucene.Net/Lucene.Net.csproj                |  1 +
 src/Lucene.Net/Support/RectangularArrays.cs     | 33 +++++++++
 20 files changed, 55 insertions(+), 252 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Diff.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Diff.cs b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Diff.cs
index 8f149a9..556a8e5 100644
--- a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Diff.cs
+++ b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/Diff.cs
@@ -1,4 +1,5 @@
-using System;
+using Lucene.Net.Support;
+using System;
 using System.Text;
 
 /*
@@ -198,8 +199,8 @@ namespace Egothor.Stemmer
             {
                 sizex = maxx + 8;
                 sizey = maxy + 8;
-                net = RectangularArrays.ReturnRectangularInt32Array(sizex, sizey);
-                way = RectangularArrays.ReturnRectangularInt32Array(sizex, sizey);
+                net = RectangularArrays.ReturnRectangularArray<int>(sizex, sizey);
+                way = RectangularArrays.ReturnRectangularArray<int>(sizex, sizey);
             }
 
             /*

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj b/src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj
index 02f12d7..508723f 100644
--- a/src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj
+++ b/src/Lucene.Net.Analysis.Stempel/Lucene.Net.Analysis.Stempel.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
  Licensed to the Apache Software Foundation (ASF) under one
@@ -19,7 +19,6 @@
  under the License.
 
 -->
-
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
   <PropertyGroup>
@@ -79,7 +78,6 @@
     <Compile Include="Egothor.Stemmer\Trie.cs" />
     <Compile Include="Pl\PolishAnalyzer.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="RectangularArrays.cs" />
     <Compile Include="Stempel\StempelFilter.cs" />
     <Compile Include="Stempel\StempelPolishStemFilterFactory.cs" />
     <Compile Include="Stempel\StempelStemmer.cs" />
@@ -114,4 +112,4 @@
   <Target Name="AfterBuild">
   </Target>
   -->
-</Project>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Analysis.Stempel/RectangularArrays.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Analysis.Stempel/RectangularArrays.cs b/src/Lucene.Net.Analysis.Stempel/RectangularArrays.cs
deleted file mode 100644
index 2f2dbd0..0000000
--- a/src/Lucene.Net.Analysis.Stempel/RectangularArrays.cs
+++ /dev/null
@@ -1,52 +0,0 @@
-//----------------------------------------------------------------------------------------
-//	Copyright © 2007 - 2013 Tangible Software Solutions Inc.
-//	this class can be used by anyone provided that the copyright notice remains intact.
-//
-//	this class provides the logic to simulate Java rectangular arrays, which are jagged
-//	arrays with inner arrays of the same length. A size of -1 indicates unknown length.
-//----------------------------------------------------------------------------------------
-
-using Lucene.Net.Util;
-
-internal static partial class RectangularArrays
-{
-    internal static int[][] ReturnRectangularInt32Array(int size1, int size2)
-    {
-        int[][] Array;
-        if (size1 > -1)
-        {
-            Array = new int[size1][];
-            if (size2 > -1)
-            {
-                for (int Array1 = 0; Array1 < size1; Array1++)
-                {
-                    Array[Array1] = new int[size2];
-                }
-            }
-        }
-        else
-            Array = null;
-
-        return Array;
-    }
-
-    internal static BytesRef[][] ReturnRectangularBytesRefArray(int size1, int size2)
-    {
-        BytesRef[][] Array;
-        if (size1 > -1)
-        {
-            Array = new BytesRef[size1][];
-            if (size2 > -1)
-            {
-                for (int Array1 = 0; Array1 < size1; Array1++)
-                {
-                    Array[Array1] = new BytesRef[size2];
-                }
-            }
-        }
-        else
-            Array = null;
-
-        return Array;
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj b/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
index 5440c8d..d9203f2 100644
--- a/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
+++ b/src/Lucene.Net.Codecs/Lucene.Net.Codecs.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
  Licensed to the Apache Software Foundation (ASF) under one
@@ -19,7 +19,6 @@
  under the License.
 
 -->
-
 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
   <PropertyGroup>
@@ -112,7 +111,6 @@
     <Compile Include="Pulsing\PulsingPostingsFormat.cs" />
     <Compile Include="Pulsing\PulsingPostingsReader.cs" />
     <Compile Include="Pulsing\PulsingPostingsWriter.cs" />
-    <Compile Include="RectangularArrays.cs" />
     <Compile Include="Sep\IntIndexInput.cs" />
     <Compile Include="Sep\IntIndexOutput.cs" />
     <Compile Include="Sep\IntStreamFactory.cs" />
@@ -142,7 +140,7 @@
     <Compile Include="SimpleText\SimpleTextTermVectorsReader.cs" />
     <Compile Include="SimpleText\SimpleTextTermVectorsWriter.cs" />
     <Compile Include="SimpleText\SimpleTextUtil.cs" />
-	<Compile Include="..\CommonAssemblyInfo.cs">
+    <Compile Include="..\CommonAssemblyInfo.cs">
       <Link>Properties\CommonAssemblyInfo.cs</Link>
     </Compile>
   </ItemGroup>
@@ -163,4 +161,4 @@
   <Target Name="AfterBuild">
   </Target>
   -->
-</Project>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs b/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs
index ccf7a59..9d7e778 100644
--- a/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs
+++ b/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs
@@ -355,7 +355,7 @@ namespace Lucene.Net.Codecs.Memory
                     this.metaLongsReader.Reset(outerInstance.metaLongsBlock);
                     this.metaBytesReader.Reset(outerInstance.metaBytesBlock);
 
-                    this.longs = RectangularArrays.ReturnRectangularInt64Array(INTERVAL,
outerInstance.longsSize);
+                    this.longs = RectangularArrays.ReturnRectangularArray<long>(INTERVAL,
outerInstance.longsSize);
                     this.bytesStart = new int[INTERVAL];
                     this.bytesLength = new int[INTERVAL];
                     this.docFreq_Renamed = new int[INTERVAL];

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Codecs/RectangularArrays.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/RectangularArrays.cs b/src/Lucene.Net.Codecs/RectangularArrays.cs
deleted file mode 100644
index a10b322..0000000
--- a/src/Lucene.Net.Codecs/RectangularArrays.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//----------------------------------------------------------------------------------------
-//	Copyright © 2007 - 2014 Tangible Software Solutions Inc.
-//	This class can be used by anyone provided that the copyright notice remains intact.
-//
-//	This class provides the logic to simulate Java rectangular arrays, which are jagged
-//	arrays with inner arrays of the same length. A size of -1 indicates unknown length.
-//----------------------------------------------------------------------------------------
-internal static partial class RectangularArrays // LUCENENET TODO: Move to Support ?
-{
-    internal static long[][] ReturnRectangularInt64Array(int size1, int size2)
-    {
-        long[][] Array;
-        if (size1 > -1)
-        {
-            Array = new long[size1][];
-            if (size2 > -1)
-            {
-                for (int Array1 = 0; Array1 < size1; Array1++)
-                {
-                    Array[Array1] = new long[size2];
-                }
-            }
-        }
-        else
-            Array = null;
-
-        return Array;
-    }
-}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj b/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
index 38274c1..c1bbe1e 100644
--- a/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
+++ b/src/Lucene.Net.Highlighter/Lucene.Net.Highlighter.csproj
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <!--
 
  Licensed to the Apache Software Foundation (ASF) under one
@@ -19,7 +19,6 @@
  under the License.
 
 -->
-
 <Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
   <PropertyGroup>
@@ -99,7 +98,6 @@
     <Compile Include="PostingsHighlight\PostingsHighlighter.cs" />
     <Compile Include="PostingsHighlight\WholeBreakIterator.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="RectangularArrays.cs" />
     <Compile Include="VectorHighlight\BaseFragListBuilder.cs" />
     <Compile Include="VectorHighlight\BaseFragmentsBuilder.cs" />
     <Compile Include="VectorHighlight\BoundaryScanner.cs" />
@@ -152,4 +150,4 @@
   <Target Name="AfterBuild">
   </Target>
   -->
-</Project>
+</Project>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Highlighter/PostingsHighlight/PostingsHighlighter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/PostingsHighlight/PostingsHighlighter.cs b/src/Lucene.Net.Highlighter/PostingsHighlight/PostingsHighlighter.cs
index 63b9fef..6211042 100644
--- a/src/Lucene.Net.Highlighter/PostingsHighlight/PostingsHighlighter.cs
+++ b/src/Lucene.Net.Highlighter/PostingsHighlight/PostingsHighlighter.cs
@@ -441,7 +441,7 @@ namespace Lucene.Net.Search.PostingsHighlight
         /// </summary>
         protected virtual string[][] LoadFieldValues(IndexSearcher searcher, string[] fields,
int[] docids, int maxLength)
         {
-            string[][] contents = RectangularArrays.ReturnRectangularStringArray(fields.Length,
docids.Length);
+            string[][] contents = RectangularArrays.ReturnRectangularArray<string>(fields.Length,
docids.Length);
             char[] valueSeparators = new char[fields.Length];
             for (int i = 0; i < fields.Length; i++)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Highlighter/RectangularArrays.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Highlighter/RectangularArrays.cs b/src/Lucene.Net.Highlighter/RectangularArrays.cs
deleted file mode 100644
index 03f65dd..0000000
--- a/src/Lucene.Net.Highlighter/RectangularArrays.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-//----------------------------------------------------------------------------------------
-//	Copyright © 2007 - 2014 Tangible Software Solutions Inc.
-//	This class can be used by anyone provided that the copyright notice remains intact.
-//
-//	This class provides the logic to simulate Java rectangular arrays, which are jagged
-//	arrays with inner arrays of the same length. A size of -1 indicates unknown length.
-//----------------------------------------------------------------------------------------
-internal static partial class RectangularArrays
-{
-    internal static string[][] ReturnRectangularStringArray(int size1, int size2)
-    {
-        string[][] Array;
-        if (size1 > -1)
-        {
-            Array = new string[size1][];
-            if (size2 > -1)
-            {
-                for (int Array1 = 0; Array1 < size1; Array1++)
-                {
-                    Array[Array1] = new string[size2];
-                }
-            }
-        }
-        else
-            Array = null;
-
-        return Array;
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Suggest/Spell/LuceneLevenshteinDistance.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Suggest/Spell/LuceneLevenshteinDistance.cs b/src/Lucene.Net.Suggest/Spell/LuceneLevenshteinDistance.cs
index b9f7e41..5f8988b 100644
--- a/src/Lucene.Net.Suggest/Spell/LuceneLevenshteinDistance.cs
+++ b/src/Lucene.Net.Suggest/Spell/LuceneLevenshteinDistance.cs
@@ -69,7 +69,7 @@ namespace Lucene.Net.Search.Spell
             n = targetPoints.Length;
             int m = otherPoints.Length;
 
-            d = ReturnRectangularInt32Array(n + 1, m + 1);
+            d = RectangularArrays.ReturnRectangularArray<int>(n + 1, m + 1);
 
             if (n == 0 || m == 0)
             {
@@ -134,26 +134,5 @@ namespace Lucene.Net.Search.Spell
             }
             return @ref;
         }
-
-        // LUCENENET TODO: Move to Support ?
-        private static int[][] ReturnRectangularInt32Array(int size1, int size2)
-        {
-            int[][] array;
-            if (size1 > -1)
-            {
-                array = new int[size1][];
-                if (size2 > -1)
-                {
-                    for (int Array1 = 0; Array1 < size1; Array1++)
-                    {
-                        array[Array1] = new int[size2];
-                    }
-                }
-            }
-            else
-                array = null;
-
-            return array;
-        }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
b/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
index 7c38b78..dd214f6 100644
--- a/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
+++ b/src/Lucene.Net.Tests.Highlighter/PostingsHighlight/TestPostingsHighlighter.cs
@@ -778,7 +778,7 @@ namespace Lucene.Net.Search.PostingsHighlight
             {
                 Debug.Assert( fields.Length == 1);
                 Debug.Assert( docids.Length == 1);
-                String[][] contents = RectangularArrays.ReturnRectangularStringArray(1, 1);
//= new String[1][1];
+                String[][] contents = RectangularArrays.ReturnRectangularArray<string>(1,
1); //= new String[1][1];
                 contents[0][0] = text;
                 return contents;
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Tests.Highlighter/VectorHighlight/SimpleFragmentsBuilderTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Highlighter/VectorHighlight/SimpleFragmentsBuilderTest.cs
b/src/Lucene.Net.Tests.Highlighter/VectorHighlight/SimpleFragmentsBuilderTest.cs
index b254b22..c197693 100644
--- a/src/Lucene.Net.Tests.Highlighter/VectorHighlight/SimpleFragmentsBuilderTest.cs
+++ b/src/Lucene.Net.Tests.Highlighter/VectorHighlight/SimpleFragmentsBuilderTest.cs
@@ -269,7 +269,7 @@ namespace Lucene.Net.Search.VectorHighlight
             for (int i = 0; i < numDocs; i++)
             {
                 Document document = new Document();
-                String[][] fields = RectangularArrays.ReturnRectangularStringArray(numFields,
numTerms); //new String[numFields][numTerms];
+                String[][] fields = RectangularArrays.ReturnRectangularArray<string>(numFields,
numTerms); //new String[numFields][numTerms];
                 for (int j = 0; j < numFields; j++)
                 {
                     String[] fieldValues = new String[numTerms];

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
index 96494cd..3380d7c 100644
--- a/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
+++ b/src/Lucene.Net.Tests.Suggest/Suggest/Analyzing/FuzzySuggesterTest.cs
@@ -1340,7 +1340,7 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             n = targetPoints.Length;
             int m = otherPoints.Length;
 
-            d = ReturnRectangularIntArray(n + 1, m + 1);
+            d = RectangularArrays.ReturnRectangularArray<int>(n + 1, m + 1);
 
 
             if (n == 0 || m == 0)
@@ -1393,26 +1393,6 @@ namespace Lucene.Net.Search.Suggest.Analyzing
             return d[n][m];
         }
 
-        internal static int[][] ReturnRectangularIntArray(int size1, int size2)
-        {
-            int[][] array;
-            if (size1 > -1)
-            {
-                array = new int[size1][];
-                if (size2 > -1)
-                {
-                    for (int Array1 = 0; Array1 < size1; Array1++)
-                    {
-                        array[Array1] = new int[size2];
-                    }
-                }
-            }
-            else
-                array = null;
-
-            return array;
-        }
-
         private static Int32sRef ToIntsRef(string s)
         {
             Int32sRef @ref = new Int32sRef(s.Length); // worst case

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Tests/Index/TestConsistentFieldNumbers.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestConsistentFieldNumbers.cs b/src/Lucene.Net.Tests/Index/TestConsistentFieldNumbers.cs
index ca36407..9fef2b4 100644
--- a/src/Lucene.Net.Tests/Index/TestConsistentFieldNumbers.cs
+++ b/src/Lucene.Net.Tests/Index/TestConsistentFieldNumbers.cs
@@ -249,7 +249,7 @@ namespace Lucene.Net.Index
             int NUM_DOCS = AtLeast(200);
             int MAX_FIELDS = AtLeast(50);
 
-            int[][] docs = RectangularArrays.ReturnRectangularIntArray(NUM_DOCS, 4);
+            int[][] docs = RectangularArrays.ReturnRectangularArray<int>(NUM_DOCS,
4);
             for (int i = 0; i < docs.Length; i++)
             {
                 for (int j = 0; j < docs[i].Length; j++)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj b/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
index df8cea4..bc1008b 100644
--- a/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
+++ b/src/Lucene.Net.Tests/Lucene.Net.Tests.csproj
@@ -360,9 +360,6 @@
     <Compile Include="Index\TestTwoPhaseCommitTool.cs" />
     <Compile Include="Index\TestUniqueTermCount.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
-    <Compile Include="RectangularArrays.cs">
-      <SubType>Code</SubType>
-    </Compile>
     <Compile Include="Search\BaseTestRangeFilter.cs" />
     <Compile Include="Search\FuzzyTermOnShortTermsTest.cs" />
     <Compile Include="Search\JustCompileSearch.cs" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Tests/RectangularArrays.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/RectangularArrays.cs b/src/Lucene.Net.Tests/RectangularArrays.cs
deleted file mode 100644
index fad2f5a..0000000
--- a/src/Lucene.Net.Tests/RectangularArrays.cs
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-
-//----------------------------------------------------------------------------------------
-//	Copyright � 2007 - 2013 Tangible Software Solutions Inc.
-//	this class can be used by anyone provided that the copyright notice remains intact.
-//
-//	this class provides the logic to simulate Java rectangular arrays, which are jagged
-//	arrays with inner arrays of the same length. A size of -1 indicates unknown length.
-//----------------------------------------------------------------------------------------
-
-using Lucene.Net.Util;
-
-internal static partial class RectangularArrays
-{
-    internal static int[][] ReturnRectangularIntArray(int Size1, int Size2)
-    {
-        int[][] Array;
-        if (Size1 > -1)
-        {
-            Array = new int[Size1][];
-            if (Size2 > -1)
-            {
-                for (int Array1 = 0; Array1 < Size1; Array1++)
-                {
-                    Array[Array1] = new int[Size2];
-                }
-            }
-        }
-        else
-            Array = null;
-
-        return Array;
-    }
-
-    internal static BytesRef[][] ReturnRectangularBytesRefArray(int Size1, int Size2)
-    {
-        BytesRef[][] Array;
-        if (Size1 > -1)
-        {
-            Array = new BytesRef[Size1][];
-            if (Size2 > -1)
-            {
-                for (int Array1 = 0; Array1 < Size1; Array1++)
-                {
-                    Array[Array1] = new BytesRef[Size2];
-                }
-            }
-        }
-        else
-            Array = null;
-
-        return Array;
-    }
-}

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Tests/Search/TestFieldCache.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Search/TestFieldCache.cs b/src/Lucene.Net.Tests/Search/TestFieldCache.cs
index 3dab2cc..b360751 100644
--- a/src/Lucene.Net.Tests/Search/TestFieldCache.cs
+++ b/src/Lucene.Net.Tests/Search/TestFieldCache.cs
@@ -119,7 +119,7 @@ namespace Lucene.Net.Search
             float theFloat = float.MaxValue;
             UnicodeStrings = new string[NUM_DOCS];
             //MultiValued = new BytesRef[NUM_DOCS, NUM_ORDS];
-            MultiValued = RectangularArrays.ReturnRectangularBytesRefArray(NUM_DOCS, NUM_ORDS);
+            MultiValued = RectangularArrays.ReturnRectangularArray<BytesRef>(NUM_DOCS,
NUM_ORDS);
             if (VERBOSE)
             {
                 Console.WriteLine("TEST: setUp");

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net.Tests/Util/Automaton/TestLevenshteinAutomata.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Util/Automaton/TestLevenshteinAutomata.cs b/src/Lucene.Net.Tests/Util/Automaton/TestLevenshteinAutomata.cs
index 2b5df06..f23d2a2 100644
--- a/src/Lucene.Net.Tests/Util/Automaton/TestLevenshteinAutomata.cs
+++ b/src/Lucene.Net.Tests/Util/Automaton/TestLevenshteinAutomata.cs
@@ -1,3 +1,4 @@
+using Lucene.Net.Support;
 using NUnit.Framework;
 using System;
 using System.Collections.Generic;
@@ -378,7 +379,7 @@ namespace Lucene.Net.Util.Automaton
             sa = target.ToCharArray();
             n = sa.Length;
             int m = other.Length;
-            d = RectangularArrays.ReturnRectangularIntArray(n + 1, m + 1);
+            d = RectangularArrays.ReturnRectangularArray<int>(n + 1, m + 1);
 
             if (n == 0 || m == 0)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net/Lucene.Net.csproj
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Lucene.Net.csproj b/src/Lucene.Net/Lucene.Net.csproj
index 13e6e20..eb166ac 100644
--- a/src/Lucene.Net/Lucene.Net.csproj
+++ b/src/Lucene.Net/Lucene.Net.csproj
@@ -652,6 +652,7 @@
     <Compile Include="Support\IO\FileStreamExtensions.cs" />
     <Compile Include="Support\ICallable.cs" />
     <Compile Include="Support\ICharSequence.cs" />
+    <Compile Include="Support\RectangularArrays.cs" />
     <Compile Include="Support\Threading\ICompletionService.cs" />
     <Compile Include="Support\IO\IDataInput.cs" />
     <Compile Include="Support\IO\IDataOutput.cs" />

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/609ce6db/src/Lucene.Net/Support/RectangularArrays.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net/Support/RectangularArrays.cs b/src/Lucene.Net/Support/RectangularArrays.cs
new file mode 100644
index 0000000..a3a33da
--- /dev/null
+++ b/src/Lucene.Net/Support/RectangularArrays.cs
@@ -0,0 +1,33 @@
+//----------------------------------------------------------------------------------------
+//	Copyright � 2007 - 2013 Tangible Software Solutions Inc.
+//	this class can be used by anyone provided that the copyright notice remains intact.
+//
+//	this class provides the logic to simulate Java rectangular arrays, which are jagged
+//	arrays with inner arrays of the same length. A size of -1 indicates unknown length.
+//----------------------------------------------------------------------------------------
+
+namespace Lucene.Net.Support
+{
+    public static class RectangularArrays
+    {
+        public static T[][] ReturnRectangularArray<T>(int size1, int size2)
+        {
+            T[][] array;
+            if (size1 > -1)
+            {
+                array = new T[size1][];
+                if (size2 > -1)
+                {
+                    for (int array1 = 0; array1 < size1; array1++)
+                    {
+                        array[array1] = new T[size2];
+                    }
+                }
+            }
+            else
+                array = null;
+
+            return array;
+        }
+    }
+}
\ No newline at end of file


Mime
View raw message