lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [6/8] lucenenet git commit: Refactoring to accomodate changes from long to long?
Date Tue, 10 Feb 2015 23:25:30 GMT
Refactoring to accomodate changes from long to long?


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

Branch: refs/heads/master
Commit: f09f07e5f99e40a6e68da84244fcfaea8fe54233
Parents: d52d7b6
Author: Prescott Nasser <pnasser@apache.org>
Authored: Sun Feb 1 14:13:48 2015 -0800
Committer: Prescott Nasser <pnasser@apache.org>
Committed: Sun Feb 1 14:20:29 2015 -0800

----------------------------------------------------------------------
 .../BlockTerms/BlockTermsReader.cs              |  9 ++++--
 .../BlockTerms/FixedGapTermsIndexReader.cs      |  6 ++--
 .../BlockTerms/TermsIndexReaderBase.cs          |  6 ++--
 .../BlockTerms/VariableGapTermsIndexReader.cs   | 24 ++++++++--------
 .../BlockTerms/VariableGapTermsIndexWriter.cs   |  6 ++--
 .../Memory/FSTOrdTermsWriter.cs                 |  6 ++--
 src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs  |  8 +++---
 src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs  |  2 +-
 .../SimpleText/SimpleTextDocValuesReader.cs     | 12 ++++----
 .../SimpleText/SimpleTextFieldsReader.cs        | 29 ++++++++++----------
 .../SimpleText/SimpleTextStoredFieldsReader.cs  |  2 +-
 .../SimpleText/SimpleTextTermVectorsReader.cs   |  2 +-
 .../SimpleText/SimpleTextUtil.cs                |  8 +++---
 13 files changed, 62 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs
index e6e545f..a627d7c 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsReader.cs
@@ -277,6 +277,11 @@ namespace Lucene.Net.Codecs.BlockTerms
             {
                 return Field.GetHashCode() * 31 + Term.GetHashCode();
             }
+
+            public FieldAndTerm()
+            {
+
+            }
         }
 
         private class FieldReader : Terms
@@ -483,7 +488,7 @@ namespace Lucene.Net.Codecs.BlockTerms
 
                         // Ask terms index to find biggest indexed term (=
                         // first term in a block) that's <= our text:
-                        _input.Seek(_indexEnum.Seek(target));
+                        _input.Seek(_indexEnum.Seek(target).Value);
                         var result = NextBlock();
 
                         // Block must exist since, at least, the indexed term
@@ -806,7 +811,7 @@ namespace Lucene.Net.Codecs.BlockTerms
                     // TODO: if ord is in same terms block and
                     // after current ord, we should avoid this seek just
                     // like we do in the seek(BytesRef) case
-                    _input.Seek(_indexEnum.Seek(ord));
+                    _input.Seek(_indexEnum.Seek(ord).Value);
                     bool result = NextBlock();
 
                     // Block must exist since ord < numTerms:

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
index ec45b30..4bd51a5 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexReader.cs
@@ -253,7 +253,7 @@ namespace Lucene.Net.Codecs.BlockTerms
 
             public override sealed BytesRef Term { get; set; }
 
-            public override long Seek(BytesRef target)
+            public override long? Seek(BytesRef target)
             {
                 var lo = 0; // binary search
                 var hi = _fieldIndex.NumIndexTerms - 1;
@@ -302,7 +302,7 @@ namespace Lucene.Net.Codecs.BlockTerms
                 return _fieldIndex.TermsStart + _fieldIndex.TermsDictOffsets.Get(hi);
             }
 
-            public override long Next
+            public override long? Next
             {
                 get
                 {
@@ -321,7 +321,7 @@ namespace Lucene.Net.Codecs.BlockTerms
                 }
             }
 
