lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [23/26] lucenenet git commit: SWEEP: Removed unnecessary (byte[])(Array) casts solution-wide.
Date Wed, 08 Mar 2017 18:23:59 GMT
SWEEP: Removed unnecessary (byte[])(Array) casts solution-wide.


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

Branch: refs/heads/api-work
Commit: e2042a4b3bf6f37b803fd79701fe2e9630233652
Parents: d252c68
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Mar 8 23:24:33 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Thu Mar 9 01:11:07 2017 +0700

----------------------------------------------------------------------
 src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs             | 6 +++---
 .../Codecs/Compressing/CompressingStoredFieldsReader.cs        | 4 ++--
 .../Codecs/Compressing/CompressingTermVectorsReader.cs         | 2 +-
 .../Codecs/Lucene40/Lucene40StoredFieldsReader.cs              | 2 +-
 src/Lucene.Net.Core/Store/BufferedChecksum.cs                  | 2 +-
 src/Lucene.Net.Core/Store/BufferedIndexOutput.cs               | 4 ++--
 src/Lucene.Net.Core/Util/WAH8DocIdSet.cs                       | 2 +-
 .../Analysis/MockFixedLengthPayloadFilter.cs                   | 2 +-
 .../Analysis/MockVariableLengthPayloadFilter.cs                | 2 +-
 .../Index/BasePostingsFormatTestCase.cs                        | 4 ++--
 .../Index/BaseTermVectorsFormatTestCase.cs                     | 2 +-
 src/Lucene.Net.Tests/Document/TestBinaryDocument.cs            | 2 +-
 src/Lucene.Net.Tests/Index/Test2BBinaryDocValues.cs            | 2 +-
 src/Lucene.Net.Tests/Index/TestDocValuesIndexing.cs            | 2 +-
 src/Lucene.Net.Tests/Index/TestIndexInput.cs                   | 2 +-
 src/Lucene.Net.Tests/Index/TestPayloads.cs                     | 2 +-
 src/Lucene.Net.Tests/Search/Spans/TestPayloadSpans.cs          | 6 +++---
 src/Lucene.Net.Tests/Search/TestPositionIncrement.cs           | 2 +-
 src/Lucene.Net.Tests/Store/TestMultiMMap.cs                    | 2 +-
 src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs                     | 4 ++--
 src/Lucene.Net.Tests/Util/Packed/TestPackedInts.cs             | 2 +-
 src/Lucene.Net.Tests/Util/TestOfflineSorter.cs                 | 2 +-
 22 files changed, 30 insertions(+), 30 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs b/src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs
index b632250..b796306 100644
--- a/src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs
+++ b/src/Lucene.Net.Core/Codecs/BlockTreeTermsReader.cs
@@ -569,7 +569,7 @@ namespace Lucene.Net.Codecs
                 //   System.out.println("BTTR: seg=" + segment + " field=" + fieldInfo.name
+ " rootBlockCode=" + rootCode + " divisor=" + indexDivisor);
                 // }
 
-                rootBlockFP = (int)((uint)(new ByteArrayDataInput((byte[])(Array)rootCode.Bytes,
rootCode.Offset, rootCode.Length)).ReadVInt64() >> BlockTreeTermsWriter.OUTPUT_FLAGS_NUM_BITS);
+                rootBlockFP = (int)((uint)(new ByteArrayDataInput(rootCode.Bytes, rootCode.Offset,
rootCode.Length)).ReadVInt64() >> BlockTreeTermsWriter.OUTPUT_FLAGS_NUM_BITS);
 
                 if (indexIn != null)
                 {
@@ -1388,7 +1388,7 @@ namespace Lucene.Net.Codecs
                             }
 
                             byte[] suffixBytes = currentFrame.suffixBytes;
-                            byte[] commonSuffixBytes = (byte[])(Array)compiledAutomaton.CommonSuffixRef.Bytes;
+                            byte[] commonSuffixBytes = compiledAutomaton.CommonSuffixRef.Bytes;
 
                             int lenInPrefix = compiledAutomaton.CommonSuffixRef.Length -
