lucenenet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From synhers...@apache.org
Subject [42/50] [abbrv] lucenenet git commit: Fixed most compiler warnings in Analysis (a few lingering issues).
Date Sun, 02 Oct 2016 14:36:00 GMT
http://git-wip-us.apache.org/repos/asf/lucenenet/blob/da2ae4c8/src/Lucene.Net.Tests.Analysis.Common/Analysis/Nl/TestDutchStemmer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Nl/TestDutchStemmer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Nl/TestDutchStemmer.cs
index 63b62b6..89ccae0 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Nl/TestDutchStemmer.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Nl/TestDutchStemmer.cs
@@ -146,7 +146,9 @@ namespace Lucene.Net.Analysis.Nl
         [Test]
         public virtual void TestExclusionTableViaCtor()
         {
+#pragma warning disable 612, 618
             CharArraySet set = new CharArraySet(LuceneVersion.LUCENE_30, 1, true);
+#pragma warning restore 612, 618
             set.add("lichamelijk");
             DutchAnalyzer a = new DutchAnalyzer(TEST_VERSION_CURRENT, CharArraySet.EMPTY_SET,
set);
             AssertAnalyzesTo(a, "lichamelijk lichamelijke", new string[] { "lichamelijk",
"licham" });
@@ -216,7 +218,9 @@ namespace Lucene.Net.Analysis.Nl
         [Test]
         public virtual void TestStopwordsCasing()
         {
+#pragma warning disable 612, 618
             DutchAnalyzer a = new DutchAnalyzer(LuceneVersion.LUCENE_31);
+#pragma warning restore 612, 618
             AssertAnalyzesTo(a, "Zelf", new string[] { });
         }
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/da2ae4c8/src/Lucene.Net.Tests.Analysis.Common/Analysis/Position/PositionFilterTest.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Position/PositionFilterTest.cs
b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Position/PositionFilterTest.cs
index 82c38f1..ba2bf08 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Position/PositionFilterTest.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Position/PositionFilterTest.cs
@@ -71,21 +71,30 @@ namespace Lucene.Net.Analysis.Position
         public virtual void TestFilter()
         {
 
-            AssertTokenStreamContents(new PositionFilter(new TestTokenStream(this, TEST_TOKEN)),
TEST_TOKEN, TEST_TOKEN_POSITION_INCREMENTS);
+            AssertTokenStreamContents(
+#pragma warning disable 612, 618
+                new PositionFilter(
+#pragma warning restore 612, 618
+                    new TestTokenStream(this, TEST_TOKEN)), TEST_TOKEN, TEST_TOKEN_POSITION_INCREMENTS);
         }
 
         [Test]
         public virtual void TestNonZeroPositionIncrement()
         {
 
-            AssertTokenStreamContents(new PositionFilter(new TestTokenStream(this, TEST_TOKEN),
5), TEST_TOKEN, TEST_TOKEN_NON_ZERO_POSITION_INCREMENTS);
+            AssertTokenStreamContents(
+#pragma warning disable 612, 618
+                new PositionFilter(
+#pragma warning restore 612, 618
+                    new TestTokenStream(this, TEST_TOKEN), 5), TEST_TOKEN, TEST_TOKEN_NON_ZERO_POSITION_INCREMENTS);
         }
 
         [Test]
         public virtual void TestReset()
         {
-
+#pragma warning disable 612, 618
             PositionFilter filter = new PositionFilter(new TestTokenStream(this, TEST_TOKEN));
+#pragma warning restore 612, 618
             AssertTokenStreamContents(filter, TEST_TOKEN, TEST_TOKEN_POSITION_INCREMENTS);
             filter.Reset();
             // Make sure that the reset filter provides correct position increments
@@ -101,7 +110,11 @@ namespace Lucene.Net.Analysis.Position
         {
 
             ShingleFilter filter = new ShingleFilter(new TestTokenStream(this, TEST_TOKEN),
6);
-            AssertTokenStreamContents(new PositionFilter(filter), SIX_GRAM_NO_POSITIONS_TOKENS,
SIX_GRAM_NO_POSITIONS_INCREMENTS);
+            AssertTokenStreamContents
+#pragma warning disable 612, 618
+                (new PositionFilter(filter),
+#pragma warning restore 612, 618
+                SIX_GRAM_NO_POSITIONS_TOKENS, SIX_GRAM_NO_POSITIONS_INCREMENTS);
         }
     }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/da2ae4c8/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowball.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowball.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowball.cs
index e7b7282..5428069 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowball.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Snowball/TestSnowball.cs
@@ -24,7 +24,7 @@ namespace Lucene.Net.Analysis.Snowball
 	 * See the License for the specific language governing permissions and
 	 * limitations under the License.
 	 */
-
+#pragma warning disable 612, 618
     public class TestSnowball : BaseTokenStreamTestCase
     {
 
@@ -217,4 +217,5 @@ namespace Lucene.Net.Analysis.Snowball
             }
         }
     }