-            public override long Seek(long ord)
+            public override long? Seek(long ord)
             {
                 var idx = (int)(ord / _fgtir._totalIndexInterval);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/BlockTerms/TermsIndexReaderBase.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/TermsIndexReaderBase.cs b/src/Lucene.Net.Codecs/BlockTerms/TermsIndexReaderBase.cs
index a3b71cd..7747e91 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/TermsIndexReaderBase.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/TermsIndexReaderBase.cs
@@ -58,7 +58,7 @@ namespace Lucene.Net.Codecs.BlockTerms
         public abstract class FieldIndexEnum
         {
             /** Returns -1 at end */
-            public abstract long Next { get; }
+            public abstract long? Next { get; }
 
             public abstract BytesRef Term { get; set; }
 
@@ -72,14 +72,14 @@ namespace Lucene.Net.Codecs.BlockTerms
             /// <remarks>Only implemented if {@link TermsIndexReaderBase.supportsOrd()}

             /// returns true</remarks>
             /// <returns></returns>
-            public abstract long Seek(long ord);
+            public abstract long? Seek(long ord);
         
             /// <summary> 
             /// Seeks to "largest" indexed term that's less than or equal
             /// to term; returns file pointer index (into the main
             /// terms index file) for that term 
             /// </summary>
-            public abstract long Seek(BytesRef term);
+            public abstract long? Seek(BytesRef term);
         }
 
     }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
index b31ba0d..654ad34 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexReader.cs
@@ -164,7 +164,7 @@ namespace Lucene.Net.Codecs.BlockTerms
 
             private readonly long _indexStart;
             // Set only if terms index is loaded:
-            public volatile FST<long> Fst;
+            public volatile FST<long?> Fst;
             private readonly VariableGapTermsIndexReader _vgtir;
 
             public FieldIndexData(long indexStart, VariableGapTermsIndexReader vgtir)
@@ -182,7 +182,7 @@ namespace Lucene.Net.Codecs.BlockTerms
 
                 var clone = (IndexInput) _vgtir._input.Clone();
                 clone.Seek(_indexStart);