currentFrame.suffix;
                             Debug.Assert(compiledAutomaton.CommonSuffixRef.Offset == 0);
@@ -1763,7 +1763,7 @@ namespace Lucene.Net.Codecs
                 // Pushes a frame we seek'd to
                 internal Frame PushFrame(FST.Arc<BytesRef> arc, BytesRef frameData,
int length)
                 {
-                    scratchReader.Reset((byte[])(Array)frameData.Bytes, frameData.Offset,
frameData.Length);
+                    scratchReader.Reset(frameData.Bytes, frameData.Offset, frameData.Length);
                     long code = scratchReader.ReadVInt64();
                     long fpSeek = (long)((ulong)code >> BlockTreeTermsWriter.OUTPUT_FLAGS_NUM_BITS);
                     Frame f = GetFrame(1 + currentFrame.ord);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsReader.cs b/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsReader.cs
index 48d55d8..a2c54bb 100644
--- a/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsReader.cs
+++ b/src/Lucene.Net.Core/Codecs/Compressing/CompressingStoredFieldsReader.cs
@@ -199,7 +199,7 @@ namespace Lucene.Net.Codecs.Compressing
                     data = new byte[length];
                     @in.ReadBytes(data, 0, length);
 #pragma warning disable 612, 618
-                    visitor.StringField(info, IOUtils.CHARSET_UTF_8.GetString((byte[])(Array)data));
+                    visitor.StringField(info, IOUtils.CHARSET_UTF_8.GetString(data));
 #pragma warning restore 612, 618
                     break;
 
@@ -341,7 +341,7 @@ namespace Lucene.Net.Codecs.Compressing
                 BytesRef bytes = totalLength <= BUFFER_REUSE_THRESHOLD ? this.bytes :
new BytesRef();
                 decompressor.Decompress(fieldsStream, totalLength, offset, length, bytes);
                 Debug.Assert(bytes.Length == length);
-                documentInput = new ByteArrayDataInput((byte[])(Array)bytes.Bytes, bytes.Offset,
bytes.Length);
+                documentInput = new ByteArrayDataInput(bytes.Bytes, bytes.Offset, bytes.Length);
             }
 
             for (int fieldIDX = 0; fieldIDX < numStoredFields; fieldIDX++)

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsReader.cs b/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsReader.cs
index 47f4e34..4ceb916 100644
--- a/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsReader.cs
+++ b/src/Lucene.Net.Core/Codecs/Compressing/CompressingTermVectorsReader.cs
@@ -814,7 +814,7 @@ namespace Lucene.Net.Codecs.Compressing
                 {
                     termsEnum = new TVTermsEnum();
                 }
-                termsEnum.Reset(numTerms, flags, prefixLengths, suffixLengths, termFreqs,
positionIndex, positions, startOffsets, lengths, payloadIndex, payloadBytes, new ByteArrayDataInput((byte[])(Array)termBytes.Bytes,
termBytes.Offset, termBytes.Length));
+                termsEnum.Reset(numTerms, flags, prefixLengths, suffixLengths, termFreqs,
positionIndex, positions, startOffsets, lengths, payloadIndex, payloadBytes, new ByteArrayDataInput(termBytes.Bytes,
termBytes.Offset, termBytes.Length));
                 return termsEnum;
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsReader.cs b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsReader.cs
index ad88ab3..db8a3eb 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsReader.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40StoredFieldsReader.cs
@@ -229,7 +229,7 @@ namespace Lucene.Net.Codecs.Lucene40
                 else
                 {
 #pragma warning disable 612, 618
-                    visitor.StringField(info, IOUtils.CHARSET_UTF_8.GetString((byte[])(Array)bytes));
+                    visitor.StringField(info, IOUtils.CHARSET_UTF_8.GetString(bytes));
 #pragma warning restore 612, 618
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Core/Store/BufferedChecksum.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/BufferedChecksum.cs b/src/Lucene.Net.Core/Store/BufferedChecksum.cs
index e2eb23f..1232b32 100644
--- a/src/Lucene.Net.Core/Store/BufferedChecksum.cs
+++ b/src/Lucene.Net.Core/Store/BufferedChecksum.cs
@@ -68,7 +68,7 @@ namespace Lucene.Net.Store
             if (len >= buffer.Length)
             {
                 Flush();
-                @in.Update((byte[])(Array)b, off, len);
+                @in.Update(b, off, len);
             }
             else
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Core/Store/BufferedIndexOutput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/BufferedIndexOutput.cs b/src/Lucene.Net.Core/Store/BufferedIndexOutput.cs
index b542ac7..2d7ab47 100644
--- a/src/Lucene.Net.Core/Store/BufferedIndexOutput.cs
+++ b/src/Lucene.Net.Core/Store/BufferedIndexOutput.cs
@@ -92,7 +92,7 @@ namespace Lucene.Net.Store
                         Flush();
                     }
                     // and write data at once
