lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nightowl...@apache.org
Subject [06/50] [abbrv] lucenenet git commit: Lucene.Net.Tests: suppressed obsolete warnings
Date Wed, 25 Jan 2017 03:43:50 GMT
Lucene.Net.Tests: suppressed obsolete warnings


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

Branch: refs/heads/api-work
Commit: 15efa51c31ac7898aab7c08faa64de627e2a8a68
Parents: 86686bf
Author: Shad Storhaug <shad@shadstorhaug.com>
Authored: Wed Jan 25 02:58:26 2017 +0700
Committer: Shad Storhaug <shad@shadstorhaug.com>
Committed: Wed Jan 25 09:34:45 2017 +0700

----------------------------------------------------------------------
 .../core/Codecs/Lucene3x/TestSurrogates.cs      |  2 ++
 .../Codecs/Lucene3x/TestTermInfosReaderIndex.cs |  2 ++
 .../core/Document/TestDocument.cs               |  2 ++
 .../core/Index/TestBackwardsCompatibility3x.cs  |  2 ++
 .../core/Index/TestBagOfPostings.cs             |  2 ++
 src/Lucene.Net.Tests/core/Index/TestCodecs.cs   |  4 ++++
 .../core/Index/TestDirectoryReader.cs           |  4 ++++
 .../core/Index/TestDocValuesWithThreads.cs      |  2 ++
 .../core/Index/TestIndexWriterUnicode.cs        |  2 ++
 .../core/Index/TestIndexableField.cs            |  2 ++
 .../core/Index/TestMultiFields.cs               |  2 ++
 src/Lucene.Net.Tests/core/Index/TestPayloads.cs |  6 +++++
 .../core/Index/TestStoredFieldsFormat.cs        |  2 ++
 .../core/Index/TestTermVectorsFormat.cs         |  2 ++
 .../core/Search/Spans/TestBasics.cs             | 10 ++++++++
 .../TestControlledRealTimeReopenThread.cs       |  6 ++++-
 .../core/Search/TestFieldCache.cs               |  6 +++++
 .../core/Search/TestFieldCacheRangeFilter.cs    |  5 ++++
 .../core/Search/TestSearchAfter.cs              | 25 +++++++++++++++++++-
 src/Lucene.Net.Tests/core/Search/TestSort.cs    | 16 +++++++++++++
 .../core/Search/TestSortDocValues.cs            |  8 +++++++
 .../core/Util/TestBytesRefArray.cs              |  2 ++
 .../core/Util/TestBytesRefHash.cs               |  2 ++
 src/Lucene.Net.Tests/core/Util/TestCharsRef.cs  |  2 ++
 .../core/Util/TestFieldCacheSanityChecker.cs    |  5 +++-
 .../core/Util/TestOfflineSorter.cs              |  2 ++
 src/Lucene.Net.Tests/core/Util/TestVersion.cs   |  2 ++
 27 files changed, 124 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestSurrogates.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestSurrogates.cs b/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestSurrogates.cs
index fee2e0d..e24025d 100644
--- a/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestSurrogates.cs
+++ b/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestSurrogates.cs
@@ -105,7 +105,9 @@ namespace Lucene.Net.Codecs.Lucene3x
 
         private sealed class SortTermAsUTF16Comparer : IComparer<Term>
         {
+#pragma warning disable 612, 618
             private static readonly IComparer<BytesRef> LegacyComparer = BytesRef.UTF8SortedAsUTF16Comparer;
+#pragma warning restore 612, 618
 
             public int Compare(Term term1, Term term2)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestTermInfosReaderIndex.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestTermInfosReaderIndex.cs b/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestTermInfosReaderIndex.cs
index ce40e9d..dd48238 100644
--- a/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestTermInfosReaderIndex.cs
+++ b/src/Lucene.Net.Tests/core/Codecs/Lucene3x/TestTermInfosReaderIndex.cs
@@ -50,6 +50,7 @@ namespace Lucene.Net.Codecs.Lucene3x
     using TestUtil = Lucene.Net.Util.TestUtil;
     using TopDocs = Lucene.Net.Search.TopDocs;
 
+#pragma warning disable 612, 618
     [TestFixture]
     public class TestTermInfosReaderIndex : LuceneTestCase
     {
@@ -230,4 +231,5 @@ namespace Lucene.Net.Codecs.Lucene3x
             }
         }
     }
+#pragma warning restore 612, 618
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Document/TestDocument.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Document/TestDocument.cs b/src/Lucene.Net.Tests/core/Document/TestDocument.cs
index 555ce87..0f30dc4 100644
--- a/src/Lucene.Net.Tests/core/Document/TestDocument.cs
+++ b/src/Lucene.Net.Tests/core/Document/TestDocument.cs
@@ -363,6 +363,7 @@ namespace Lucene.Net.Documents
             RandomIndexWriter w = new RandomIndexWriter(Random(), dir, Similarity, TimeZone);
 
             Documents.Document doc = new Documents.Document();