-                Fst = new FST<long>(clone, _vgtir._fstOutputs);
+                Fst = new FST<long?>(clone, _vgtir._fstOutputs);
                 clone.Dispose();
 
                 /*
@@ -198,11 +198,11 @@ namespace Lucene.Net.Codecs.BlockTerms
                     // subsample
                     var scratchIntsRef = new IntsRef();
                     var outputs = PositiveIntOutputs.Singleton;
-                    var builder = new Builder<long>(FST.INPUT_TYPE.BYTE1, outputs);
-                    var fstEnum = new BytesRefFSTEnum<long>(Fst);
+                    var builder = new Builder<long?>(FST.INPUT_TYPE.BYTE1, outputs);
+                    var fstEnum = new BytesRefFSTEnum<long?>(Fst);
                     var count = _vgtir._indexDivisor;
                         
-                    BytesRefFSTEnum<long>.InputOutput<long> result;
+                    BytesRefFSTEnum<long?>.InputOutput<long?> result;
                     while ((result = fstEnum.Next()) != null)
                     {
                         if (count == _vgtir._indexDivisor)
@@ -225,12 +225,12 @@ namespace Lucene.Net.Codecs.BlockTerms
 
         protected class IndexEnum : FieldIndexEnum
         {
-            private readonly BytesRefFSTEnum<long> _fstEnum;
-            private BytesRefFSTEnum<long>.InputOutput<long> _current;
+            private readonly BytesRefFSTEnum<long?> _fstEnum;
+            private BytesRefFSTEnum<long?>.InputOutput<long?> _current;
 
-            public IndexEnum(FST<long> fst)
+            public IndexEnum(FST<long?> fst)
             {
-                _fstEnum = new BytesRefFSTEnum<long>(fst);
+                _fstEnum = new BytesRefFSTEnum<long?>(fst);
             }
 
             public override BytesRef Term
@@ -239,13 +239,13 @@ namespace Lucene.Net.Codecs.BlockTerms
                 set { }
             }
 
-            public override long Seek(BytesRef target)
+            public override long? Seek(BytesRef target)
             {
                 _current = _fstEnum.SeekFloor(target);
                 return _current.Output;
             }
 
-            public override long Next
+            public override long? Next
             {
                 get
                 {
@@ -263,7 +263,7 @@ namespace Lucene.Net.Codecs.BlockTerms
                 set { }
             }
 
-            public override long Seek(long ord)
+            public override long? Seek(long ord)
             {
                 throw new NotImplementedException();
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs
index fdfdce5..cda8851 100644
--- a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs
+++ b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs
@@ -231,7 +231,7 @@ namespace Lucene.Net.Codecs.BlockTerms
 
         private class FstFieldWriter : FieldWriter
         {
-            private readonly Builder<long> _fstBuilder;
+            private readonly Builder<long?> _fstBuilder;
             private readonly long _startTermsFilePointer;
             private readonly BytesRef _lastTerm = new BytesRef();
             private readonly IntsRef _scratchIntsRef = new IntsRef();
@@ -241,14 +241,14 @@ namespace Lucene.Net.Codecs.BlockTerms
 
             public long IndexStart { get; private set; }
             public FieldInfo FieldInfo { get; private set; }
-            public FST<long> Fst { get; private set; }
+            public FST<long?> Fst { get; private set; }
 
             public FstFieldWriter(FieldInfo fieldInfo, long termsFilePointer, VariableGapTermsIndexWriter
vgtiw)
             {
                 _vgtiw = vgtiw;
                 FieldInfo = fieldInfo;
                 PositiveIntOutputs fstOutputs = PositiveIntOutputs.Singleton;
-                _fstBuilder = new Builder<long>(FST.INPUT_TYPE.BYTE1, fstOutputs);
+                _fstBuilder = new Builder<long?>(FST.INPUT_TYPE.BYTE1, fstOutputs);
                 IndexStart = _vgtiw.Output.FilePointer;
 
                 // Always put empty string in

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/Memory/FSTOrdTermsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Memory/FSTOrdTermsWriter.cs b/src/Lucene.Net.Codecs/Memory/FSTOrdTermsWriter.cs
index 4b06045..6106b4d 100644
--- a/src/Lucene.Net.Codecs/Memory/FSTOrdTermsWriter.cs
+++ b/src/Lucene.Net.Codecs/Memory/FSTOrdTermsWriter.cs
@@ -254,7 +254,7 @@ namespace Lucene.Net.Codecs.Memory
             public long SumDocFreq { get; set; }
             public int DocCount { get; set; }
             public int LongsSize { get; set; }
-            public FST<long> Dict { get; set; }
+            public FST<long?> Dict { get; set; }
 
             // TODO: block encode each part 
 
@@ -272,7 +272,7 @@ namespace Lucene.Net.Codecs.Memory
         {
             private readonly FSTOrdTermsWriter _outerInstance;
 
-            private readonly Builder<long> _builder;
+            private readonly Builder<long?> _builder;
             private readonly PositiveIntOutputs _outputs;
             private readonly FieldInfo _fieldInfo;
             private readonly int _longsSize;
@@ -299,7 +299,7 @@ namespace Lucene.Net.Codecs.Memory
                 _fieldInfo = fieldInfo;
                 _longsSize = outerInstance.postingsWriter.SetField(fieldInfo);
                 _outputs = PositiveIntOutputs.Singleton;
-                _builder = new Builder<long>(FST.INPUT_TYPE.BYTE1, _outputs);
+                _builder = new Builder<long?>(FST.INPUT_TYPE.BYTE1, _outputs);
 
                 _lastBlockStatsFp = 0;
                 _lastBlockMetaLongsFp = 0;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs b/src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs
index 5e28982..3ede620 100644
--- a/src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs
+++ b/src/Lucene.Net.Codecs/Memory/FSTTermOutputs.cs
@@ -50,10 +50,10 @@ namespace Lucene.Net.Codecs.Memory
         /// </summary>
         internal class TermData
         {
-            internal readonly long[] LONGS;
-            internal readonly byte[] BYTES;
-            internal readonly int DOC_FREQ;
-            internal readonly long TOTAL_TERM_FREQ;
+            internal long[] LONGS;
+            internal byte[] BYTES;
+            internal int DOC_FREQ;
+            internal long TOTAL_TERM_FREQ;
 
             internal TermData()
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs b/src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs
index 0bd16df..1ab7acc 100644
--- a/src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs
+++ b/src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs
@@ -279,7 +279,7 @@ namespace Lucene.Net.Codecs.Memory
                 var bytesSize = (int) _metaWriter.FilePointer;
                 if (bytesSize > 0)
                 {
-                    meta.BYTES = new sbyte[bytesSize];
+                    meta.BYTES = new byte[bytesSize];
                     _metaWriter.WriteTo(meta.BYTES, 0);
                     _metaWriter.Reset();
                 }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs
index f7b9129..7725777 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextDocValuesReader.cs
@@ -380,7 +380,7 @@ namespace Lucene.Net.Codecs.SimpleText
                 SimpleTextUtil.ReadLine(_input, _scratch);
                 try
                 {
-                    return _scratch.Utf8ToString().ToString(_ordDecoderFormat) - 1;
+                    return int.Parse(Decimal.Parse(_scratch.Utf8ToString()).ToString(_ordDecoderFormat))
- 1;
                 }
                 catch (Exception pe)
                 {
@@ -404,10 +404,10 @@ namespace Lucene.Net.Codecs.SimpleText
                 try
                 {
                     len =
-                        (int)
+                        int.Parse(
                             Decimal.Parse(_scratch.Bytes.SubList(
                                 _scratch.Offset + SimpleTextDocValuesWriter.LENGTH.Length,
-                                _scratch.Length - SimpleTextDocValuesWriter.LENGTH.Length).ToString()).ToString(_decoderFormat);
+                                _scratch.Length - SimpleTextDocValuesWriter.LENGTH.Length).ToString()).ToString(_decoderFormat));
                 }
                 catch (Exception pe)
                 {
@@ -489,10 +489,10 @@ namespace Lucene.Net.Codecs.SimpleText
                 try
                 {
                     len =
-                        (int)
-                            _decoderFormat.parse(_scratch.Bytes.SubList(
+                        int.Parse(
+                            Decimal.Parse(_scratch.Bytes.SubList(
                                 _scratch.Offset + SimpleTextDocValuesWriter.LENGTH.Length,
-                                _scratch.Length - SimpleTextDocValuesWriter.LENGTH.Length).ToString());
+                                _scratch.Length - SimpleTextDocValuesWriter.LENGTH.Length).ToString()).ToString(_decoderFormat));
                 }
                 catch (Exception pe)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsReader.cs
index 9d2f6ff..f283069 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldsReader.cs
@@ -115,14 +115,14 @@ namespace Lucene.Net.Codecs.SimpleText
             private long _totalTermFreq;
             private long _docsStart;
             
-            private readonly BytesRefFSTEnum<PairOutputs<long, PairOutputs.Pair>.Pair>
_fstEnum;
+            private readonly BytesRefFSTEnum<PairOutputs<long?, PairOutputs<long?,long?>.Pair>.Pair>
_fstEnum;
 
             public SimpleTextTermsEnum(SimpleTextFieldsReader outerInstance,
-                FST<PairOutputs<long, PairOutputs.Pair>.Pair> fst, IndexOptions
indexOptions)
+                FST<PairOutputs<long?, PairOutputs<long?,long?>.Pair>.Pair>
fst, IndexOptions indexOptions)
             {
                 _outerInstance = outerInstance;
                 _indexOptions = indexOptions;
-                _fstEnum = new BytesRefFSTEnum<PairOutputs<long, PairOutputs.Pair>.Pair>(fst);
+                _fstEnum = new BytesRefFSTEnum<PairOutputs<long?, PairOutputs<long?,long?>.Pair>.Pair>(fst);
             }
 
             public override bool SeekExact(BytesRef text)
@@ -134,9 +134,9 @@ namespace Lucene.Net.Codecs.SimpleText
                 
                 var pair1 = result.Output;
                 var pair2 = pair1.Output2;
-                _docsStart = pair1.Output1;
+                _docsStart = pair1.Output1.Value;
                 _docFreq = (int) pair2.Output1;
-                _totalTermFreq = pair2.Output2;
+                _totalTermFreq = pair2.Output2.Value;
                 return true;
             }
 
@@ -148,9 +148,9 @@ namespace Lucene.Net.Codecs.SimpleText
 
                 var pair1 = result.Output;
                 var pair2 = pair1.Output2;
-                _docsStart = pair1.Output1;
+                _docsStart = pair1.Output1.Value;
                 _docFreq = (int) pair2.Output1;
-                _totalTermFreq = pair2.Output2;
+                _totalTermFreq = pair2.Output2.Value;
 
                 return result.Input.Equals(text) ? SeekStatus.FOUND : SeekStatus.NOT_FOUND;
 
@@ -164,9 +164,9 @@ namespace Lucene.Net.Codecs.SimpleText
 
                 var pair1 = result.Output;
                 var pair2 = pair1.Output2;
-                _docsStart = pair1.Output1;
+                _docsStart = pair1.Output1.Value;
                 _docFreq = (int)pair2.Output1;
-                _totalTermFreq = pair2.Output2;
+                _totalTermFreq = pair2.Output2.Value;
                 return result.Input;
             }
 
@@ -583,7 +583,7 @@ namespace Lucene.Net.Codecs.SimpleText
             private long _sumTotalTermFreq;
             private long _sumDocFreq;
             private int _docCount;
-            private FST<PairOutputs<long, PairOutputs.Pair>.Pair> _fst;
+            private FST<PairOutputs<long?, PairOutputs<long?,long?>.Pair>.Pair>
_fst;
             private int _termCount;
             private readonly BytesRef _scratch = new BytesRef(10);
             private readonly CharsRef _scratchUtf16 = new CharsRef(10);
@@ -600,12 +600,11 @@ namespace Lucene.Net.Codecs.SimpleText
             private void LoadTerms()
             {
                 var posIntOutputs = PositiveIntOutputs.Singleton;
-                var outputsInner = new PairOutputs<long, long>(posIntOutputs, posIntOutputs);
-                //var outputs = new PairOutputs<long, PairOutputs.Pair<long, long>>(posIntOutputs,
outputsInner);
-                var outputs = new PairOutputs<long, PairOutputs.Pair>(posIntOutputs,
outputsInner);
-
+                var outputsInner = new PairOutputs<long?, long?>(posIntOutputs, posIntOutputs);
+                var outputs = new PairOutputs<long?, PairOutputs<long?,long?>.Pair>(posIntOutputs,
outputsInner);
+                
                 // honestly, wtf kind of generic mess is this.
-                var b = new Builder<PairOutputs<long, PairOutputs.Pair>.Pair>(FST.INPUT_TYPE.BYTE1,
outputs);
+                var b = new Builder<PairOutputs<long?, PairOutputs<long?,long?>.Pair>.Pair>(FST.INPUT_TYPE.BYTE1,
outputs);
                 var input = (IndexInput) _outerInstance._input.Clone();
                 input.Seek(_termsStart);
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs
index dc8e318..3257cf8 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs
@@ -193,7 +193,7 @@ namespace Lucene.Net.Codecs.SimpleText
             }
             else if (Equals(type, SimpleTextStoredFieldsWriter.TYPE_BINARY))
             {
-                var copy = new sbyte[_scratch.Length - SimpleTextStoredFieldsWriter.VALUE.Length];
+                var copy = new byte[_scratch.Length - SimpleTextStoredFieldsWriter.VALUE.Length];
                 Array.Copy(_scratch.Bytes, _scratch.Offset + SimpleTextStoredFieldsWriter.VALUE.Length,
copy, 0, copy.Length);
                 visitor.BinaryField(fieldInfo, copy);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
index c77b8ae..de2a78e 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextTermVectorsReader.cs
@@ -206,7 +206,7 @@ namespace Lucene.Net.Codecs.SimpleText
                                 }
                                 else
                                 {
-                                    var payloadBytes = new sbyte[_scratch.Length - SimpleTextTermVectorsWriter.PAYLOAD.Length];
+                                    var payloadBytes = new byte[_scratch.Length - SimpleTextTermVectorsWriter.PAYLOAD.Length];
                                     Array.Copy(_scratch.Bytes, _scratch.Offset + SimpleTextTermVectorsWriter.PAYLOAD.Length,
payloadBytes, 0,
                                         payloadBytes.Length);
                                     postings.PAYLOADS[k] = new BytesRef(payloadBytes);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/f09f07e5/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
index 3f9a49a..d9cca8f 100644
--- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
+++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextUtil.cs
@@ -29,8 +29,8 @@ namespace Lucene.Net.Codecs.SimpleText
 
     internal class SimpleTextUtil
     {
-        public const sbyte NEWLINE = 10;
-        public const sbyte ESCAPE = 92;
+        public const byte NEWLINE = 10;
+        public const byte ESCAPE = 92;
         internal static readonly BytesRef CHECKSUM = new BytesRef("checksum ");
 
         public static void Write(DataOutput output, string s, BytesRef scratch)
@@ -62,14 +62,14 @@ namespace Lucene.Net.Codecs.SimpleText
             var upto = 0;
             while (true)
             {
-                var b = input.ReadSByte();
+                var b = input.ReadByte();
                 if (scratch.Bytes.Length == upto)
                 {
                     scratch.Grow(1 + upto);
                 }
                 if (b == ESCAPE)
                 {
-                    scratch.Bytes[upto++] = input.ReadSByte();
+                    scratch.Bytes[upto++] = input.ReadByte();
                 }
                 else
                 {


Mime
View raw message