lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject lucenenet git commit: More remnants of the sbyte->byte conversion
Date Wed, 31 Dec 2014 22:31:26 GMT
Repository: lucenenet
Updated Branches:
  refs/heads/master 5155ef8c5 -> e86fa731b


More remnants of the sbyte->byte conversion


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

Branch: refs/heads/master
Commit: e86fa731bce62c167ad44bff80e85588c8881041
Parents: 5155ef8
Author: Itamar Syn-Hershko <itamar@code972.com>
Authored: Thu Jan 1 00:31:12 2015 +0200
Committer: Itamar Syn-Hershko <itamar@code972.com>
Committed: Thu Jan 1 00:31:12 2015 +0200

----------------------------------------------------------------------
 .../Codecs/Lucene3x/Lucene3xNormsProducer.cs    |  9 ++----
 .../Codecs/Lucene40/Lucene40DocValuesReader.cs  |  9 ++----
 src/Lucene.Net.Core/Index/ByteSliceReader.cs    |  2 +-
 src/Lucene.Net.Core/Store/DataInput.cs          | 34 ++------------------
 src/Lucene.Net.Core/Store/DataOutput.cs         |  4 +--
 src/Lucene.Net.Core/Util/Packed/Direct8.cs      | 12 +++----
 .../Util/Packed/Packed8ThreeBlocks.cs           | 26 +++++++--------
 .../core/Index/TestCompoundFile.cs              | 10 +++---
 .../core/Index/TestIndexFileDeleter.cs          |  2 +-
 .../core/Index/TestSnapshotDeletionPolicy.cs    |  2 +-
 .../core/Store/TestBufferedIndexInput.cs        |  2 +-
 .../core/Store/TestCopyBytes.cs                 |  6 ++--
 .../core/Store/TestDirectory.cs                 | 10 +++---
 .../core/Store/TestRAMDirectory.cs              |  2 +-
 14 files changed, 47 insertions(+), 83 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xNormsProducer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xNormsProducer.cs b/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xNormsProducer.cs