+#pragma warning disable 612, 618
             doc.Add(new Field("stored", "abc", Field.Store.YES, Field.Index.NO));
             doc.Add(new Field("stored_indexed", "abc xyz", Field.Store.YES, Field.Index.NOT_ANALYZED));
             doc.Add(new Field("stored_tokenized", "abc xyz", Field.Store.YES, Field.Index.ANALYZED));
@@ -375,6 +376,7 @@ namespace Lucene.Net.Documents
             doc.Add(new Field("tv_pos", "abc xyz", Field.Store.NO, Field.Index.ANALYZED,
Field.TermVector.WITH_POSITIONS));
             doc.Add(new Field("tv_off", "abc xyz", Field.Store.NO, Field.Index.ANALYZED,
Field.TermVector.WITH_OFFSETS));
             doc.Add(new Field("tv_pos_off", "abc xyz", Field.Store.NO, Field.Index.ANALYZED,
Field.TermVector.WITH_POSITIONS_OFFSETS));
+#pragma warning restore 612, 618
             w.AddDocument(doc);
             IndexReader r = w.Reader;
             w.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility3x.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility3x.cs b/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility3x.cs
index 0911dc0..50e8b43 100644
--- a/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility3x.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestBackwardsCompatibility3x.cs
@@ -239,7 +239,9 @@ namespace Lucene.Net.Index
 
                 MemoryStream bos = new MemoryStream(1024);
                 CheckIndex checker = new CheckIndex(dir);
+#pragma warning disable 612, 618
                 checker.InfoStream = new StreamWriter(bos.ToString(), false, IOUtils.CHARSET_UTF_8);
+#pragma warning restore 612, 618
                 CheckIndex.Status indexStatus = checker.DoCheckIndex();
                 Assert.IsFalse(indexStatus.Clean);
                 Assert.IsTrue(bos.ToString().Contains(typeof(IndexFormatTooOldException).Name));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestBagOfPostings.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestBagOfPostings.cs b/src/Lucene.Net.Tests/core/Index/TestBagOfPostings.cs
index 246a6fb..607961b 100644
--- a/src/Lucene.Net.Tests/core/Index/TestBagOfPostings.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestBagOfPostings.cs
@@ -110,8 +110,10 @@ namespace Lucene.Net.Index
             AtomicReader air = (AtomicReader)ir.Leaves[0].Reader;
             Terms terms = air.Terms("field");
             // numTerms-1 because there cannot be a term 0 with 0 postings:
+#pragma warning disable 612, 618
             Assert.AreEqual(numTerms - 1, air.Fields.UniqueTermCount);
             if (iwc.Codec is Lucene3xCodec == false)
+#pragma warning restore 612, 618
             {
                 Assert.AreEqual(numTerms - 1, terms.Count);
             }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestCodecs.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestCodecs.cs b/src/Lucene.Net.Tests/core/Index/TestCodecs.cs