-                    crc.Update((byte[])(Array)b, offset, length);
+                    crc.Update(b, offset, length);
                     FlushBuffer(b, offset, length);
                     bufferStart += length;
                 }
@@ -121,7 +121,7 @@ namespace Lucene.Net.Store
 
         public override void Flush()
         {
-            crc.Update((byte[])(Array)buffer, 0, bufferPosition);
+            crc.Update(buffer, 0, bufferPosition);
             FlushBuffer(buffer, bufferPosition);
             bufferStart += bufferPosition;
             bufferPosition = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Core/Util/WAH8DocIdSet.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/WAH8DocIdSet.cs b/src/Lucene.Net.Core/Util/WAH8DocIdSet.cs
index dad410c..9e418ab 100644
--- a/src/Lucene.Net.Core/Util/WAH8DocIdSet.cs
+++ b/src/Lucene.Net.Core/Util/WAH8DocIdSet.cs
@@ -463,7 +463,7 @@ namespace Lucene.Net.Util
                     return EMPTY;
                 }
                 WriteSequence();
-                byte[] data = Arrays.CopyOf((byte[])(Array)@out.Bytes, @out.Length);
+                byte[] data = Arrays.CopyOf(@out.Bytes, @out.Length);
 
                 // Now build the index
                 int valueCount = (numSequences - 1) / indexInterval + 1;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.TestFramework/Analysis/MockFixedLengthPayloadFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Analysis/MockFixedLengthPayloadFilter.cs b/src/Lucene.Net.TestFramework/Analysis/MockFixedLengthPayloadFilter.cs