+#pragma warning restore 612, 618
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/da2ae4c8/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymFilterFactory.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymFilterFactory.cs
b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymFilterFactory.cs
index 093c4dd..7ed1ae7 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymFilterFactory.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymFilterFactory.cs
@@ -132,11 +132,13 @@ namespace Lucene.Net.Analysis.Synonym
         {
             // diff versions produce diff delegator behavior,
             // all should be (mostly) equivilent for our test purposes.
+#pragma warning disable 612, 618
             DoTestTokenizerFactoryArguments(Version.LUCENE_33, typeof(SlowSynonymFilterFactory));
             DoTestTokenizerFactoryArguments(Version.LUCENE_34, typeof(FSTSynonymFilterFactory));
             DoTestTokenizerFactoryArguments(Version.LUCENE_35, typeof(FSTSynonymFilterFactory));
 
             DoTestTokenizerFactoryArguments(Version.LUCENE_CURRENT, typeof(FSTSynonymFilterFactory));
+#pragma warning restore 612, 618
         }
 
         protected internal virtual void DoTestTokenizerFactoryArguments(Version ver, Type
delegatorClass)
@@ -180,7 +182,9 @@ namespace Lucene.Net.Analysis.Synonym
             assertNotNull(factory);
             assertTrue("factory not expected class: " + factory.GetType(), factory is SynonymFilterFactory);
             SynonymFilterFactory synFac = (SynonymFilterFactory)factory;
+#pragma warning disable 612, 618
             object delegator = synFac.Delegator;
+#pragma warning restore 612, 618
             assertNotNull(delegator);
             assertTrue("delegator not expected class: " + delegator.GetType(), delegatorClass.IsInstanceOfType(delegator));
 

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/da2ae4c8/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
index d53bb3b..30b723a 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Synonym/TestSynonymMapFilter.cs
@@ -836,6 +836,7 @@ namespace Lucene.Net.Analysis.Synonym
             posLenAtt = tokensOut.AddAttribute<IPositionLengthAttribute>();
             offsetAtt = tokensOut.AddAttribute<IOffsetAttribute>();
 
+#pragma warning disable 162
             if (keepOrig)
             {
                 Verify("xyzzy bbb pot of gold", "xyzzy bbb/bbbb1 pot/bbbb2 of gold");
@@ -846,6 +847,7 @@ namespace Lucene.Net.Analysis.Synonym
                 Verify("xyzzy bbb pot of gold", "xyzzy bbbb1 pot/bbbb2 of gold");
                 Verify("xyzzy aaa pot of gold", "xyzzy aaaa1 pot/aaaa2 of/aaaa3 gold");
             }
+#pragma warning restore 612, 618
         }
 
         [Test]

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/da2ae4c8/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs
index d731581..427f35e 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Th/TestThaiAnalyzer.cs
@@ -55,7 +55,11 @@ namespace Lucene.Net.Analysis.Th
         [Test]
         public virtual void TestBackwardsStopWords()
         {
-            AssertAnalyzesTo(new ThaiAnalyzer(LuceneVersion.LUCENE_35), "การที่ได้ต้องแสดงว่างานดี",
new string[] { "การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า",
"งาน", "ดี" }, new int[] { 0, 3, 6, 9, 13, 17, 20, 23 }, new int[] { 3, 6, 9, 13,
17, 20, 23, 25 });
+            AssertAnalyzesTo(
+#pragma warning disable 612, 618
+                new ThaiAnalyzer(LuceneVersion.LUCENE_35),
+#pragma warning restore 612, 618
+                "การที่ได้ต้องแสดงว่างานดี",
new string[] { "การ", "ที่", "ได้", "ต้อง", "แสดง", "ว่า",
"งาน", "ดี" }, new int[] { 0, 3, 6, 9, 13, 17, 20, 23 }, new int[] { 3, 6, 9, 13,
17, 20, 23, 25 });
         }
 
         /// <summary>