index acc5093..4247869 100644
--- a/src/Lucene.Net.Tests/core/Index/TestCodecs.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestCodecs.cs
@@ -630,7 +630,9 @@ namespace Lucene.Net.Index
                 {
                     FieldData field = Fields[Random().Next(Fields.Length)];
                     TermsEnum termsEnum = TermsDict.Terms(field.FieldInfo.Name).Iterator(null);
+#pragma warning disable 612, 618
                     if (Si.Codec is Lucene3xCodec)
+#pragma warning restore 612, 618
                     {
                         // code below expects unicode sort order
                         continue;
@@ -849,7 +851,9 @@ namespace Lucene.Net.Index
             Array.Sort(fields);
             foreach (FieldData field in fields)
             {
+#pragma warning disable 612, 618
                 if (!allowPreFlex && codec is Lucene3xCodec)
+#pragma warning restore 612, 618
                 {
                     // code below expects unicode sort order
                     continue;

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs b/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
index edbf47f..39a094d 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDirectoryReader.cs
@@ -857,7 +857,9 @@ namespace Lucene.Net.Index
 
             DirectoryReader r = DirectoryReader.Open(dir);
             AtomicReader r1 = GetOnlySegmentReader(r);
+#pragma warning disable 612, 618
             Assert.AreEqual(36, r1.Fields.UniqueTermCount);
+#pragma warning restore 612, 618
             writer.AddDocument(doc);
             writer.Commit();
             DirectoryReader r2 = DirectoryReader.OpenIfChanged(r);
@@ -866,7 +868,9 @@ namespace Lucene.Net.Index
 
             foreach (AtomicReaderContext s in r2.Leaves)
             {
+#pragma warning disable 612, 618
                 Assert.AreEqual(36, ((AtomicReader)s.Reader).Fields.UniqueTermCount);
+#pragma warning restore 612, 618
             }
             r2.Dispose();
             writer.Dispose();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestDocValuesWithThreads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestDocValuesWithThreads.cs b/src/Lucene.Net.Tests/core/Index/TestDocValuesWithThreads.cs
index b12e94e..8d0ea97 100644
--- a/src/Lucene.Net.Tests/core/Index/TestDocValuesWithThreads.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestDocValuesWithThreads.cs
@@ -139,6 +139,7 @@ namespace Lucene.Net.Index
                         int docID = ThreadRandom.Next(NumDocs);
                         switch (ThreadRandom.Next(6))
                         {
+#pragma warning disable 612, 618
                             case 0:
                                 Assert.AreEqual((long)(sbyte)Numbers[docID], FieldCache.DEFAULT.GetBytes(Ar,
"number", false).Get(docID));
                                 break;
@@ -146,6 +147,7 @@ namespace Lucene.Net.Index
                             case 1:
                                 Assert.AreEqual((long)(short)Numbers[docID], FieldCache.DEFAULT.GetShorts(Ar,
"number", false).Get(docID));
                                 break;
+#pragma warning restore 612, 618
 
                             case 2:
                                 Assert.AreEqual((long)(int)Numbers[docID], FieldCache.DEFAULT.GetInts(Ar,
"number", false).Get(docID));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs b/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
index 8ad2d4f..0e4862b 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexWriterUnicode.cs
@@ -203,7 +203,9 @@ namespace Lucene.Net.Index
                 UnicodeUtil.UTF16toUTF8(buffer, 0, 20, utf8);
                 if (!hasIllegal)
                 {
+#pragma warning disable 612, 618
                     var b = (new string(buffer, 0, 20)).GetBytes(IOUtils.CHARSET_UTF_8);
+#pragma warning restore 612, 618
                     Assert.AreEqual(b.Length, utf8.Length);
                     for (int i = 0; i < b.Length; i++)
                     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs b/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs
index 17ab39f..68986a0 100644
--- a/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestIndexableField.cs
@@ -108,7 +108,9 @@ namespace Lucene.Net.Index
                 {
                     get
                     {
+#pragma warning disable 612, 618
                         if (Codec.Default is Lucene3xCodec)
+#pragma warning restore 612, 618
                         {
                             return false; // 3.x doesnt support
                         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestMultiFields.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestMultiFields.cs b/src/Lucene.Net.Tests/core/Index/TestMultiFields.cs
index b90d1ae..0d70862 100644
--- a/src/Lucene.Net.Tests/core/Index/TestMultiFields.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestMultiFields.cs
@@ -110,7 +110,9 @@ namespace Lucene.Net.Index
                 if (VERBOSE)
                 {
                     List<BytesRef> termsList = new List<BytesRef>(uniqueTerms);
+#pragma warning disable 612, 618
                     termsList.Sort(BytesRef.UTF8SortedAsUTF16Comparer);
+#pragma warning restore 612, 618
                     Console.WriteLine("TEST: terms in UTF16 order:");
                     foreach (BytesRef b in termsList)
                     {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestPayloads.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestPayloads.cs b/src/Lucene.Net.Tests/core/Index/TestPayloads.cs
index 40a1ccf..6278405 100644
--- a/src/Lucene.Net.Tests/core/Index/TestPayloads.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestPayloads.cs
@@ -78,7 +78,9 @@ namespace Lucene.Net.Index
             // enabled in only some documents
             d.Add(NewTextField("f3", "this field has payloads in some docs", Field.Store.NO));
             // only add payload data for field f2
+#pragma warning disable 612, 618
             analyzer.SetPayloadData("f2", "somedata".GetBytes(IOUtils.CHARSET_UTF_8), 0,
1);
+#pragma warning restore 612, 618
             writer.AddDocument(d);
             // flush
             writer.Dispose();
@@ -100,8 +102,10 @@ namespace Lucene.Net.Index
             d.Add(NewTextField("f2", "this field has payloads in all docs", Field.Store.NO));
             d.Add(NewTextField("f3", "this field has payloads in some docs", Field.Store.NO));
             // add payload data for field f2 and f3
+#pragma warning disable 612, 618
             analyzer.SetPayloadData("f2", "somedata".GetBytes(IOUtils.CHARSET_UTF_8), 0,
1);
             analyzer.SetPayloadData("f3", "somedata".GetBytes(IOUtils.CHARSET_UTF_8), 0,
3);
+#pragma warning restore 612, 618
             writer.AddDocument(d);
 
             // force merge
@@ -293,7 +297,9 @@ namespace Lucene.Net.Index
             reader.Dispose();
         }
 
+#pragma warning disable 612, 618
         internal static readonly Encoding Utf8 = IOUtils.CHARSET_UTF_8;
+#pragma warning restore 612, 618
 
         private void GenerateRandomData(byte[] data)
         {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestStoredFieldsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestStoredFieldsFormat.cs b/src/Lucene.Net.Tests/core/Index/TestStoredFieldsFormat.cs
index 88b9090..9c551f3 100644
--- a/src/Lucene.Net.Tests/core/Index/TestStoredFieldsFormat.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestStoredFieldsFormat.cs
@@ -42,7 +42,9 @@ namespace Lucene.Net.Index
         [Test]
         public override void TestWriteReadMerge()
         {
+#pragma warning disable 612, 618
             AssumeFalse("impersonation isnt good enough", Codec is Lucene3xCodec);
+#pragma warning restore 612, 618
             // this test tries to switch up between the codec and another codec.
             // for 3.x: we currently cannot take an index with existing 4.x segments
             // and merge into newly formed 3.x segments.

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Index/TestTermVectorsFormat.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Index/TestTermVectorsFormat.cs b/src/Lucene.Net.Tests/core/Index/TestTermVectorsFormat.cs
index dac8fa8..b189e41 100644
--- a/src/Lucene.Net.Tests/core/Index/TestTermVectorsFormat.cs
+++ b/src/Lucene.Net.Tests/core/Index/TestTermVectorsFormat.cs
@@ -42,7 +42,9 @@ namespace Lucene.Net.Index
 
         protected override IEnumerable<Options> ValidOptions()
         {
+#pragma warning disable 612, 618
             if (Codec is Lucene3xCodec)
+#pragma warning restore 612, 618
             {
                 // payloads are not supported on vectors in 3.x indexes
                 return ValidOptions(Options.NONE, Options.POSITIONS_AND_OFFSETS);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Search/Spans/TestBasics.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/Spans/TestBasics.cs b/src/Lucene.Net.Tests/core/Search/Spans/TestBasics.cs
index 35f5dd8..daaa766 100644
--- a/src/Lucene.Net.Tests/core/Search/Spans/TestBasics.cs
+++ b/src/Lucene.Net.Tests/core/Search/Spans/TestBasics.cs
@@ -74,7 +74,9 @@ namespace Lucene.Net.Search.Spans
             {
                 if (m_input.IncrementToken())
                 {
+#pragma warning disable 612, 618
                     PayloadAttr.Payload = new BytesRef(("pos: " + Pos).GetBytes(IOUtils.CHARSET_UTF_8));
+#pragma warning restore 612, 618
                     Pos++;
                     return true;
                 }
@@ -418,7 +420,9 @@ namespace Lucene.Net.Search.Spans
         public virtual void TestSpanPayloadCheck()
         {
             SpanTermQuery term1 = new SpanTermQuery(new Term("field", "five"));
+#pragma warning disable 612, 618
             BytesRef pay = new BytesRef(("pos: " + 5).GetBytes(IOUtils.CHARSET_UTF_8));
+#pragma warning restore 612, 618
             SpanQuery query = new SpanPayloadCheckQuery(term1, new List<byte[]>() {
pay.Bytes });
             CheckHits(query, new int[] { 1125, 1135, 1145, 1155, 1165, 1175, 1185, 1195,
1225, 1235, 1245, 1255, 1265, 1275, 1285, 1295, 1325, 1335, 1345, 1355, 1365, 1375, 1385,
1395, 1425, 1435, 1445, 1455, 1465, 1475, 1485, 1495, 1525, 1535, 1545, 1555, 1565, 1575,
1585, 1595, 1625, 1635, 1645, 1655, 1665, 1675, 1685, 1695, 1725, 1735, 1745, 1755, 1765,
1775, 1785, 1795, 1825, 1835, 1845, 1855, 1865, 1875, 1885, 1895, 1925, 1935, 1945, 1955,
1965, 1975, 1985, 1995 });
             Assert.IsTrue(Searcher.Explain(query, 1125).Value > 0.0f);
@@ -432,8 +436,10 @@ namespace Lucene.Net.Search.Spans
             clauses[0] = term1;
             clauses[1] = term2;
             snq = new SpanNearQuery(clauses, 0, true);
+#pragma warning disable 612, 618
             pay = new BytesRef(("pos: " + 0).GetBytes(IOUtils.CHARSET_UTF_8));
             pay2 = new BytesRef(("pos: " + 1).GetBytes(IOUtils.CHARSET_UTF_8));
+#pragma warning restore 612, 618
             list = new List<byte[]>();
             list.Add(pay.Bytes);
             list.Add(pay2.Bytes);
@@ -444,9 +450,11 @@ namespace Lucene.Net.Search.Spans
             clauses[1] = term2;
             clauses[2] = new SpanTermQuery(new Term("field", "five"));
             snq = new SpanNearQuery(clauses, 0, true);
+#pragma warning disable 612, 618
             pay = new BytesRef(("pos: " + 0).GetBytes(IOUtils.CHARSET_UTF_8));
             pay2 = new BytesRef(("pos: " + 1).GetBytes(IOUtils.CHARSET_UTF_8));
             BytesRef pay3 = new BytesRef(("pos: " + 2).GetBytes(IOUtils.CHARSET_UTF_8));
+#pragma warning restore 612, 618
             list = new List<byte[]>();
             list.Add(pay.Bytes);
             list.Add(pay2.Bytes);
@@ -476,10 +484,12 @@ namespace Lucene.Net.Search.Spans
             CheckHits(query, new int[] { 1103, 1203, 1303, 1403, 1503, 1603, 1703, 1803,
1903 });
 
             var payloads = new List<byte[]>();
+#pragma warning disable 612, 618
             BytesRef pay = new BytesRef(("pos: " + 0).GetBytes(IOUtils.CHARSET_UTF_8));
             BytesRef pay2 = new BytesRef(("pos: " + 1).GetBytes(IOUtils.CHARSET_UTF_8));
             BytesRef pay3 = new BytesRef(("pos: " + 3).GetBytes(IOUtils.CHARSET_UTF_8));
             BytesRef pay4 = new BytesRef(("pos: " + 4).GetBytes(IOUtils.CHARSET_UTF_8));
+#pragma warning restore 612, 618
             payloads.Add(pay.Bytes);
             payloads.Add(pay2.Bytes);
             payloads.Add(pay3.Bytes);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Search/TestControlledRealTimeReopenThread.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestControlledRealTimeReopenThread.cs b/src/Lucene.Net.Tests/core/Search/TestControlledRealTimeReopenThread.cs
index 174ca9f..d447b9e 100644
--- a/src/Lucene.Net.Tests/core/Search/TestControlledRealTimeReopenThread.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestControlledRealTimeReopenThread.cs
@@ -642,7 +642,11 @@ namespace Lucene.Net.Search
 
             SnapshotDeletionPolicy sdp = new SnapshotDeletionPolicy(new KeepOnlyLastCommitDeletionPolicy());
             Directory dir = new NRTCachingDirectory(NewFSDirectory(CreateTempDir("nrt")),
5, 128);
-            IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_46, new MockAnalyzer(Random()));
+            IndexWriterConfig config = new IndexWriterConfig(
+#pragma warning disable 612, 618
+                Version.LUCENE_46,
+#pragma warning restore 612, 618
+                new MockAnalyzer(Random()));
             config.SetIndexDeletionPolicy(sdp);
             config.SetOpenMode(OpenMode.CREATE_OR_APPEND);
             IndexWriter iw = new IndexWriter(dir, config);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Search/TestFieldCache.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestFieldCache.cs b/src/Lucene.Net.Tests/core/Search/TestFieldCache.cs
index 7051455..afde736 100644
--- a/src/Lucene.Net.Tests/core/Search/TestFieldCache.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestFieldCache.cs
@@ -217,6 +217,7 @@ namespace Lucene.Net.Search
                 Assert.IsTrue(longs.Get(i) == (long.MaxValue - i), longs.Get(i) + " does
not equal: " + (long.MaxValue - i) + " i=" + i);
             }
 
+#pragma warning disable 612, 618
             FieldCache.Bytes bytes = cache.GetBytes(Reader, "theByte", Random().NextBoolean());
             Assert.AreSame(bytes, cache.GetBytes(Reader, "theByte", Random().NextBoolean()),
"Second request to cache return same array");
             Assert.AreSame(bytes, cache.GetBytes(Reader, "theByte", FieldCache.DEFAULT_BYTE_PARSER,
Random().NextBoolean()), "Second request with explicit parser return same array");
@@ -232,6 +233,7 @@ namespace Lucene.Net.Search
             {
                 Assert.IsTrue(shorts.Get(i) == (short)(short.MaxValue - i), shorts.Get(i)
+ " does not equal: " + (short.MaxValue - i));
             }
+#pragma warning restore 612, 618
 
             FieldCache.Ints ints = cache.GetInts(Reader, "theInt", Random().NextBoolean());
             Assert.AreSame(ints, cache.GetInts(Reader, "theInt", Random().NextBoolean()),
"Second request to cache return same array");
@@ -831,11 +833,13 @@ namespace Lucene.Net.Search
             cache.PurgeAllCaches();
             Assert.AreEqual(0, cache.GetCacheEntries().Length);
 
+#pragma warning disable 612, 618
             Bytes bytes = cache.GetBytes(ar, "bogusbytes", true);
             Assert.AreEqual(0, bytes.Get(0));
 
             Shorts shorts = cache.GetShorts(ar, "bogusshorts", true);
             Assert.AreEqual(0, shorts.Get(0));
+#pragma warning restore 612, 618
 
             Ints ints = cache.GetInts(ar, "bogusints", true);
             Assert.AreEqual(0, ints.Get(0));
@@ -898,11 +902,13 @@ namespace Lucene.Net.Search
             cache.PurgeAllCaches();
             Assert.AreEqual(0, cache.GetCacheEntries().Length);
 
+#pragma warning disable 612, 618
             Bytes bytes = cache.GetBytes(ar, "bogusbytes", true);
             Assert.AreEqual(0, bytes.Get(0));
 
             Shorts shorts = cache.GetShorts(ar, "bogusshorts", true);
             Assert.AreEqual(0, shorts.Get(0));
+#pragma warning restore 612, 618
 
             Ints ints = cache.GetInts(ar, "bogusints", true);
             Assert.AreEqual(0, ints.Get(0));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Search/TestFieldCacheRangeFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestFieldCacheRangeFilter.cs b/src/Lucene.Net.Tests/core/Search/TestFieldCacheRangeFilter.cs
index f0e44a8..a1d1e50 100644
--- a/src/Lucene.Net.Tests/core/Search/TestFieldCacheRangeFilter.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestFieldCacheRangeFilter.cs
@@ -232,6 +232,7 @@ namespace Lucene.Net.Search
             ScoreDoc[] result;
             Query q = new TermQuery(new Term("body", "body"));
 
+#pragma warning disable 612, 618
             // test id, bounded on both ends
             result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", minIdO, maxIdO,
T, T), numDocs).ScoreDocs;
             Assert.AreEqual(numDocs, result.Length, "find all");
@@ -303,6 +304,7 @@ namespace Lucene.Net.Search
             Assert.AreEqual(0, result.Length, "overflow special case");
             result = search.Search(q, FieldCacheRangeFilter.NewShortRange("id", maxIdO, minIdO,
T, T), numDocs).ScoreDocs;
             Assert.AreEqual(0, result.Length, "inverse range");
+#pragma warning restore 612, 618
         }
 
         [Test]
@@ -573,6 +575,7 @@ namespace Lucene.Net.Search
             ScoreDoc[] result;
             Query q = new TermQuery(new Term("body", "body"));
 
+#pragma warning disable 612, 618
             result = search.Search(q, FieldCacheRangeFilter.NewByteRange("id", (sbyte?)-20,
(sbyte?)20, T, T), 100).ScoreDocs;
             Assert.AreEqual(40, result.Length, "find all");
 
@@ -587,6 +590,8 @@ namespace Lucene.Net.Search
 
             result = search.Search(q, FieldCacheRangeFilter.NewByteRange("id", (sbyte?)-20,
(sbyte?)-10, T, T), 100).ScoreDocs;
             Assert.AreEqual(11, result.Length, "find all");
+#pragma warning restore 612, 618
+
             reader.Dispose();
             dir.Dispose();
         }

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Search/TestSearchAfter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSearchAfter.cs b/src/Lucene.Net.Tests/core/Search/TestSearchAfter.cs
index 2a4caa6..d460d91 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSearchAfter.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSearchAfter.cs
@@ -67,7 +67,30 @@ namespace Lucene.Net.Search
         {
             base.SetUp();
 
-            AllSortFields = new List<SortField>(Arrays.AsList(new SortField[] { new
SortField("byte", SortFieldType.BYTE, false), new SortField("short", SortFieldType.SHORT,
false), new SortField("int", SortFieldType.INT, false), new SortField("long", SortFieldType.LONG,
false), new SortField("float", SortFieldType.FLOAT, false), new SortField("double", SortFieldType.DOUBLE,
false), new SortField("bytes", SortFieldType.STRING, false), new SortField("bytesval", SortFieldType.STRING_VAL,
false), new SortField("byte", SortFieldType.BYTE, true), new SortField("short", SortFieldType.SHORT,
true), new SortField("int", SortFieldType.INT, true), new SortField("long", SortFieldType.LONG,
true), new SortField("float", SortFieldType.FLOAT, true), new SortField("double", SortFieldType.DOUBLE,
true), new SortField("bytes", SortFieldType.STRING, true), new SortField("bytesval", SortFieldType.STRING_VAL,
true), SortField.FIELD_SCORE, SortField.FIELD_DOC }));
+            AllSortFields = new List<SortField>(Arrays.AsList(new SortField[] {
+#pragma warning disable 612,618
+                new SortField("byte", SortFieldType.BYTE, false),
+                new SortField("short", SortFieldType.SHORT, false),
+#pragma warning restore 612,618
+                new SortField("int", SortFieldType.INT, false),
+                new SortField("long", SortFieldType.LONG, false),
+                new SortField("float", SortFieldType.FLOAT, false),
+                new SortField("double", SortFieldType.DOUBLE, false),
+                new SortField("bytes", SortFieldType.STRING, false),
+                new SortField("bytesval", SortFieldType.STRING_VAL, false),
+#pragma warning disable 612,618
+                new SortField("byte", SortFieldType.BYTE, true),
+                new SortField("short", SortFieldType.SHORT, true),
+#pragma warning restore 612,618
+                new SortField("int", SortFieldType.INT, true),
+                new SortField("long", SortFieldType.LONG, true),
+                new SortField("float", SortFieldType.FLOAT, true),
+                new SortField("double", SortFieldType.DOUBLE, true),
+                new SortField("bytes", SortFieldType.STRING, true),
+                new SortField("bytesval", SortFieldType.STRING_VAL, true),
+                SortField.FIELD_SCORE,
+                SortField.FIELD_DOC
+            }));
 
             if (SupportsDocValues)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Search/TestSort.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSort.cs b/src/Lucene.Net.Tests/core/Search/TestSort.cs
index 382b530..e8b076c 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSort.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSort.cs
@@ -552,7 +552,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             Sort sort = new Sort(new SortField("value", SortFieldType.BYTE));
+#pragma warning restore 612, 618
 
             TopDocs td = searcher.Search(new MatchAllDocsQuery(), 10, sort);
             Assert.AreEqual(3, td.TotalHits);
@@ -584,7 +586,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             Sort sort = new Sort(new SortField("value", SortFieldType.BYTE));
+#pragma warning restore 612, 618
 
             TopDocs td = searcher.Search(new MatchAllDocsQuery(), 10, sort);
             Assert.AreEqual(3, td.TotalHits);
@@ -616,7 +620,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             SortField sortField = new SortField("value", SortFieldType.BYTE);
+#pragma warning restore 612, 618
             sortField.MissingValue = sbyte.MaxValue;
             Sort sort = new Sort(sortField);
 
@@ -651,7 +657,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             Sort sort = new Sort(new SortField("value", SortFieldType.BYTE, true));
+#pragma warning restore 612, 618
 
             TopDocs td = searcher.Search(new MatchAllDocsQuery(), 10, sort);
             Assert.AreEqual(3, td.TotalHits);
@@ -684,7 +692,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             Sort sort = new Sort(new SortField("value", SortFieldType.SHORT));
+#pragma warning restore 612, 618
 
             TopDocs td = searcher.Search(new MatchAllDocsQuery(), 10, sort);
             Assert.AreEqual(3, td.TotalHits);
@@ -716,7 +726,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             Sort sort = new Sort(new SortField("value", SortFieldType.SHORT));
+#pragma warning restore 612, 618
 
             TopDocs td = searcher.Search(new MatchAllDocsQuery(), 10, sort);
             Assert.AreEqual(3, td.TotalHits);
@@ -748,7 +760,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             SortField sortField = new SortField("value", SortFieldType.SHORT);
+#pragma warning restore 612, 618
             sortField.MissingValue = short.MaxValue;
             Sort sort = new Sort(sortField);
 
@@ -783,7 +797,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             Sort sort = new Sort(new SortField("value", SortFieldType.SHORT, true));
+#pragma warning restore 612, 618
 
             TopDocs td = searcher.Search(new MatchAllDocsQuery(), 10, sort);
             Assert.AreEqual(3, td.TotalHits);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Search/TestSortDocValues.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Search/TestSortDocValues.cs b/src/Lucene.Net.Tests/core/Search/TestSortDocValues.cs
index 299965d..04146e0 100644
--- a/src/Lucene.Net.Tests/core/Search/TestSortDocValues.cs
+++ b/src/Lucene.Net.Tests/core/Search/TestSortDocValues.cs
@@ -272,7 +272,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             Sort sort = new Sort(new SortField("value", SortFieldType.BYTE));
+#pragma warning restore 612, 618
 
             TopDocs td = searcher.Search(new MatchAllDocsQuery(), 10, sort);
             Assert.AreEqual(3, td.TotalHits);
@@ -309,7 +311,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             Sort sort = new Sort(new SortField("value", SortFieldType.BYTE, true));
+#pragma warning restore 612, 618
 
             TopDocs td = searcher.Search(new MatchAllDocsQuery(), 10, sort);
             Assert.AreEqual(3, td.TotalHits);
@@ -346,7 +350,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             Sort sort = new Sort(new SortField("value", SortFieldType.SHORT));
+#pragma warning restore 612, 618
 
             TopDocs td = searcher.Search(new MatchAllDocsQuery(), 10, sort);
             Assert.AreEqual(3, td.TotalHits);
@@ -383,7 +389,9 @@ namespace Lucene.Net.Search
             writer.Dispose();
 
             IndexSearcher searcher = NewSearcher(ir);
+#pragma warning disable 612, 618
             Sort sort = new Sort(new SortField("value", SortFieldType.SHORT, true));
+#pragma warning restore 612, 618
 
             TopDocs td = searcher.Search(new MatchAllDocsQuery(), 10, sort);
             Assert.AreEqual(3, td.TotalHits);

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Util/TestBytesRefArray.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Util/TestBytesRefArray.cs b/src/Lucene.Net.Tests/core/Util/TestBytesRefArray.cs
index 0e50d8d..dde2b9e 100644
--- a/src/Lucene.Net.Tests/core/Util/TestBytesRefArray.cs
+++ b/src/Lucene.Net.Tests/core/Util/TestBytesRefArray.cs
@@ -98,7 +98,9 @@ namespace Lucene.Net.Util
                 }
 
                 stringList.Sort();
+#pragma warning disable 612, 618
                 IBytesRefIterator iter = list.GetIterator(BytesRef.UTF8SortedAsUTF16Comparer);
+#pragma warning restore 612, 618
                 int a = 0;
                 while ((spare = iter.Next()) != null)
                 {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Util/TestBytesRefHash.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Util/TestBytesRefHash.cs b/src/Lucene.Net.Tests/core/Util/TestBytesRefHash.cs
index d56b63f..696a011 100644
--- a/src/Lucene.Net.Tests/core/Util/TestBytesRefHash.cs
+++ b/src/Lucene.Net.Tests/core/Util/TestBytesRefHash.cs
@@ -214,7 +214,9 @@ namespace Lucene.Net.Util
                 }
                 // We use the UTF-16 comparer here, because we need to be able to
                 // compare to native String.CompareTo() [UTF-16]:
+#pragma warning disable 612, 618
                 int[] sort = Hash.Sort(BytesRef.UTF8SortedAsUTF16Comparer);
+#pragma warning restore 612, 618
                 Assert.IsTrue(strings.Count < sort.Length);
                 int i = 0;
                 BytesRef scratch = new BytesRef();

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Util/TestCharsRef.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Util/TestCharsRef.cs b/src/Lucene.Net.Tests/core/Util/TestCharsRef.cs
index dda066f..2c22167 100644
--- a/src/Lucene.Net.Tests/core/Util/TestCharsRef.cs
+++ b/src/Lucene.Net.Tests/core/Util/TestCharsRef.cs
@@ -41,7 +41,9 @@ namespace Lucene.Net.Util
             }
 
             Array.Sort(utf8);
+#pragma warning disable 612, 618
             Array.Sort(utf16, CharsRef.UTF16SortedAsUTF8Comparer);
+#pragma warning restore 612, 618
 
             for (int i = 0; i < numStrings; i++)
             {

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Util/TestFieldCacheSanityChecker.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Util/TestFieldCacheSanityChecker.cs b/src/Lucene.Net.Tests/core/Util/TestFieldCacheSanityChecker.cs
index fb65337..ab2a4e2 100644
--- a/src/Lucene.Net.Tests/core/Util/TestFieldCacheSanityChecker.cs
+++ b/src/Lucene.Net.Tests/core/Util/TestFieldCacheSanityChecker.cs
@@ -149,7 +149,9 @@ namespace Lucene.Net.Util
 
             cache.GetInts(ReaderX, "theInt", FieldCache.DEFAULT_INT_PARSER, false);
             cache.GetTerms(ReaderX, "theInt", false);
+#pragma warning disable 612, 618
             cache.GetBytes(ReaderX, "theByte", false);
+#pragma warning restore 612, 618
 
             // // //
 
@@ -172,8 +174,9 @@ namespace Lucene.Net.Util
             cache.GetTerms(ReaderA, "theInt", false);
             cache.GetTerms(ReaderB, "theInt", false);
             cache.GetTerms(ReaderX, "theInt", false);
-
+#pragma warning disable 612, 618
             cache.GetBytes(ReaderX, "theByte", false);
+#pragma warning restore 612, 618
 
             // // //
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Util/TestOfflineSorter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Util/TestOfflineSorter.cs b/src/Lucene.Net.Tests/core/Util/TestOfflineSorter.cs
index 022bfd3..2d32203 100644
--- a/src/Lucene.Net.Tests/core/Util/TestOfflineSorter.cs
+++ b/src/Lucene.Net.Tests/core/Util/TestOfflineSorter.cs
@@ -72,7 +72,9 @@ namespace Lucene.Net.Util
         [Test]
         public virtual void TestSingleLine()
         {
+#pragma warning disable 612, 618
             CheckSort(new OfflineSorter(), new byte[][] { "Single line only.".GetBytes(IOUtils.CHARSET_UTF_8)
});
+#pragma warning restore 612, 618
         }
 
 #if !NETSTANDARD

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/15efa51c/src/Lucene.Net.Tests/core/Util/TestVersion.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests/core/Util/TestVersion.cs b/src/Lucene.Net.Tests/core/Util/TestVersion.cs
index 91a3da1..bff6757 100644
--- a/src/Lucene.Net.Tests/core/Util/TestVersion.cs
+++ b/src/Lucene.Net.Tests/core/Util/TestVersion.cs
@@ -22,6 +22,7 @@ using System.Reflection;
 
 namespace Lucene.Net.Util
 {
+#pragma warning disable 612, 618
     [TestFixture]
     public class TestVersion : LuceneTestCase
     {
@@ -78,4 +79,5 @@ namespace Lucene.Net.Util
             Assert.AreEqual(mainVersionParsed, values[values.Length - 2], "Constant one before
last must be the same as the parsed LUCENE_MAIN_VERSION (without alpha/beta) constant: " +
mainVersionWithoutAlphaBeta);
         }
     }
+#pragma warning restore 612, 618
 }
\ No newline at end of file


Mime
View raw message