index 7970544..6c7a8b2 100644
--- a/src/Lucene.Net.TestFramework/Analysis/MockFixedLengthPayloadFilter.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/MockFixedLengthPayloadFilter.cs
@@ -49,7 +49,7 @@ namespace Lucene.Net.Analysis
         {
             if (m_input.IncrementToken())
             {
-                Random.NextBytes((byte[])(Array)Bytes);
+                Random.NextBytes(Bytes);
                 PayloadAtt.Payload = Payload;
                 return true;
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.TestFramework/Analysis/MockVariableLengthPayloadFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Analysis/MockVariableLengthPayloadFilter.cs b/src/Lucene.Net.TestFramework/Analysis/MockVariableLengthPayloadFilter.cs
index 22d5b3a..e6fa08f 100644
--- a/src/Lucene.Net.TestFramework/Analysis/MockVariableLengthPayloadFilter.cs
+++ b/src/Lucene.Net.TestFramework/Analysis/MockVariableLengthPayloadFilter.cs
@@ -46,7 +46,7 @@ namespace Lucene.Net.Analysis
         {
             if (m_input.IncrementToken())
             {
-                Random.NextBytes((byte[])(Array)Bytes);
+                Random.NextBytes(Bytes);
                 Payload.Length = Random.Next(MAXLENGTH);
                 PayloadAtt.Payload = Payload;
                 return true;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
index 637aced..c04a439 100644
--- a/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BasePostingsFormatTestCase.cs
@@ -260,7 +260,7 @@ namespace Lucene.Net.Index
                     if (FixedPayloads)
                     {
                         Payload_Renamed.Length = PayloadSize;
-                        Random.NextBytes((byte[])(Array)Payload_Renamed.Bytes);
+                        Random.NextBytes(Payload_Renamed.Bytes);
                     }
                     else
                     {
@@ -268,7 +268,7 @@ namespace Lucene.Net.Index
                         if (thisPayloadSize != 0)
                         {
                             Payload_Renamed.Length = PayloadSize;
-                            Random.NextBytes((byte[])(Array)Payload_Renamed.Bytes);
+                            Random.NextBytes(Payload_Renamed.Bytes);
                         }
                         else
                         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
index a7deafe..a039b40 100644
--- a/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
+++ b/src/Lucene.Net.TestFramework/Index/BaseTermVectorsFormatTestCase.cs
@@ -174,7 +174,7 @@ namespace Lucene.Net.Index
                 return null;
             }
             BytesRef payload = new BytesRef(len);
-            Random().NextBytes((byte[])(Array)payload.Bytes);
+            Random().NextBytes(payload.Bytes);
             payload.Length = len;
             return payload;
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs b/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs
index 839fa30..0fd7d90 100644
--- a/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs
+++ b/src/Lucene.Net.Tests/Document/TestBinaryDocument.cs
@@ -74,7 +74,7 @@ namespace Lucene.Net.Documents
             BytesRef bytes = docFromReader.GetBinaryValue("binaryStored");
             Assert.IsNotNull(bytes);
 
-            string binaryFldStoredTest = Encoding.UTF8.GetString((byte[])(Array)bytes.Bytes).Substring(bytes.Offset,
bytes.Length);
+            string binaryFldStoredTest = Encoding.UTF8.GetString(bytes.Bytes).Substring(bytes.Offset,
bytes.Length);
             //new string(bytes.Bytes, bytes.Offset, bytes.Length, IOUtils.CHARSET_UTF_8);
             Assert.IsTrue(binaryFldStoredTest.Equals(BinaryValStored));
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Index/Test2BBinaryDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/Test2BBinaryDocValues.cs b/src/Lucene.Net.Tests/Index/Test2BBinaryDocValues.cs
index 5281e27..d3a3e23 100644
--- a/src/Lucene.Net.Tests/Index/Test2BBinaryDocValues.cs
+++ b/src/Lucene.Net.Tests/Index/Test2BBinaryDocValues.cs
@@ -157,7 +157,7 @@ namespace Lucene.Net.Index
                 for (int i = 0; i < reader.MaxDoc; i++)
                 {
                     dv.Get(i, scratch);
-                    input.Reset((byte[])(Array)scratch.Bytes, scratch.Offset, scratch.Length);
+                    input.Reset(scratch.Bytes, scratch.Offset, scratch.Length);
                     Assert.AreEqual(expectedValue % 65535, input.ReadVInt32());
                     Assert.IsTrue(input.Eof);
                     expectedValue++;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Index/TestDocValuesIndexing.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestDocValuesIndexing.cs b/src/Lucene.Net.Tests/Index/TestDocValuesIndexing.cs
index f46110b..5ee1a7a 100644
--- a/src/Lucene.Net.Tests/Index/TestDocValuesIndexing.cs
+++ b/src/Lucene.Net.Tests/Index/TestDocValuesIndexing.cs
@@ -442,7 +442,7 @@ namespace Lucene.Net.Index
             Document doc = new Document();
             byte[] bytes = new byte[100000];
             BytesRef b = new BytesRef(bytes);
-            Random().NextBytes((byte[])(Array)bytes);
+            Random().NextBytes(bytes);
             doc.Add(new SortedSetDocValuesField("dv", b));
             try
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Index/TestIndexInput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestIndexInput.cs b/src/Lucene.Net.Tests/Index/TestIndexInput.cs
index a0ded79..a2ffea1 100644
--- a/src/Lucene.Net.Tests/Index/TestIndexInput.cs
+++ b/src/Lucene.Net.Tests/Index/TestIndexInput.cs
@@ -180,7 +180,7 @@ namespace Lucene.Net.Index
         [Test]
         public virtual void TestByteArrayDataInput()
         {
-            ByteArrayDataInput @is = new ByteArrayDataInput((byte[])(Array)READ_TEST_BYTES);
+            ByteArrayDataInput @is = new ByteArrayDataInput(READ_TEST_BYTES);
             CheckReads(@is, typeof(Exception));
             @is = new ByteArrayDataInput(RANDOM_TEST_BYTES);
             CheckRandomReads(@is);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Index/TestPayloads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Index/TestPayloads.cs b/src/Lucene.Net.Tests/Index/TestPayloads.cs
index 5c106d9..bba39e5 100644
--- a/src/Lucene.Net.Tests/Index/TestPayloads.cs
+++ b/src/Lucene.Net.Tests/Index/TestPayloads.cs
@@ -572,7 +572,7 @@ namespace Lucene.Net.Index
                 this.Pool = pool;
                 Payload = pool.Get();
                 OuterInstance.GenerateRandomData(Payload);
-                Term = Encoding.UTF8.GetString((byte[])(Array)Payload);
+                Term = Encoding.UTF8.GetString(Payload);
                 First = true;
                 PayloadAtt = AddAttribute<IPayloadAttribute>();
                 TermAtt = AddAttribute<ICharTermAttribute>();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Search/Spans/TestPayloadSpans.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Search/Spans/TestPayloadSpans.cs b/src/Lucene.Net.Tests/Search/Spans/TestPayloadSpans.cs
index d50a062..1190fa2 100644
--- a/src/Lucene.Net.Tests/Search/Spans/TestPayloadSpans.cs
+++ b/src/Lucene.Net.Tests/Search/Spans/TestPayloadSpans.cs
@@ -322,7 +322,7 @@ namespace Lucene.Net.Search.Spans
                     var payloads = spans.GetPayload();
                     foreach (var payload in payloads)
                     {
-                        payloadSet.Add(Encoding.UTF8.GetString((byte[])(Array)payload));
+                        payloadSet.Add(Encoding.UTF8.GetString(payload));
                     }
                 }
             }
@@ -401,7 +401,7 @@ namespace Lucene.Net.Search.Spans
                 Console.WriteLine("Num payloads:" + payloads.Count);
                 foreach (var bytes in payloads)
                 {
-                    Console.WriteLine(Encoding.UTF8.GetString((byte[])(Array)bytes));
+                    Console.WriteLine(Encoding.UTF8.GetString(bytes));
                 }
             }
             reader.Dispose();
@@ -484,7 +484,7 @@ namespace Lucene.Net.Search.Spans
                         Console.WriteLine("payloads for span:" + payload.Count);
                         foreach (var bytes in payload)
                         {
-                            Console.WriteLine("doc:" + spans.Doc + " s:" + spans.Start +
" e:" + spans.End + " " + Encoding.UTF8.GetString((byte[])(Array)bytes));
+                            Console.WriteLine("doc:" + spans.Doc + " s:" + spans.Start +
" e:" + spans.End + " " + Encoding.UTF8.GetString(bytes));
                         }
                     }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Search/TestPositionIncrement.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Search/TestPositionIncrement.cs b/src/Lucene.Net.Tests/Search/TestPositionIncrement.cs
index 090ddcc..52bf9e0 100644
--- a/src/Lucene.Net.Tests/Search/TestPositionIncrement.cs
+++ b/src/Lucene.Net.Tests/Search/TestPositionIncrement.cs
@@ -280,7 +280,7 @@ namespace Lucene.Net.Search
                     count++;
                     if (VERBOSE)
                     {
-                        Console.WriteLine("  payload: " + Encoding.UTF8.GetString((byte[])(Array)bytes));
+                        Console.WriteLine("  payload: " + Encoding.UTF8.GetString(bytes));
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Store/TestMultiMMap.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Store/TestMultiMMap.cs b/src/Lucene.Net.Tests/Store/TestMultiMMap.cs
index 8341b1a..99baad2 100644
--- a/src/Lucene.Net.Tests/Store/TestMultiMMap.cs
+++ b/src/Lucene.Net.Tests/Store/TestMultiMMap.cs
@@ -279,7 +279,7 @@ namespace Lucene.Net.Store
                 MMapDirectory mmapDir = new MMapDirectory(CreateTempDir("testSeekEnd"), null,
1 << i);
                 IndexOutput io = mmapDir.CreateOutput("bytes", NewIOContext(Random()));
                 var bytes = new byte[1 << i];
-                Random().NextBytes((byte[])(Array)bytes);
+                Random().NextBytes(bytes);
                 io.WriteBytes(bytes, bytes.Length);
                 io.Dispose();
                 IndexInput ii = mmapDir.OpenInput("bytes", NewIOContext(Random()));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs b/src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs
index 4a22f6d..efce2e5 100644
--- a/src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs
+++ b/src/Lucene.Net.Tests/Util/Fst/Test2BFST.cs
@@ -187,7 +187,7 @@ namespace Lucene.Net.Util.Fst
                             {
                                 Console.WriteLine(i + "...: ");
                             }
-                            r.NextBytes((byte[])(Array)outputBytes);
+                            r.NextBytes(outputBytes);
                             Assert.AreEqual(output, Util.Get(fst, input));
                             NextInput(r, ints);
                         }
@@ -206,7 +206,7 @@ namespace Lucene.Net.Util.Fst
                                 break;
                             }
                             Assert.AreEqual(input, pair.Input);
-                            r.NextBytes((byte[])(Array)outputBytes);
+                            r.NextBytes(outputBytes);
                             Assert.AreEqual(output, pair.Output);
                             upto++;
                             NextInput(r, ints);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Util/Packed/TestPackedInts.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Util/Packed/TestPackedInts.cs b/src/Lucene.Net.Tests/Util/Packed/TestPackedInts.cs
index 6c64516..e428586 100644
--- a/src/Lucene.Net.Tests/Util/Packed/TestPackedInts.cs
+++ b/src/Lucene.Net.Tests/Util/Packed/TestPackedInts.cs
@@ -1350,7 +1350,7 @@ namespace Lucene.Net.Util.Packed
                 byte[] buf = new byte[(int)fp];
                 in1.ReadBytes(buf, 0, (int)fp);
                 in1.Seek(0L);
-                ByteArrayDataInput in2 = new ByteArrayDataInput((byte[])(Array)buf);
+                ByteArrayDataInput in2 = new ByteArrayDataInput(buf);
                 DataInput @in = Random().NextBoolean() ? (DataInput)in1 : in2;
                 BlockPackedReaderIterator it = new BlockPackedReaderIterator(@in, PackedInt32s.VERSION_CURRENT,
blockSize, valueCount);
                 for (int i = 0; i < valueCount; )

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e2042a4b/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs b/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs
index 2d32203..204c93a 100644
--- a/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs
+++ b/src/Lucene.Net.Tests/Util/TestOfflineSorter.cs
@@ -118,7 +118,7 @@ namespace Lucene.Net.Util
             while (howMuchData > 0)
             {
                 byte[] current = new byte[Random().Next(256)];
-                Random().NextBytes((byte[])(Array)current);
+                Random().NextBytes(current);
                 data.Add(current);
                 howMuchData -= current.Length;
             }


Mime
View raw message