@@ -144,7 +148,9 @@ namespace Lucene.Net.Analysis.Th
         [Test]
         public virtual void TestAttributeReuse()
         {
+#pragma warning disable 612, 618
             ThaiAnalyzer analyzer = new ThaiAnalyzer(LuceneVersion.LUCENE_30);
+#pragma warning restore 612, 618
             // just consume
             TokenStream ts = analyzer.TokenStream("dummy", "ภาษาไทย");
             AssertTokenStreamContents(ts, new string[] { "ภาษา", "ไทย" });

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/da2ae4c8/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs
index 2615e78..15044e7 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharArraySet.cs
@@ -608,7 +608,9 @@ namespace Lucene.Net.Analysis.Util
             set.add("test2");
             assertTrue(set.ToString().Contains(", "));
 
+#pragma warning disable 612, 618
             set = CharArraySet.Copy(Version.LUCENE_30, Collections.Singleton("test"));
+#pragma warning restore 612, 618
             assertEquals("[test]", set.ToString());
             set.add("test2");
             assertTrue(set.ToString().Contains(", "));

http://git-wip-us.apache.org/repos/asf/lucenenet/blob/da2ae4c8/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharacterUtils.cs
----------------------------------------------------------------------
diff --git a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharacterUtils.cs b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharacterUtils.cs
index 0f4e14a..306f16c 100644
--- a/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharacterUtils.cs
+++ b/src/Lucene.Net.Tests.Analysis.Common/Analysis/Util/TestCharacterUtils.cs
@@ -33,7 +33,9 @@ namespace Lucene.Net.Analysis.Util
         [Test]
         public virtual void TestCodePointAtCharSequenceInt()
         {
+#pragma warning disable 612, 618
             var java4 = CharacterUtils.GetInstance(LuceneVersion.LUCENE_30);
+#pragma warning restore 612, 618
             var cpAt3 = "Abc\ud801\udc1c";
             var highSurrogateAt3 = "Abc\ud801";
             assertEquals((int)'A', java4.CodePointAt(cpAt3, 0));
@@ -66,7 +68,9 @@ namespace Lucene.Net.Analysis.Util
         [Test]
         public virtual void TestCodePointAtCharArrayIntInt()
         {
+#pragma warning disable 612, 618
             var java4 = CharacterUtils.GetInstance(LuceneVersion.LUCENE_30);
+#pragma warning restore 612, 618
             var cpAt3 = "Abc\ud801\udc1c".ToCharArray();
             var highSurrogateAt3 = "Abc\ud801".ToCharArray();
             assertEquals((int)'A', java4.CodePointAt(cpAt3, 0, 2));
@@ -187,7 +191,9 @@ namespace Lucene.Net.Analysis.Util
         [Test]
         public virtual void TestFillNoHighSurrogate()
         {
+#pragma warning disable 612, 618
             var versions = new LuceneVersion[] { LuceneVersion.LUCENE_30, TEST_VERSION_CURRENT
};
+#pragma warning restore 612, 618
             foreach (var version in versions)
             {
                 var instance = CharacterUtils.GetInstance(version);
@@ -233,7 +239,9 @@ namespace Lucene.Net.Analysis.Util
         public virtual void TestFillJava14()
         {
             var input = "1234\ud801\udc1c789123\ud801\ud801\udc1c\ud801";
+#pragma warning disable 612, 618
             var instance = CharacterUtils.GetInstance(LuceneVersion.LUCENE_30);
+#pragma warning restore 612, 618
             var reader = new StringReader(input);
             var buffer = CharacterUtils.NewCharacterBuffer(5);
             assertTrue(instance.Fill(buffer, reader));


Mime
View raw message