index ef89580..bffd252 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xNormsProducer.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene3x/Lucene3xNormsProducer.cs
@@ -215,7 +215,7 @@ namespace Lucene.Net.Codecs.Lucene3x
                     {
                         if (Instance_Renamed == null)
                         {
-                            sbyte[] bytes = new sbyte[OuterInstance.Maxdoc];
+                            var bytes = new byte[OuterInstance.Maxdoc];
                             // some norms share fds
                             lock (File)
                             {
@@ -238,13 +238,10 @@ namespace Lucene.Net.Codecs.Lucene3x
 
             private class NumericDocValuesAnonymousInnerClassHelper : NumericDocValues
             {
-                private readonly NormsDocValues OuterInstance;
+                private readonly byte[] Bytes;
 
-                private sbyte[] Bytes;
-
-                public NumericDocValuesAnonymousInnerClassHelper(NormsDocValues outerInstance,
sbyte[] bytes)
+                public NumericDocValuesAnonymousInnerClassHelper(NormsDocValues outerInstance,
byte[] bytes)
                 {
-                    this.OuterInstance = outerInstance;
                     this.Bytes = bytes;
                 }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40DocValuesReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40DocValuesReader.cs b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40DocValuesReader.cs
index 1825397..e89f8a9 100644
--- a/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40DocValuesReader.cs
+++ b/src/Lucene.Net.Core/Codecs/Lucene40/Lucene40DocValuesReader.cs
@@ -224,7 +224,7 @@ namespace Lucene.Net.Codecs.Lucene40
                 throw new CorruptIndexException("invalid valueSize: " + valueSize);
             }
             int maxDoc = State.SegmentInfo.DocCount;
-            sbyte[] values = new sbyte[maxDoc];
+            var values = new byte[maxDoc];
             input.ReadBytes(values, 0, values.Length);
             RamBytesUsed_Renamed.AddAndGet(RamUsageEstimator.SizeOf(values));
             return new NumericDocValuesAnonymousInnerClassHelper3(this, values);
@@ -232,13 +232,10 @@ namespace Lucene.Net.Codecs.Lucene40
 
         private class NumericDocValuesAnonymousInnerClassHelper3 : NumericDocValues
         {
-            private readonly Lucene40DocValuesReader OuterInstance;
-
-            private sbyte[] Values;
+            private readonly byte[] Values;
 
-            public NumericDocValuesAnonymousInnerClassHelper3(Lucene40DocValuesReader outerInstance,
sbyte[] values)
+            public NumericDocValuesAnonymousInnerClassHelper3(Lucene40DocValuesReader outerInstance,
byte[] values)
             {
-                this.OuterInstance = outerInstance;
                 this.Values = values;
             }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Core/Index/ByteSliceReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Index/ByteSliceReader.cs b/src/Lucene.Net.Core/Index/ByteSliceReader.cs
index e432e93..1392ad7 100644
--- a/src/Lucene.Net.Core/Index/ByteSliceReader.cs
+++ b/src/Lucene.Net.Core/Index/ByteSliceReader.cs
@@ -35,7 +35,7 @@ namespace Lucene.Net.Index
     {
         internal ByteBlockPool Pool;
         internal int BufferUpto;
-        internal byte[] Buffer;
+        byte[] Buffer;
         public int Upto;
         internal int Limit;
         internal int Level;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Core/Store/DataInput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/DataInput.cs b/src/Lucene.Net.Core/Store/DataInput.cs
index b259957..60e3b9f 100644
--- a/src/Lucene.Net.Core/Store/DataInput.cs
+++ b/src/Lucene.Net.Core/Store/DataInput.cs
@@ -45,7 +45,7 @@ namespace Lucene.Net.Store
          * threads, then another thread might update the buffer while the checksum is
          * being computed, making it invalid. See LUCENE-5583 for more information.
          */
-        private sbyte[] SkipBuffer;
+        private byte[] SkipBuffer;
 
         /// <summary>
         /// Reads and returns a single byte. </summary>
@@ -85,36 +85,6 @@ namespace Lucene.Net.Store
         }
 
         /// <summary>
-        /// Reads a specified number of bytes into an array at the specified offset. </summary>
-        /// <param name="b"> the array to read bytes into </param>
-        /// <param name="offset"> the offset in the array to start storing bytes </param>
-        /// <param name="len"> the number of bytes to read </param>
-        /// <seealso cref= DataOutput#writeBytes(byte[],int) </seealso>
-        public void ReadBytes(sbyte[] b, int offset, int len)
-        {
-            // helper method to account for java's byte being signed
-            ReadBytes(b, offset, len, false);
-        }
-
-        /// <summary>
-        /// Reads a specified number of bytes into an array at the
-        /// specified offset with control over whether the read
-        /// should be buffered (callers who have their own buffer
-        /// should pass in "false" for useBuffer).  Currently only
-        /// <seealso cref="BufferedIndexInput"/> respects this parameter. </summary>
-        /// <param name="b"> the array to read bytes into </param>
-        /// <param name="offset"> the offset in the array to start storing bytes </param>
-        /// <param name="len"> the number of bytes to read </param>
-        /// <param name="useBuffer"> set to false if the caller will handle
-        /// buffering. </param>
-        /// <seealso cref= DataOutput#writeBytes(byte[],int) </seealso>
-        public void ReadBytes(sbyte[] b, int offset, int len, bool useBuffer)
-        {
-            // helper method to account for java's byte being signed
-            ReadBytes((byte[])(Array)b, offset, len, useBuffer);
-        }
-
-        /// <summary>
         /// Reads two bytes and returns a short. </summary>
         /// <seealso cref= DataOutput#writeByte(byte) </seealso>
         public virtual short ReadShort()
@@ -348,7 +318,7 @@ namespace Lucene.Net.Store
             }
             if (SkipBuffer == null)
             {
-                SkipBuffer = new sbyte[SKIP_BUFFER_SIZE];
+                SkipBuffer = new byte[SKIP_BUFFER_SIZE];
             }
             Debug.Assert(SkipBuffer.Length == SKIP_BUFFER_SIZE);
             for (long skipped = 0; skipped < numBytes; )

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Core/Store/DataOutput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Store/DataOutput.cs b/src/Lucene.Net.Core/Store/DataOutput.cs
index 63edc09..675b7be 100644
--- a/src/Lucene.Net.Core/Store/DataOutput.cs
+++ b/src/Lucene.Net.Core/Store/DataOutput.cs
@@ -267,7 +267,7 @@ namespace Lucene.Net.Store
         }
 
         private const int COPY_BUFFER_SIZE = 16384;
-        private sbyte[] CopyBuffer;
+        private byte[] CopyBuffer;
 
         /// <summary>
         /// Copy numBytes bytes from input to ourself. </summary>
@@ -277,7 +277,7 @@ namespace Lucene.Net.Store
             long left = numBytes;
             if (CopyBuffer == null)
             {
-                CopyBuffer = new sbyte[COPY_BUFFER_SIZE];
+                CopyBuffer = new byte[COPY_BUFFER_SIZE];
             }
             while (left > 0)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Core/Util/Packed/Direct8.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Packed/Direct8.cs b/src/Lucene.Net.Core/Util/Packed/Direct8.cs
index e075d98..c78d804 100644
--- a/src/Lucene.Net.Core/Util/Packed/Direct8.cs
+++ b/src/Lucene.Net.Core/Util/Packed/Direct8.cs
@@ -32,12 +32,12 @@ namespace Lucene.Net.Util.Packed
     /// </summary>
     public sealed class Direct8 : PackedInts.MutableImpl
     {
-        internal readonly sbyte[] Values;
+        readonly byte[] Values;
 
         public Direct8(int valueCount)
             : base(valueCount, 8)
         {
-            Values = new sbyte[valueCount];
+            Values = new byte[valueCount];
         }
 
         internal Direct8(int packedIntsVersion, DataInput @in, int valueCount)
@@ -59,7 +59,7 @@ namespace Lucene.Net.Util.Packed
 
         public override void Set(int index, long value)
         {
-            Values[index] = (sbyte)(value);
+            Values[index] = (byte)(value);
         }
 
         public override long RamBytesUsed()
@@ -69,7 +69,7 @@ namespace Lucene.Net.Util.Packed
 
         public override void Clear()
         {
-            Arrays.Fill(Values, (sbyte)0L);
+            Arrays.Fill(Values, (byte)0L);
         }
 
         public override object Array
@@ -108,7 +108,7 @@ namespace Lucene.Net.Util.Packed
             int sets = Math.Min(valueCount - index, len);
             for (int i = index, o = off, end = index + sets; i < end; ++i, ++o)
             {
-                Values[i] = (sbyte)arr[o];
+                Values[i] = (byte)arr[o];
             }
             return sets;
         }
@@ -116,7 +116,7 @@ namespace Lucene.Net.Util.Packed
         public override void Fill(int fromIndex, int toIndex, long val)
         {
             Debug.Assert(val == (val & 0xFFL));
-            Arrays.Fill(Values, fromIndex, toIndex, (sbyte)val);
+            Arrays.Fill(Values, fromIndex, toIndex, (byte)val);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Core/Util/Packed/Packed8ThreeBlocks.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Core/Util/Packed/Packed8ThreeBlocks.cs b/src/Lucene.Net.Core/Util/Packed/Packed8ThreeBlocks.cs
index 0583348..c064d8e 100644
--- a/src/Lucene.Net.Core/Util/Packed/Packed8ThreeBlocks.cs
+++ b/src/Lucene.Net.Core/Util/Packed/Packed8ThreeBlocks.cs
@@ -32,7 +32,7 @@ namespace Lucene.Net.Util.Packed
     /// </summary>
     public sealed class Packed8ThreeBlocks : PackedInts.MutableImpl
     {
-        internal readonly sbyte[] Blocks;
+        readonly byte[] Blocks;
 
         public static readonly int MAX_SIZE = int.MaxValue / 3;
 
@@ -43,7 +43,7 @@ namespace Lucene.Net.Util.Packed
             {
                 throw new System.IndexOutOfRangeException("MAX_SIZE exceeded");
             }
-            Blocks = new sbyte[valueCount * 3];
+            Blocks = new byte[valueCount * 3];
         }
 
         internal Packed8ThreeBlocks(int packedIntsVersion, DataInput @in, int valueCount)
@@ -51,7 +51,7 @@ namespace Lucene.Net.Util.Packed
         {
             @in.ReadBytes(Blocks, 0, 3 * valueCount);
             // because packed ints have not always been byte-aligned
-            int remaining = (int)(PackedInts.Format.PACKED.ByteCount(packedIntsVersion, valueCount,
24) - 3L * valueCount * 1);
+            var remaining = (int)(PackedInts.Format.PACKED.ByteCount(packedIntsVersion, valueCount,
24) - 3L * valueCount * 1);
             for (int i = 0; i < remaining; ++i)
             {
                 @in.ReadByte();
@@ -81,9 +81,9 @@ namespace Lucene.Net.Util.Packed
         public override void Set(int index, long value)
         {
             int o = index * 3;
-            Blocks[o] = (sbyte)((long)((ulong)value >> 16));
-            Blocks[o + 1] = (sbyte)((long)((ulong)value >> 8));
-            Blocks[o + 2] = (sbyte)value;
+            Blocks[o] = (byte)((long)((ulong)value >> 16));
+            Blocks[o + 1] = (byte)((long)((ulong)value >> 8));
+            Blocks[o + 2] = (byte)value;
         }
 
         public override int Set(int index, long[] arr, int off, int len)
@@ -96,18 +96,18 @@ namespace Lucene.Net.Util.Packed
             for (int i = off, o = index * 3, end = off + sets; i < end; ++i)
             {
                 long value = arr[i];
-                Blocks[o++] = (sbyte)((long)((ulong)value >> 16));
-                Blocks[o++] = (sbyte)((long)((ulong)value >> 8));
-                Blocks[o++] = (sbyte)value;
+                Blocks[o++] = (byte)((long)((ulong)value >> 16));
+                Blocks[o++] = (byte)((long)((ulong)value >> 8));
+                Blocks[o++] = (byte)value;
             }
             return sets;
         }
 
         public override void Fill(int fromIndex, int toIndex, long val)
         {
-            sbyte block1 = (sbyte)((long)((ulong)val >> 16));
-            sbyte block2 = (sbyte)((long)((ulong)val >> 8));
-            sbyte block3 = (sbyte)val;
+            var block1 = (byte)((long)((ulong)val >> 16));
+            var block2 = (byte)((long)((ulong)val >> 8));
+            var block3 = (byte)val;
             for (int i = fromIndex * 3, end = toIndex * 3; i < end; i += 3)
             {
                 Blocks[i] = block1;
@@ -118,7 +118,7 @@ namespace Lucene.Net.Util.Packed
 
         public override void Clear()
         {
-            Arrays.Fill(Blocks, (sbyte)0);
+            Arrays.Fill(Blocks, (byte)0);
         }
 
         public override long RamBytesUsed()

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Tests/core/Index/TestCompoundFile.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestCompoundFile.cs b/src/Lucene.Net.Tests/core/Index/TestCompoundFile.cs
index 055dc5e..af06888 100644
--- a/src/Lucene.Net.Tests/core/Index/TestCompoundFile.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestCompoundFile.cs
@@ -93,8 +93,8 @@ namespace Lucene.Net.Index
             Assert.AreEqual(expected.Length(), test.Length(), msg + " length");
             Assert.AreEqual(expected.FilePointer, test.FilePointer, msg + " position");
 
-            sbyte[] expectedBuffer = new sbyte[512];
-            sbyte[] testBuffer = new sbyte[expectedBuffer.Length];
+            var expectedBuffer = new byte[512];
+            var testBuffer = new byte[expectedBuffer.Length];
 
             long remainder = expected.Length() - expected.FilePointer;
             while (remainder > 0)
@@ -144,7 +144,7 @@ namespace Lucene.Net.Index
             AssertSameStreams(msg + ", seek(end+1)", expected, actual, point);
         }
 
-        private void AssertEqualArrays(string msg, sbyte[] expected, sbyte[] test, int start,
int len)
+        private void AssertEqualArrays(string msg, byte[] expected, byte[] test, int start,
int len)
         {
             Assert.IsNotNull(expected, msg + " null expected");
             Assert.IsNotNull(test, msg + " null test");
@@ -577,10 +577,10 @@ namespace Lucene.Net.Index
         public virtual void TestReadPastEOF()
         {
             SetUp_2();
-            CompoundFileDirectory cr = new CompoundFileDirectory(Dir, "f.comp", NewIOContext(Random()),
false);
+            var cr = new CompoundFileDirectory(Dir, "f.comp", NewIOContext(Random()), false);
             IndexInput @is = cr.OpenInput("f2", NewIOContext(Random()));
             @is.Seek(@is.Length() - 10);
-            sbyte[] b = new sbyte[100];
+            var b = new byte[100];
             @is.ReadBytes(b, 0, 10);
 
             try

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Tests/core/Index/TestIndexFileDeleter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexFileDeleter.cs b/src/Lucene.Net.Tests/core/Index/TestIndexFileDeleter.cs
index d995ccc..05d8342 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexFileDeleter.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexFileDeleter.cs
@@ -195,7 +195,7 @@ namespace Lucene.Net.Index
         {
             IndexInput @in = dir.OpenInput(src, NewIOContext(Random()));
             IndexOutput @out = dir.CreateOutput(dest, NewIOContext(Random()));
-            sbyte[] b = new sbyte[1024];
+            var b = new byte[1024];
             long remainder = @in.Length();
             while (remainder > 0)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs b/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
index eb6d125..3a16e81 100644
--- a/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestSnapshotDeletionPolicy.cs
@@ -272,7 +272,7 @@ namespace Lucene.Net.Index
             }
         }
 
-        internal sbyte[] Buffer = new sbyte[4096];
+        internal byte[] Buffer = new byte[4096];
 
         private void ReadFile(Directory dir, string name)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Tests/core/Store/TestBufferedIndexInput.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Store/TestBufferedIndexInput.cs b/src/Lucene.Net.Tests/core/Store/TestBufferedIndexInput.cs
index bc7fd92..0cfa402 100644
--- a/src/Lucene.Net.Tests/core/Store/TestBufferedIndexInput.cs
+++ b/src/Lucene.Net.Tests/core/Store/TestBufferedIndexInput.cs
@@ -145,7 +145,7 @@ namespace Lucene.Net.Store
             }
         }
 
-        private sbyte[] Buffer = new sbyte[10];
+        private byte[] Buffer = new byte[10];
 
         private void CheckReadBytes(IndexInput input, int size, int pos)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Tests/core/Store/TestCopyBytes.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Store/TestCopyBytes.cs b/src/Lucene.Net.Tests/core/Store/TestCopyBytes.cs
index 0ea1ddf..d8cd1df 100644
--- a/src/Lucene.Net.Tests/core/Store/TestCopyBytes.cs
+++ b/src/Lucene.Net.Tests/core/Store/TestCopyBytes.cs
@@ -29,9 +29,9 @@ namespace Lucene.Net.Store
     [TestFixture]
     public class TestCopyBytes : LuceneTestCase
     {
-        private sbyte Value(int idx)
+        private byte Value(int idx)
         {
-            return unchecked((sbyte)((idx % 256) * (1 + (idx / 256))));
+            return unchecked((byte)((idx % 256) * (1 + (idx / 256))));
         }
 
         [Test]
@@ -48,7 +48,7 @@ namespace Lucene.Net.Store
 
                 // make random file
                 IndexOutput @out = dir.CreateOutput("test", NewIOContext(Random()));
-                sbyte[] bytes = new sbyte[TestUtil.NextInt(Random(), 1, 77777)];
+                var bytes = new byte[TestUtil.NextInt(Random(), 1, 77777)];
                 int size = TestUtil.NextInt(Random(), 1, 1777777);
                 int upto = 0;
                 int byteUpto = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Tests/core/Store/TestDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Store/TestDirectory.cs b/src/Lucene.Net.Tests/core/Store/TestDirectory.cs
index 1fa47b6..d16dfb1 100644
--- a/src/Lucene.Net.Tests/core/Store/TestDirectory.cs
+++ b/src/Lucene.Net.Tests/core/Store/TestDirectory.cs
@@ -166,10 +166,10 @@ namespace Lucene.Net.Store
         {
             DirectoryInfo path = CreateTempDir("testDirectInstantiation");
 
-            sbyte[] largeBuffer = new sbyte[Random().Next(256 * 1024)], largeReadBuffer =
new sbyte[largeBuffer.Length];
+            byte[] largeBuffer = new byte[Random().Next(256 * 1024)], largeReadBuffer = new
byte[largeBuffer.Length];
             for (int i = 0; i < largeBuffer.Length; i++)
             {
-                largeBuffer[i] = (sbyte)i; // automatically loops with modulo
+                largeBuffer[i] = (byte)i; // automatically loops with modulo
             }
 
             FSDirectory[] dirs = new FSDirectory[] { new SimpleFSDirectory(path, null), new
NIOFSDirectory(path, null), new MMapDirectory(path, null) };
@@ -199,14 +199,14 @@ namespace Lucene.Net.Store
                     }
 
                     IndexInput input = d2.OpenInput(fname, NewIOContext(Random()));
-                    Assert.AreEqual((sbyte)i, input.ReadByte());
+                    Assert.AreEqual((byte)i, input.ReadByte());
                     // read array with buffering enabled
-                    Arrays.Fill(largeReadBuffer, (sbyte)0);
+                    Arrays.Fill(largeReadBuffer, (byte)0);
                     input.ReadBytes(largeReadBuffer, 0, largeReadBuffer.Length, true);
                     Assert.AreEqual(largeBuffer, largeReadBuffer);
                     // read again without using buffer
                     input.Seek(1L);
-                    Arrays.Fill(largeReadBuffer, (sbyte)0);
+                    Arrays.Fill(largeReadBuffer, (byte)0);
                     input.ReadBytes(largeReadBuffer, 0, largeReadBuffer.Length, false);
                     Assert.AreEqual(largeBuffer, largeReadBuffer);
                     input.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/e86fa731/src/Lucene.Net.Tests/core/Store/TestRAMDirectory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Store/TestRAMDirectory.cs b/src/Lucene.Net.Tests/core/Store/TestRAMDirectory.cs
index 26c10fb..91aef81 100644
--- a/src/Lucene.Net.Tests/core/Store/TestRAMDirectory.cs
+++ b/src/Lucene.Net.Tests/core/Store/TestRAMDirectory.cs
@@ -214,7 +214,7 @@ namespace Lucene.Net.Store
             RAMDirectory dir = new RAMDirectory();
 
             IndexOutput o = dir.CreateOutput("out", NewIOContext(Random()));
-            sbyte[] bytes = new sbyte[3 * RAMInputStream.BUFFER_SIZE];
+            var bytes = new byte[3 * RAMInputStream.BUFFER_SIZE];
             o.WriteBytes(bytes, 0, bytes.Length);
             o.Dispose();
 


Mime
View raw message