From 878dc64efbc3900b3c75239a9c9cca155b177def Mon Sep 17 00:00:00 2001 From: Nikolaj Brask-Nielsen Date: Mon, 17 Oct 2022 19:02:46 +0200 Subject: [PATCH] Review for CA1822: Mark members as static (#690) * sweep: Review for CA1822: Mark members as static * chore: Review changes * chore: Remove unused abort methods --- .../Analysis/Bg/BulgarianStemmer.cs | 4 +- .../Analysis/Br/BrazilianStemmer.cs | 10 ++-- .../CharFilter/HTMLStripCharFilter.cs | 2 +- .../Compound/Hyphenation/PatternParser.cs | 4 +- .../Analysis/Cz/CzechStemmer.cs | 6 +-- .../Analysis/De/GermanLightStemmer.cs | 2 +- .../Analysis/De/GermanStemmer.cs | 6 +-- .../Analysis/El/GreekLowerCaseFilter.cs | 2 +- .../Analysis/El/GreekStemmer.cs | 52 +++++++++---------- .../Analysis/En/KStemmer.cs | 2 +- .../Analysis/Fi/FinnishLightStemmer.cs | 8 +-- .../Analysis/Fr/FrenchLightStemmer.cs | 2 +- .../Analysis/Ga/IrishLowerCaseFilter.cs | 2 +- .../Analysis/Hu/HungarianLightStemmer.cs | 6 +-- .../Analysis/Hunspell/Dictionary.cs | 6 +-- .../Analysis/Hunspell/Stemmer.cs | 2 +- .../Analysis/Id/IndonesianStemmer.cs | 2 +- .../Analysis/In/IndicNormalizer.cs | 2 +- .../Analysis/Lv/LatvianStemmer.cs | 4 +- .../WordDelimiterFilterFactory.cs | 2 +- .../Analysis/Pt/PortugueseLightStemmer.cs | 4 +- .../Analysis/Ru/RussianLightStemmer.cs | 4 +- .../Standard/UAX29URLEmailTokenizerImpl.cs | 2 +- .../Analysis/Synonym/SolrSynonymParser.cs | 2 +- .../Analysis/Tr/TurkishLowerCaseFilter.cs | 4 +- .../Wikipedia/WikipediaTokenizerImpl.cs | 2 +- .../Icu/Segmentation/ICUTokenizerFactory.cs | 2 +- .../GraphvizFormatter.cs | 4 +- .../Tools/BinaryDictionaryWriter.cs | 4 +- .../MorphosyntacticTagsAttribute.cs | 2 +- .../Language/ColognePhonetic.cs | 2 +- .../Language/DoubleMetaphone.cs | 14 ++--- .../Language/Metaphone.cs | 10 ++-- .../Language/Soundex.cs | 2 +- .../PhoneticFilterFactory.cs | 2 +- .../Hhmm/HHMMSegmenter.cs | 2 +- .../Egothor.Stemmer/MultiTrie2.cs | 6 +-- .../ByTask/Feeds/DirContentSource.cs | 2 +- .../ByTask/Feeds/EnwikiContentSource.cs | 2 +- .../ByTask/Feeds/ReutersContentSource.cs | 2 +- .../ByTask/Utils/Algorithm.cs | 2 +- .../ByTask/Utils/Config.cs | 8 +-- .../Quality/QualityStats.cs | 4 +- .../Quality/Trec/TrecTopicsReader.cs | 2 +- .../Quality/Utils/SubmissionReport.cs | 2 +- .../Support/Sax/Helpers/AttributesImpl.cs | 2 +- .../Support/TagSoup/Parser.cs | 2 +- .../BlockTerms/BlockTermsWriter.cs | 2 +- .../BlockTerms/FixedGapTermsIndexWriter.cs | 2 +- .../BlockTerms/VariableGapTermsIndexWriter.cs | 2 +- .../Memory/FSTOrdTermsReader.cs | 4 +- .../Memory/FSTOrdTermsWriter.cs | 4 +- .../Memory/FSTTermsReader.cs | 4 +- .../Memory/FSTTermsWriter.cs | 4 +- .../SimpleText/SimpleTextFieldInfosReader.cs | 2 +- .../SimpleText/SimpleTextLiveDocsFormat.cs | 2 +- .../SimpleText/SimpleTextSegmentInfoReader.cs | 2 +- .../SimpleTextStoredFieldsReader.cs | 2 +- src/Lucene.Net.Facet/FacetsConfig.cs | 4 +- src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs | 2 +- .../Term/TermDistinctValuesCollector.cs | 2 +- .../MemoryIndex.MemoryIndexReader.cs | 2 +- src/Lucene.Net.Misc/Index/PKIndexSplitter.cs | 2 +- src/Lucene.Net.Queries/CommonTermsQuery.cs | 2 +- .../Classic/MultiFieldQueryParser.cs | 2 +- .../BooleanModifiersQueryNodeProcessor.cs | 2 +- .../Standard/Parser/EscapeQuerySyntaxImpl.cs | 2 +- .../BooleanQuery2ModifierNodeProcessor.cs | 2 +- .../Processors/WildcardQueryNodeProcessor.cs | 2 +- .../Spell/JaroWinklerDistance.cs | 2 +- .../Suggest/Analyzing/FreeTextSuggester.cs | 4 +- .../Suggest/DocumentDictionary.cs | 2 +- .../Suggest/Fst/FSTCompletion.cs | 2 +- .../Analysis/CollationTestBase.cs | 10 ++-- .../Index/BaseDocValuesFormatTestCase.cs | 14 ++--- .../ThreadedIndexingAndSearchingTestCase.cs | 4 +- .../Util/LuceneRandomSeedInitializer.cs | 2 +- .../Support/Util/UseTempLineDocsFileRule.cs | 2 +- .../Util/LuceneTestCase.cs | 2 +- src/Lucene.Net/Analysis/Token.cs | 2 +- src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs | 2 +- .../CompressingTermVectorsReader.cs | 2 +- src/Lucene.Net/Codecs/DocValuesConsumer.cs | 14 ++--- .../Codecs/Lucene41/Lucene41PostingsReader.cs | 2 +- .../Lucene45/Lucene45DocValuesConsumer.cs | 2 +- .../Index/FreqProxTermsWriterPerField.cs | 5 +- src/Lucene.Net/Index/PrefixCodedTerms.cs | 2 +- src/Lucene.Net/Index/ReadersAndUpdates.cs | 4 +- .../Index/TermVectorsConsumerPerField.cs | 5 +- src/Lucene.Net/Search/FieldCacheImpl.cs | 2 +- src/Lucene.Net/Search/FuzzyTermsEnum.cs | 2 +- src/Lucene.Net/Search/MultiPhraseQuery.cs | 2 +- src/Lucene.Net/Search/PhraseQuery.cs | 2 +- src/Lucene.Net/Store/CompoundFileWriter.cs | 2 +- src/Lucene.Net/Store/NativeFSLockFactory.cs | 4 +- src/Lucene.Net/Util/AttributeSource.cs | 2 +- src/Lucene.Net/Util/Fst/PositiveIntOutputs.cs | 2 +- src/Lucene.Net/Util/RamUsageEstimator.cs | 2 +- .../CommandLine/CommandLineApplication.cs | 2 +- .../lucene-cli/CommandLine/CommandOption.cs | 2 +- 100 files changed, 189 insertions(+), 195 deletions(-) diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Bg/BulgarianStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Bg/BulgarianStemmer.cs index 42048cbf99..9afbe57612 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Bg/BulgarianStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Bg/BulgarianStemmer.cs @@ -89,7 +89,7 @@ public virtual int Stem(char[] s, int len) /// input buffer /// length of input buffer /// new stemmed length - private int RemoveArticle(char[] s, int len) + private static int RemoveArticle(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 6 && StemmerUtil.EndsWith(s, len, "ият")) { @@ -112,7 +112,7 @@ private int RemoveArticle(char[] s, int len) return len; } - private int RemovePlural(char[] s, int len) + private static int RemovePlural(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 6) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemmer.cs index 3a6ec87253..a7046d1a51 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianStemmer.cs @@ -92,7 +92,7 @@ protected internal virtual string Stem(string term) /// Checks a term if it can be processed correctly. /// /// true if, and only if, the given term consists in letters. - private bool IsStemmable(string term) + private static bool IsStemmable(string term) // LUCENENET: CA1822: Mark members as static { for (int c = 0; c < term.Length; c++) { @@ -109,7 +109,7 @@ private bool IsStemmable(string term) /// Checks a term if it can be processed indexed. /// /// true if it can be indexed - private bool IsIndexable(string term) + private static bool IsIndexable(string term) // LUCENENET: CA1822: Mark members as static { return (term.Length < 30) && (term.Length > 2); } @@ -118,7 +118,7 @@ private bool IsIndexable(string term) /// See if string is 'a','e','i','o','u' /// /// true if is vowel - private bool IsVowel(char value) + private static bool IsVowel(char value) // LUCENENET: CA1822: Mark members as static { return (value == 'a') || (value == 'e') || (value == 'i') || (value == 'o') || (value == 'u'); } @@ -259,7 +259,7 @@ private string GetRV(string value) /// 4) ç -> c /// /// null or a string transformed - private string ChangeTerm(string value) + private static string ChangeTerm(string value) // LUCENENET: CA1822: Mark members as static { int j; string r = ""; @@ -319,7 +319,7 @@ private string ChangeTerm(string value) /// Check if a string ends with a suffix /// /// true if the string ends with the specified suffix - private bool Suffix(string value, string suffix) + private static bool Suffix(string value, string suffix) // LUCENENET: CA1822: Mark members as static { // be-safe !!! diff --git a/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/HTMLStripCharFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/HTMLStripCharFilter.cs index c1ddaacee9..9f371c9848 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/HTMLStripCharFilter.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/CharFilter/HTMLStripCharFilter.cs @@ -31134,7 +31134,7 @@ private char YyCharAt(int pos) /// in error fallback rules. /// /// the code of the errormessage to display - private void ZzScanError(int errorCode) + private static void ZzScanError(int errorCode) // LUCENENET: CA1822: Mark members as static { string message; // LUCENENET specific: Defensive check so we don't have to catch IndexOutOfRangeException diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs index 513ecb761b..db92089abb 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Compound/Hyphenation/PatternParser.cs @@ -191,7 +191,7 @@ private void ParseNode(XmlReader node) } } - private XmlReaderSettings GetXmlReaderSettings() + private static XmlReaderSettings GetXmlReaderSettings() // LUCENENET: CA1822: Mark members as static { return @@ -202,7 +202,7 @@ private XmlReaderSettings GetXmlReaderSettings() }; } - private IDictionary GetAttributes(XmlReader node) + private static IDictionary GetAttributes(XmlReader node) // LUCENENET: CA1822: Mark members as static { var result = new Dictionary(); if (node.HasAttributes) diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Cz/CzechStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Cz/CzechStemmer.cs index 0f1c590a80..cc6c97c7e1 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Cz/CzechStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Cz/CzechStemmer.cs @@ -51,7 +51,7 @@ public virtual int Stem(char[] s, int len) return len; } - private int RemoveCase(char[] s, int len) + private static int RemoveCase(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 7 && StemmerUtil.EndsWith(s, len, "atech")) { @@ -96,7 +96,7 @@ private int RemoveCase(char[] s, int len) return len; } - private int RemovePossessives(char[] s, int len) + private static int RemovePossessives(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 5 && (StemmerUtil.EndsWith(s, len, "ov") || StemmerUtil.EndsWith(s, len, "in") || StemmerUtil.EndsWith(s, len, "ův"))) { @@ -106,7 +106,7 @@ private int RemovePossessives(char[] s, int len) return len; } - private int Normalize(char[] s, int len) + private static int Normalize(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (StemmerUtil.EndsWith(s, len, "čt")) // čt -> ck { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/De/GermanLightStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/De/GermanLightStemmer.cs index 305e07964a..0b93327c24 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/De/GermanLightStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/De/GermanLightStemmer.cs @@ -100,7 +100,7 @@ public virtual int Stem(char[] s, int len) return Step2(s, len); } - private bool StEnding(char ch) + private static bool StEnding(char ch) // LUCENENET: CA1822: Mark members as static { switch (ch) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemmer.cs index d7a842ea79..bdb1413a02 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/De/GermanStemmer.cs @@ -75,7 +75,7 @@ protected internal virtual string Stem(string term) /// Checks if a term could be stemmed. /// /// true if, and only if, the given term consists in letters. - private bool IsStemmable(string term) + private static bool IsStemmable(string term) // LUCENENET: CA1822: Mark members as static { for (int c = 0; c < term.Length; c++) { @@ -159,7 +159,7 @@ private void Optimize(StringBuilder buffer) /// /// Removes a particle denotion ("ge") from a term. /// - private void RemoveParticleDenotion(StringBuilder buffer) + private static void RemoveParticleDenotion(StringBuilder buffer) // LUCENENET: CA1822: Mark members as static { if (buffer.Length > 4) { @@ -265,7 +265,7 @@ private void Substitute(StringBuilder buffer) /// character combinations. Umlauts will remain as their corresponding vowel, /// as "ß" remains as "ss". /// - private void Resubstitute(StringBuilder buffer) + private static void Resubstitute(StringBuilder buffer) // LUCENENET: CA1822: Mark members as static { for (int c = 0; c < buffer.Length; c++) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/El/GreekLowerCaseFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/El/GreekLowerCaseFilter.cs index c16a250048..7562274ca2 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/El/GreekLowerCaseFilter.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/El/GreekLowerCaseFilter.cs @@ -72,7 +72,7 @@ public override bool IncrementToken() } } - private int LowerCase(int codepoint) + private static int LowerCase(int codepoint) // LUCENENET: CA1822: Mark members as static { switch (codepoint) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/El/GreekStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/El/GreekStemmer.cs index 9724b7ff61..407dd183aa 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/El/GreekStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/El/GreekStemmer.cs @@ -79,7 +79,7 @@ public virtual int Stem(char[] s, int len) return Rule22(s, len); } - private int Rule0(char[] s, int len) + private static int Rule0(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 9 && (StemmerUtil.EndsWith(s, len, "καθεστωτοσ") || StemmerUtil.EndsWith(s, len, "καθεστωτων"))) @@ -183,7 +183,7 @@ private int Rule0(char[] s, int len) return len; } - private int Rule1(char[] s, int len) + private static int Rule1(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 4 && (StemmerUtil.EndsWith(s, len, "αδεσ") || StemmerUtil.EndsWith(s, len, "αδων"))) @@ -206,7 +206,7 @@ private int Rule1(char[] s, int len) return len; } - private int Rule2(char[] s, int len) + private static int Rule2(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 4 && (StemmerUtil.EndsWith(s, len, "εδεσ") || StemmerUtil.EndsWith(s, len, "εδων"))) @@ -227,7 +227,7 @@ private int Rule2(char[] s, int len) return len; } - private int Rule3(char[] s, int len) + private static int Rule3(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 5 && (StemmerUtil.EndsWith(s, len, "ουδεσ") || StemmerUtil.EndsWith(s, len, "ουδων"))) @@ -259,7 +259,7 @@ private int Rule3(char[] s, int len) private static readonly CharArraySet exc4 = new CharArraySet(LuceneVersion.LUCENE_CURRENT, new string[] { "θ", "δ", "ελ", "γαλ", "ν", "π", "ιδ", "παρ" }, false); #pragma warning restore 612, 618 - private int Rule4(char[] s, int len) + private static int Rule4(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 3 && (StemmerUtil.EndsWith(s, len, "εωσ") || StemmerUtil.EndsWith(s, len, "εων"))) @@ -273,7 +273,7 @@ private int Rule4(char[] s, int len) return len; } - private int Rule5(char[] s, int len) + private static int Rule5(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 2 && StemmerUtil.EndsWith(s, len, "ια")) { @@ -305,7 +305,7 @@ private int Rule5(char[] s, int len) "πετσ", "πιτσ", "πικαντ", "πλιατσ", "ποστελν", "πρωτοδ", "σερτ", "συναδ", "τσαμ", "υποδ", "φιλον", "φυλοδ", "χασ" }, false); - private int Rule6(char[] s, int len) + private static int Rule6(char[] s, int len) // LUCENENET: CA1822: Mark members as static { bool removed = false; if (len > 3 && (StemmerUtil.EndsWith(s, len, "ικα") || @@ -338,7 +338,7 @@ private int Rule6(char[] s, int len) new string[] { "αναπ", "αποθ", "αποκ", "αποστ", "βουβ", "ξεθ", "ουλ", "πεθ", "πικρ", "ποτ", "σιχ", "χ" }, false); - private int Rule7(char[] s, int len) + private static int Rule7(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len == 5 && StemmerUtil.EndsWith(s, len, "αγαμε")) { @@ -396,7 +396,7 @@ private int Rule7(char[] s, int len) "ολογαλ", "πενταρφ", "περηφ", "περιτρ", "πλατ", "πολυδαπ", "πολυμηχ", "στεφ", "ταβ", "τετ", "υπερηφ", "υποκοπ", "χαμηλοδαπ", "ψηλοταβ" }, false); - private int Rule8(char[] s, int len) + private static int Rule8(char[] s, int len) // LUCENENET: CA1822: Mark members as static { bool removed = false; @@ -458,7 +458,7 @@ private int Rule8(char[] s, int len) "βαρον", "ντρ", "σκ", "κοπ", "μπορ", "νιφ", "παγ", "παρακαλ", "σερπ", "σκελ", "συρφ", "τοκ", "υ", "δ", "εμ", "θαρρ", "θ" }, false); - private int Rule9(char[] s, int len) + private static int Rule9(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 5 && StemmerUtil.EndsWith(s, len, "ησετε")) { @@ -509,7 +509,7 @@ private int Rule9(char[] s, int len) return len; } - private int Rule10(char[] s, int len) + private static int Rule10(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 5 && (StemmerUtil.EndsWith(s, len, "οντασ") || StemmerUtil.EndsWith(s, len, "ωντασ"))) { @@ -529,7 +529,7 @@ private int Rule10(char[] s, int len) return len; } - private int Rule11(char[] s, int len) + private static int Rule11(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 6 && StemmerUtil.EndsWith(s, len, "ομαστε")) { @@ -563,7 +563,7 @@ private int Rule11(char[] s, int len) new string[] { "αλ", "αρ", "εκτελ", "ζ", "μ", "ξ", "παρακαλ", "αρ", "προ", "νισ" }, false); #pragma warning restore 612, 618 - private int Rule12(char[] s, int len) + private static int Rule12(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 5 && StemmerUtil.EndsWith(s, len, "ιεστε")) { @@ -592,7 +592,7 @@ private int Rule12(char[] s, int len) #pragma warning restore 612, 618 new string[] { "διαθ", "θ", "παρακαταθ", "προσθ", "συνθ" }, false); - private int Rule13(char[] s, int len) + private static int Rule13(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 6 && StemmerUtil.EndsWith(s, len, "ηθηκεσ")) { @@ -638,7 +638,7 @@ private int Rule13(char[] s, int len) "λεχ", "μ", "πατ", "ρ", "λ", "μεδ", "μεσαζ", "υποτειν", "αμ", "αιθ", "ανηκ", "δεσποζ", "ενδιαφερ", "δε", "δευτερευ", "καθαρευ", "πλε", "τσα" }, false); - private int Rule14(char[] s, int len) + private static int Rule14(char[] s, int len) // LUCENENET: CA1822: Mark members as static { bool removed = false; @@ -692,7 +692,7 @@ private int Rule14(char[] s, int len) #pragma warning restore 612, 618 new string[] { "ψοφ", "ναυλοχ" }, false); - private int Rule15(char[] s, int len) + private static int Rule15(char[] s, int len) // LUCENENET: CA1822: Mark members as static { bool removed = false; if (len > 4 && StemmerUtil.EndsWith(s, len, "αγεσ")) @@ -737,7 +737,7 @@ private int Rule15(char[] s, int len) #pragma warning restore 612, 618 new string[] { "ν", "χερσον", "δωδεκαν", "ερημον", "μεγαλον", "επταν" }, false); - private int Rule16(char[] s, int len) + private static int Rule16(char[] s, int len) // LUCENENET: CA1822: Mark members as static { bool removed = false; if (len > 4 && StemmerUtil.EndsWith(s, len, "ησου")) @@ -765,7 +765,7 @@ private int Rule16(char[] s, int len) #pragma warning restore 612, 618 new string[] { "ασβ", "σβ", "αχρ", "χρ", "απλ", "αειμν", "δυσχρ", "ευχρ", "κοινοχρ", "παλιμψ" }, false); - private int Rule17(char[] s, int len) + private static int Rule17(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 4 && StemmerUtil.EndsWith(s, len, "ηστε")) { @@ -785,7 +785,7 @@ private int Rule17(char[] s, int len) #pragma warning restore 612, 618 new string[] { "ν", "ρ", "σπι", "στραβομουτσ", "κακομουτσ", "εξων" }, false); - private int Rule18(char[] s, int len) + private static int Rule18(char[] s, int len) // LUCENENET: CA1822: Mark members as static { bool removed = false; @@ -816,7 +816,7 @@ private int Rule18(char[] s, int len) #pragma warning restore 612, 618 new string[] { "παρασουσ", "φ", "χ", "ωριοπλ", "αζ", "αλλοσουσ", "ασουσ" }, false); - private int Rule19(char[] s, int len) + private static int Rule19(char[] s, int len) // LUCENENET: CA1822: Mark members as static { bool removed = false; @@ -841,7 +841,7 @@ private int Rule19(char[] s, int len) return len; } - private int Rule20(char[] s, int len) + private static int Rule20(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 5 && (StemmerUtil.EndsWith(s, len, "ματων") || StemmerUtil.EndsWith(s, len, "ματοσ"))) { @@ -854,7 +854,7 @@ private int Rule20(char[] s, int len) return len; } - private int Rule21(char[] s, int len) + private static int Rule21(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 9 && StemmerUtil.EndsWith(s, len, "ιοντουσαν")) { @@ -973,7 +973,7 @@ private int Rule21(char[] s, int len) return len; } - private int Rule22(char[] s, int len) + private static int Rule22(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (StemmerUtil.EndsWith(s, len, "εστερ") || StemmerUtil.EndsWith(s, len, "εστατ")) @@ -1002,7 +1002,7 @@ private int Rule22(char[] s, int len) /// The length of the char[] array. /// A object to check if the word given ends with these characters. /// True if the word ends with the suffix given , false otherwise. - private bool EndsWith(char[] s, int len, string suffix) + private static bool EndsWith(char[] s, int len, string suffix) // LUCENENET: CA1822: Mark members as static { int suffixLen = suffix.Length; if (suffixLen > len) @@ -1028,7 +1028,7 @@ private bool EndsWith(char[] s, int len, string suffix) /// The length of the array. /// True if the word contained in the leading portion of array , /// ends with a vowel , false otherwise. - private bool EndsWithVowel(char[] s, int len) + private static bool EndsWithVowel(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len == 0) { @@ -1057,7 +1057,7 @@ private bool EndsWithVowel(char[] s, int len) /// The length of the array. /// True if the word contained in the leading portion of array , /// ends with a vowel , false otherwise. - private bool EndsWithVowelNoY(char[] s, int len) + private static bool EndsWithVowelNoY(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len == 0) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs index 409dc1a9de..9c224c57ad 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/En/KStemmer.cs @@ -569,7 +569,7 @@ private static CharArrayMap InitializeDictHash() return d; } - private bool IsAlpha(char ch) + private static bool IsAlpha(char ch) // LUCENENET: CA1822: Mark members as static { return ch >= 'a' && ch <= 'z'; // terms must be lowercased already } diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Fi/FinnishLightStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Fi/FinnishLightStemmer.cs index 3ee19c808b..31ddc82ecb 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Fi/FinnishLightStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Fi/FinnishLightStemmer.cs @@ -122,7 +122,7 @@ private int Step1(char[] s, int len) return len; } - private int Step2(char[] s, int len) + private static int Step2(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 5) { @@ -241,7 +241,7 @@ private int Step3(char[] s, int len) return len; } - private int Norm1(char[] s, int len) + private static int Norm1(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 5 && StemmerUtil.EndsWith(s, len, "hde")) { @@ -275,7 +275,7 @@ private int Norm1(char[] s, int len) return len; } - private int Norm2(char[] s, int len) + private static int Norm2(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 8) { @@ -312,7 +312,7 @@ private int Norm2(char[] s, int len) return len; } - private bool IsVowel(char ch) + private static bool IsVowel(char ch) // LUCENENET: CA1822: Mark members as static { switch (ch) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Fr/FrenchLightStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Fr/FrenchLightStemmer.cs index 099d111e91..5c1b92f99e 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Fr/FrenchLightStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Fr/FrenchLightStemmer.cs @@ -275,7 +275,7 @@ public virtual int Stem(char[] s, int len) return Norm(s, len); } - private int Norm(char[] s, int len) + private static int Norm(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 4) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Ga/IrishLowerCaseFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Ga/IrishLowerCaseFilter.cs index 5696a520cf..0eab8d90a6 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Ga/IrishLowerCaseFilter.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Ga/IrishLowerCaseFilter.cs @@ -74,7 +74,7 @@ public override bool IncrementToken() } } - private bool IsUpperVowel(int v) + private static bool IsUpperVowel(int v) // LUCENENET: CA1822: Mark members as static { switch (v) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemmer.cs index ca1e84f974..92d83c428d 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Hu/HungarianLightStemmer.cs @@ -233,7 +233,7 @@ private int RemovePossessive(char[] s, int len) return len; } - private int RemovePlural(char[] s, int len) + private static int RemovePlural(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 3 && s[len - 1] == 'k') { @@ -254,7 +254,7 @@ private int RemovePlural(char[] s, int len) return len; } - private int Normalize(char[] s, int len) + private static int Normalize(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 3) { @@ -270,7 +270,7 @@ private int Normalize(char[] s, int len) return len; } - private bool IsVowel(char ch) + private static bool IsVowel(char ch) // LUCENENET: CA1822: Mark members as static { switch (ch) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs b/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs index 5008384c0f..2f0ff37320 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Dictionary.cs @@ -449,7 +449,7 @@ private void ReadAffixFile(Stream affixStream, Encoding decoder) stripOffsets[currentIndex] = currentOffset; } - private FST AffixFST(JCG.SortedDictionary> affixes) + private static FST AffixFST(JCG.SortedDictionary> affixes) // LUCENENET: CA1822: Mark members as static { Int32SequenceOutputs outputs = Int32SequenceOutputs.Singleton; Builder builder = new Builder(FST.INPUT_TYPE.BYTE4, outputs); @@ -660,7 +660,7 @@ private void ParseAffix(JCG.SortedDictionary> affixes, } } - private FST ParseConversions(TextReader reader, int num, int lineNumber) + private static FST ParseConversions(TextReader reader, int num, int lineNumber) // LUCENENET: CA1822: Mark members as static { IDictionary mappings = new JCG.SortedDictionary(StringComparer.Ordinal); @@ -754,7 +754,7 @@ private static IDictionary LoadCharsetAliases() // LUCENENET: Av /// Encoding to retrieve the instance for /// for the given encoding // LUCENENET NOTE: This was getJavaEncoding in Lucene - private Encoding GetSystemEncoding(string encoding) + private static Encoding GetSystemEncoding(string encoding) // LUCENENET: CA1822: Mark members as static { if (string.IsNullOrEmpty(encoding)) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Stemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Stemmer.cs index 2d415b6205..520e57481e 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Stemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Hunspell/Stemmer.cs @@ -724,7 +724,7 @@ internal IList ApplyAffix(char[] strippedWord, int length, int affix, /// Array of flags to cross check against. Can be null /// If true, will match a zero length flags array. /// true if the flag is found in the array or the array is null, false otherwise - private bool HasCrossCheckedFlag(char flag, char[] flags, bool matchEmpty) + private static bool HasCrossCheckedFlag(char flag, char[] flags, bool matchEmpty) // LUCENENET: CA1822: Mark members as static { return (flags.Length == 0 && matchEmpty) || Array.BinarySearch(flags, flag) >= 0; } diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Id/IndonesianStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Id/IndonesianStemmer.cs index 744f6c1862..9b20826d55 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Id/IndonesianStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Id/IndonesianStemmer.cs @@ -112,7 +112,7 @@ private int StemDerivational(char[] text, int length) return length; } - private bool IsVowel(char ch) + private static bool IsVowel(char ch) // LUCENENET: CA1822: Mark members as static { switch (ch) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/In/IndicNormalizer.cs b/src/Lucene.Net.Analysis.Common/Analysis/In/IndicNormalizer.cs index ac897cc859..4ecffca068 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/In/IndicNormalizer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/In/IndicNormalizer.cs @@ -340,7 +340,7 @@ private int Compose(int ch0, Regex block0, ScriptData sd, char[] text, int pos, /// /// LUCENENET: Returns the unicode block for the specified character /// - private Regex GetBlockForChar(char c) + private static Regex GetBlockForChar(char c) // LUCENENET: CA1822: Mark members as static { string charAsString = c.ToString(); foreach (var block in scripts.Keys) diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Lv/LatvianStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Lv/LatvianStemmer.cs index b4df86d04f..c7452bc40a 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Lv/LatvianStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Lv/LatvianStemmer.cs @@ -101,7 +101,7 @@ internal Affix(string affix, int vc, bool palatalizes) /// z -> ž /// /// - private int Unpalatalize(char[] s, int len) + private static int Unpalatalize(char[] s, int len) // LUCENENET: CA1822: Mark members as static { // we check the character removed: if its -u then // its 2,5, or 6 gen pl., and these two can only apply then. @@ -189,7 +189,7 @@ private int Unpalatalize(char[] s, int len) /// Count the vowels in the string, we always require at least /// one in the remaining stem to accept it. /// - private int NumVowels(char[] s, int len) + private static int NumVowels(char[] s, int len) // LUCENENET: CA1822: Mark members as static { int n = 0; for (int i = 0; i < len; i++) diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs index 6047ec1dd8..439fc0f04a 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Miscellaneous/WordDelimiterFilterFactory.cs @@ -179,7 +179,7 @@ private byte[] ParseTypes(IList rules) return types; } - private byte ParseType(string s) + private static byte ParseType(string s) // LUCENENET: CA1822: Mark members as static { if (s.Equals("LOWER", StringComparison.Ordinal)) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Pt/PortugueseLightStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Pt/PortugueseLightStemmer.cs index c37e40b4b4..e2046e1d22 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Pt/PortugueseLightStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Pt/PortugueseLightStemmer.cs @@ -136,7 +136,7 @@ public virtual int Stem(char[] s, int len) return len; } - private int RemoveSuffix(char[] s, int len) + private static int RemoveSuffix(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 4 && StemmerUtil.EndsWith(s, len, "es")) { @@ -202,7 +202,7 @@ private int RemoveSuffix(char[] s, int len) return len; } - private int NormFeminine(char[] s, int len) + private static int NormFeminine(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 7 && (StemmerUtil.EndsWith(s, len, "inha") || StemmerUtil.EndsWith(s, len, "iaca") || StemmerUtil.EndsWith(s, len, "eira"))) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Ru/RussianLightStemmer.cs b/src/Lucene.Net.Analysis.Common/Analysis/Ru/RussianLightStemmer.cs index 4e22e560da..628e598825 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Ru/RussianLightStemmer.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Ru/RussianLightStemmer.cs @@ -71,7 +71,7 @@ public virtual int Stem(char[] s, int len) return Normalize(s, len); } - private int Normalize(char[] s, int len) + private static int Normalize(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 3) { @@ -91,7 +91,7 @@ private int Normalize(char[] s, int len) return len; } - private int RemoveCase(char[] s, int len) + private static int RemoveCase(char[] s, int len) // LUCENENET: CA1822: Mark members as static { if (len > 6 && (StemmerUtil.EndsWith(s, len, "иями") || StemmerUtil.EndsWith(s, len, "оями"))) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Standard/UAX29URLEmailTokenizerImpl.cs b/src/Lucene.Net.Analysis.Common/Analysis/Standard/UAX29URLEmailTokenizerImpl.cs index 08a780c26f..c011c675ec 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Standard/UAX29URLEmailTokenizerImpl.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Standard/UAX29URLEmailTokenizerImpl.cs @@ -9343,7 +9343,7 @@ public char YyCharAt(int pos) /// in error fallback rules. /// /// the code of the errormessage to display - private void ZzScanError(int errorCode) + private static void ZzScanError(int errorCode) // LUCENENET: CA1822: Mark members as static { string message; // LUCENENET specific: Defensive check so we don't have to catch IndexOutOfRangeException diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SolrSynonymParser.cs b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SolrSynonymParser.cs index 128c4498fd..79f4d4deb9 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SolrSynonymParser.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Synonym/SolrSynonymParser.cs @@ -188,7 +188,7 @@ private static string[] Split(string s, string separator) return list.ToArray(); } - private string Unescape(string s) + private static string Unescape(string s) // LUCENENET: CA1822: Mark members as static { if (s.IndexOf("\\", StringComparison.Ordinal) >= 0) { diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Tr/TurkishLowerCaseFilter.cs b/src/Lucene.Net.Analysis.Common/Analysis/Tr/TurkishLowerCaseFilter.cs index ab6c64bb06..8e8f87dbb8 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Tr/TurkishLowerCaseFilter.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Tr/TurkishLowerCaseFilter.cs @@ -111,7 +111,7 @@ public override sealed bool IncrementToken() /// lookahead for a combining dot above. /// other NSMs may be in between. /// - private bool IsBeforeDot(char[] s, int pos, int len) + private static bool IsBeforeDot(char[] s, int pos, int len) // LUCENENET: CA1822: Mark members as static { for (int i = pos; i < len;) { @@ -134,7 +134,7 @@ private bool IsBeforeDot(char[] s, int pos, int len) /// delete a character in-place. /// rarely happens, only if is found after an i /// - private int Delete(char[] s, int pos, int len) + private static int Delete(char[] s, int pos, int len) // LUCENENET: CA1822: Mark members as static { if (pos < len) Array.Copy(s, pos + 1, s, pos, len - pos - 1); diff --git a/src/Lucene.Net.Analysis.Common/Analysis/Wikipedia/WikipediaTokenizerImpl.cs b/src/Lucene.Net.Analysis.Common/Analysis/Wikipedia/WikipediaTokenizerImpl.cs index a1f68463a9..f7e6fd4a3f 100644 --- a/src/Lucene.Net.Analysis.Common/Analysis/Wikipedia/WikipediaTokenizerImpl.cs +++ b/src/Lucene.Net.Analysis.Common/Analysis/Wikipedia/WikipediaTokenizerImpl.cs @@ -703,7 +703,7 @@ public char YyCharAt(int pos) /// in error fallback rules. /// /// the code of the errormessage to display - private void ZzScanError(int errorCode) + private static void ZzScanError(int errorCode) // LUCENENET: CA1822: Mark members as static { string message; // LUCENENET specific: Defensive check so we don't have to catch IndexOutOfRangeException diff --git a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerFactory.cs b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerFactory.cs index 5368b4da6e..a9ce0c1029 100644 --- a/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerFactory.cs +++ b/src/Lucene.Net.Analysis.ICU/Analysis/Icu/Segmentation/ICUTokenizerFactory.cs @@ -143,7 +143,7 @@ public override RuleBasedBreakIterator GetBreakIterator(int script) } } - private BreakIterator ParseRules(string filename, IResourceLoader loader) + private static BreakIterator ParseRules(string filename, IResourceLoader loader) // LUCENENET: CA1822: Mark members as static { StringBuilder rules = new StringBuilder(); Stream rulesStream = loader.OpenResource(filename); diff --git a/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs b/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs index e2c922e36c..0337a91a0e 100644 --- a/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs +++ b/src/Lucene.Net.Analysis.Kuromoji/GraphvizFormatter.cs @@ -172,7 +172,7 @@ private string FormatNodes(JapaneseTokenizer tok, WrappedPositionArray positions return sb.ToString(); } - private string FormatHeader() + private static string FormatHeader() // LUCENENET: CA1822: Mark members as static { StringBuilder sb = new StringBuilder(); sb.Append("digraph viterbi {\n"); @@ -187,7 +187,7 @@ private string FormatHeader() return sb.ToString(); } - private string FormatTrailer() + private static string FormatTrailer() // LUCENENET: CA1822: Mark members as static { return "}"; } diff --git a/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs b/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs index b2e3c465f0..2c7078b3a7 100644 --- a/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs +++ b/src/Lucene.Net.Analysis.Kuromoji/Tools/BinaryDictionaryWriter.cs @@ -191,7 +191,7 @@ public virtual int Put(string[] entry) return m_buffer.Position; } - private bool IsKatakana(string s) + private static bool IsKatakana(string s) // LUCENENET: CA1822: Mark members as static { for (int i = 0; i < s.Length; i++) { @@ -212,7 +212,7 @@ private void WriteKatakana(string s) } } - private string ToKatakana(string s) + private static string ToKatakana(string s) // LUCENENET: CA1822: Mark members as static { char[] text = new char[s.Length]; for (int i = 0; i < s.Length; i++) diff --git a/src/Lucene.Net.Analysis.Morfologik/Morfologik/TokenAttributes/MorphosyntacticTagsAttribute.cs b/src/Lucene.Net.Analysis.Morfologik/Morfologik/TokenAttributes/MorphosyntacticTagsAttribute.cs index 294c72766d..6fd65c0255 100644 --- a/src/Lucene.Net.Analysis.Morfologik/Morfologik/TokenAttributes/MorphosyntacticTagsAttribute.cs +++ b/src/Lucene.Net.Analysis.Morfologik/Morfologik/TokenAttributes/MorphosyntacticTagsAttribute.cs @@ -65,7 +65,7 @@ public override bool Equals(object other) return false; } - private bool Equal(object l1, object l2) + private static bool Equal(object l1, object l2) // LUCENENET: CA1822: Mark members as static { return l1 is null ? (l2 is null) : (l1.Equals(l2)); } diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/ColognePhonetic.cs b/src/Lucene.Net.Analysis.Phonetic/Language/ColognePhonetic.cs index 082d8afcb0..29540edccb 100644 --- a/src/Lucene.Net.Analysis.Phonetic/Language/ColognePhonetic.cs +++ b/src/Lucene.Net.Analysis.Phonetic/Language/ColognePhonetic.cs @@ -475,7 +475,7 @@ public virtual bool IsEncodeEqual(string text1, string text2) /// /// Converts the string to upper case and replaces germanic characters as defined in . /// - private string Preprocess(string text) + private static string Preprocess(string text) // LUCENENET: CA1822: Mark members as static { text = LOCALE_GERMAN.TextInfo.ToUpper(text); diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/DoubleMetaphone.cs b/src/Lucene.Net.Analysis.Phonetic/Language/DoubleMetaphone.cs index 192ae286ef..f77188fd63 100644 --- a/src/Lucene.Net.Analysis.Phonetic/Language/DoubleMetaphone.cs +++ b/src/Lucene.Net.Analysis.Phonetic/Language/DoubleMetaphone.cs @@ -251,7 +251,7 @@ public virtual int MaxCodeLen /// Handles 'A', 'E', 'I', 'O', 'U', and 'Y' cases. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - private int HandleAEIOUY(DoubleMetaphoneResult result, int index) + private static int HandleAEIOUY(DoubleMetaphoneResult result, int index) // LUCENENET: CA1822: Mark members as static { if (index == 0) { @@ -415,7 +415,7 @@ private static int HandleCH(string value, DoubleMetaphoneResult result, int inde /// /// Handles 'D' cases. /// - private int HandleD(string value, DoubleMetaphoneResult result, int index) + private static int HandleD(string value, DoubleMetaphoneResult result, int index) // LUCENENET: CA1822: Mark members as static { if (Contains(value, index, 2, "DG")) { @@ -830,7 +830,7 @@ private int HandleSC(string value, DoubleMetaphoneResult result, int index) /// /// Handles 'T' cases. /// - private int HandleT(string value, DoubleMetaphoneResult result, int index) + private static int HandleT(string value, DoubleMetaphoneResult result, int index) // LUCENENET: CA1822: Mark members as static { if (Contains(value, index, 4, "TION")) { @@ -918,7 +918,7 @@ private int HandleW(string value, DoubleMetaphoneResult result, int index) /// /// Handles 'X' cases. /// - private int HandleX(string value, DoubleMetaphoneResult result, int index) + private static int HandleX(string value, DoubleMetaphoneResult result, int index) // LUCENENET: CA1822: Mark members as static { if (index == 0) { @@ -1076,7 +1076,7 @@ private bool ConditionM0(string value, int index) /// of slavo-germanic origin if it contians any of 'W', 'K', 'CZ', or 'WITZ'. /// [MethodImpl(MethodImplOptions.AggressiveInlining)] - private bool IsSlavoGermanic(string value) + private static bool IsSlavoGermanic(string value) // LUCENENET: CA1822: Mark members as static { return value.IndexOf('W') > -1 || value.IndexOf('K') > -1 || value.IndexOf("CZ", StringComparison.Ordinal) > -1 || value.IndexOf("WITZ", StringComparison.Ordinal) > -1; @@ -1096,7 +1096,7 @@ private static bool IsVowel(char ch) // LUCENENET: CA1822: Mark members as stati /// return true if the value starts with any of 'GN', 'KN', /// 'PN', 'WR' or 'PS'. /// - private bool IsSilentStart(string value) + private static bool IsSilentStart(string value) // LUCENENET: CA1822: Mark members as static { bool result = false; foreach (string element in SILENT_START) @@ -1115,7 +1115,7 @@ private bool IsSilentStart(string value) /// /// Cleans the input. /// - private string CleanInput(string input) + private static string CleanInput(string input) // LUCENENET: CA1822: Mark members as static { if (input is null) { diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/Metaphone.cs b/src/Lucene.Net.Analysis.Phonetic/Language/Metaphone.cs index 875af89b12..0986b8d5d0 100644 --- a/src/Lucene.Net.Analysis.Phonetic/Language/Metaphone.cs +++ b/src/Lucene.Net.Analysis.Phonetic/Language/Metaphone.cs @@ -398,12 +398,12 @@ public virtual string GetMetaphone(string txt) return code.ToString(); } - private bool IsVowel(StringBuilder sb, int index) + private static bool IsVowel(StringBuilder sb, int index) // LUCENENET: CA1822: Mark members as static { return VOWELS.IndexOf(sb[index]) >= 0; } - private bool IsPreviousChar(StringBuilder sb, int index, char c) + private static bool IsPreviousChar(StringBuilder sb, int index, char c) // LUCENENET: CA1822: Mark members as static { bool matches = false; if (index > 0 && @@ -414,7 +414,7 @@ private bool IsPreviousChar(StringBuilder sb, int index, char c) return matches; } - private bool IsNextChar(StringBuilder sb, int index, char c) + private static bool IsNextChar(StringBuilder sb, int index, char c) // LUCENENET: CA1822: Mark members as static { bool matches = false; if (index >= 0 && @@ -425,7 +425,7 @@ private bool IsNextChar(StringBuilder sb, int index, char c) return matches; } - private bool RegionMatch(StringBuilder sb, int index, string test) + private static bool RegionMatch(StringBuilder sb, int index, string test) // LUCENENET: CA1822: Mark members as static { bool matches = false; if (index >= 0 && @@ -437,7 +437,7 @@ private bool RegionMatch(StringBuilder sb, int index, string test) return matches; } - private bool IsLastChar(int wdsz, int n) + private static bool IsLastChar(int wdsz, int n) // LUCENENET: CA1822: Mark members as static { return n + 1 == wdsz; } diff --git a/src/Lucene.Net.Analysis.Phonetic/Language/Soundex.cs b/src/Lucene.Net.Analysis.Phonetic/Language/Soundex.cs index af2c0ddbdb..6fa322eb5e 100644 --- a/src/Lucene.Net.Analysis.Phonetic/Language/Soundex.cs +++ b/src/Lucene.Net.Analysis.Phonetic/Language/Soundex.cs @@ -153,7 +153,7 @@ public Soundex(char[] mapping) this.specialCaseHW = !HasMarker(this.soundexMapping); } - private bool HasMarker(char[] mapping) + private static bool HasMarker(char[] mapping) // LUCENENET: CA1822: Mark members as static { foreach (char ch in mapping) { diff --git a/src/Lucene.Net.Analysis.Phonetic/PhoneticFilterFactory.cs b/src/Lucene.Net.Analysis.Phonetic/PhoneticFilterFactory.cs index cb5a4ec243..0110dd7f41 100644 --- a/src/Lucene.Net.Analysis.Phonetic/PhoneticFilterFactory.cs +++ b/src/Lucene.Net.Analysis.Phonetic/PhoneticFilterFactory.cs @@ -138,7 +138,7 @@ public virtual void Inform(IResourceLoader loader) GetEncoder();//trigger initialization for potential problems to be thrown now } - private Type ResolveEncoder(string name, IResourceLoader loader) + private static Type ResolveEncoder(string name, IResourceLoader loader) // LUCENENET: CA1822: Mark members as static { string lookupName = name; if (name.IndexOf('.') == -1) diff --git a/src/Lucene.Net.Analysis.SmartCn/Hhmm/HHMMSegmenter.cs b/src/Lucene.Net.Analysis.SmartCn/Hhmm/HHMMSegmenter.cs index 610ce5880a..d263a256d4 100644 --- a/src/Lucene.Net.Analysis.SmartCn/Hhmm/HHMMSegmenter.cs +++ b/src/Lucene.Net.Analysis.SmartCn/Hhmm/HHMMSegmenter.cs @@ -35,7 +35,7 @@ public class HHMMSegmenter /// /// input sentence, without start and end markers /// corresponding to the input sentence. - private SegGraph CreateSegGraph(string sentence) + private static SegGraph CreateSegGraph(string sentence) // LUCENENET: CA1822: Mark members as static { int i = 0, j; int length = sentence.Length; diff --git a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/MultiTrie2.cs b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/MultiTrie2.cs index 35057593df..d84551ca88 100644 --- a/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/MultiTrie2.cs +++ b/src/Lucene.Net.Analysis.Stempel/Egothor.Stemmer/MultiTrie2.cs @@ -349,7 +349,7 @@ public override Trie Reduce(Reduce by) return m; } - private bool CannotFollow(char after, char goes) + private static bool CannotFollow(char after, char goes) // LUCENENET: CA1822: Mark members as static { switch (after) { @@ -383,7 +383,7 @@ private bool TrySkip(string @in, int count, out string result) return true; } - private int DashEven(string @in, int from) + private static int DashEven(string @in, int from) // LUCENENET: CA1822: Mark members as static { while (from < @in.Length) { @@ -400,7 +400,7 @@ private int DashEven(string @in, int from) } - private int LengthPP(string cmd) + private static int LengthPP(string cmd) // LUCENENET: CA1822: Mark members as static { int len = 0; for (int i = 0; i < cmd.Length; i++) diff --git a/src/Lucene.Net.Benchmark/ByTask/Feeds/DirContentSource.cs b/src/Lucene.Net.Benchmark/ByTask/Feeds/DirContentSource.cs index af733aad32..06bb70fb4a 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Feeds/DirContentSource.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Feeds/DirContentSource.cs @@ -154,7 +154,7 @@ public virtual void Reset() private int iteration = 0; private Enumerator inputFiles = null; - private DateTime? ParseDate(string dateStr) + private static DateTime? ParseDate(string dateStr) // LUCENENET: CA1822: Mark members as static { if (DateTime.TryParseExact(dateStr, "dd-MMM-yyyy hh:mm:ss.fff", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime temp)) { diff --git a/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs b/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs index 8d81b7c071..fb10a7bcd3 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Feeds/EnwikiContentSource.cs @@ -114,7 +114,7 @@ internal string[] Next() } } - internal string Time(string original) + internal static string Time(string original) // LUCENENET: CA1822: Mark members as static { StringBuilder buffer = new StringBuilder(24); // LUCENENET: We always have 24 chars, so allocate it up front diff --git a/src/Lucene.Net.Benchmark/ByTask/Feeds/ReutersContentSource.cs b/src/Lucene.Net.Benchmark/ByTask/Feeds/ReutersContentSource.cs index 1f1362c0c4..af7122a433 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Feeds/ReutersContentSource.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Feeds/ReutersContentSource.cs @@ -61,7 +61,7 @@ public override void SetConfig(Config config) // LUCENENET specific: DateFormatInfo not used - private DateTime? ParseDate(string dateStr) + private static DateTime? ParseDate(string dateStr) // LUCENENET: CA1822: Mark members as static { if (DateTime.TryParseExact(dateStr, "dd-MMM-yyyy hh:mm:ss.fff", CultureInfo.InvariantCulture, DateTimeStyles.None, out DateTime temp)) { diff --git a/src/Lucene.Net.Benchmark/ByTask/Utils/Algorithm.cs b/src/Lucene.Net.Benchmark/ByTask/Utils/Algorithm.cs index 3275fb1b16..56162161af 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Utils/Algorithm.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Utils/Algorithm.cs @@ -356,7 +356,7 @@ public Algorithm(PerfRunData runData) } } - private string[] InitTasksPackages(Config config) + private static string[] InitTasksPackages(Config config) // LUCENENET: CA1822: Mark members as static { // LUCENENET specific - changing the logic a bit // to add all referenced assemblies by default. diff --git a/src/Lucene.Net.Benchmark/ByTask/Utils/Config.cs b/src/Lucene.Net.Benchmark/ByTask/Utils/Config.cs index 19609eb8c5..8de974e33d 100644 --- a/src/Lucene.Net.Benchmark/ByTask/Utils/Config.cs +++ b/src/Lucene.Net.Benchmark/ByTask/Utils/Config.cs @@ -375,7 +375,7 @@ public virtual int NewRound() return roundNumber; } - private string[] PropToStringArray(string s) + private static string[] PropToStringArray(string s) // LUCENENET: CA1822: Mark members as static { if (s.IndexOf(':') < 0) { @@ -393,7 +393,7 @@ private string[] PropToStringArray(string s) } // extract properties to array, e.g. for "10:100:5" return int[]{10,100,5}. - private int[] PropToInt32Array(string s) + private static int[] PropToInt32Array(string s) // LUCENENET: CA1822: Mark members as static { if (s.IndexOf(':') < 0) { @@ -416,7 +416,7 @@ private int[] PropToInt32Array(string s) } // extract properties to array, e.g. for "10.7:100.4:-2.3" return int[]{10.7,100.4,-2.3}. - private double[] PropToDoubleArray(string s) + private static double[] PropToDoubleArray(string s) // LUCENENET: CA1822: Mark members as static { if (s.IndexOf(':') < 0) { @@ -439,7 +439,7 @@ private double[] PropToDoubleArray(string s) } // extract properties to array, e.g. for "true:true:false" return boolean[]{true,false,false}. - private bool[] PropToBooleanArray(string s) + private static bool[] PropToBooleanArray(string s) // LUCENENET: CA1822: Mark members as static { if (s.IndexOf(':') < 0) { diff --git a/src/Lucene.Net.Benchmark/Quality/QualityStats.cs b/src/Lucene.Net.Benchmark/Quality/QualityStats.cs index 5fd4c696d4..155b8601bf 100644 --- a/src/Lucene.Net.Benchmark/Quality/QualityStats.cs +++ b/src/Lucene.Net.Benchmark/Quality/QualityStats.cs @@ -193,13 +193,13 @@ public virtual void Log(string title, int paddLines, TextWriter logger, string p } private const string padd = " "; - private string Format(string s, int minLen) + private static string Format(string s, int minLen) // LUCENENET: CA1822: Mark members as static { s = (s ?? ""); int n = Math.Max(minLen, s.Length); return (s + padd).Substring(0, n-0); } - private string FracFormat(string frac) + private static string FracFormat(string frac) // LUCENENET: CA1822: Mark members as static { int k = frac.IndexOf('.'); string s1 = padd + frac.Substring(0, k-0); diff --git a/src/Lucene.Net.Benchmark/Quality/Trec/TrecTopicsReader.cs b/src/Lucene.Net.Benchmark/Quality/Trec/TrecTopicsReader.cs index b997ea52d0..d6fc8d4e27 100644 --- a/src/Lucene.Net.Benchmark/Quality/Trec/TrecTopicsReader.cs +++ b/src/Lucene.Net.Benchmark/Quality/Trec/TrecTopicsReader.cs @@ -122,7 +122,7 @@ public virtual QualityQuery[] ReadQueries(TextReader reader) } // read until finding a line that starts with the specified prefix - private StringBuilder Read(TextReader reader, string prefix, StringBuilder sb, bool collectMatchLine, bool collectAll) + private static StringBuilder Read(TextReader reader, string prefix, StringBuilder sb, bool collectMatchLine, bool collectAll) // LUCENENET: CA1822: Mark members as static { sb = sb ?? new StringBuilder(); string sep = ""; diff --git a/src/Lucene.Net.Benchmark/Quality/Utils/SubmissionReport.cs b/src/Lucene.Net.Benchmark/Quality/Utils/SubmissionReport.cs index 5ba9eeacd7..c6dd809676 100644 --- a/src/Lucene.Net.Benchmark/Quality/Utils/SubmissionReport.cs +++ b/src/Lucene.Net.Benchmark/Quality/Utils/SubmissionReport.cs @@ -88,7 +88,7 @@ public virtual void Flush() } private const string padd = " "; - private string Format(string s, int minLen) + private static string Format(string s, int minLen) // LUCENENET: CA1822: Mark members as static { s = (s ?? ""); int n = Math.Max(minLen, s.Length); diff --git a/src/Lucene.Net.Benchmark/Support/Sax/Helpers/AttributesImpl.cs b/src/Lucene.Net.Benchmark/Support/Sax/Helpers/AttributesImpl.cs index 12aa01edb5..c3d689c12c 100644 --- a/src/Lucene.Net.Benchmark/Support/Sax/Helpers/AttributesImpl.cs +++ b/src/Lucene.Net.Benchmark/Support/Sax/Helpers/AttributesImpl.cs @@ -594,7 +594,7 @@ private void EnsureCapacity(int n) /// /// The index to report. /// Always. - private void BadIndex(int index) + private static void BadIndex(int index) // LUCENENET: CA1822: Mark members as static { string msg = "Attempt to modify attribute at illegal index: " + index; diff --git a/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs b/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs index b89a26b25e..2e31c0f07f 100644 --- a/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs +++ b/src/Lucene.Net.Benchmark/Support/TagSoup/Parser.cs @@ -1147,7 +1147,7 @@ private static string[] Split(string val) /// /// /// - private string CleanPublicId(string src) + private static string CleanPublicId(string src) // LUCENENET: CA1822: Mark members as static { if (src is null) { diff --git a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs index 16d308dc97..abed6e6a0b 100644 --- a/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs +++ b/src/Lucene.Net.Codecs/BlockTerms/BlockTermsWriter.cs @@ -118,7 +118,7 @@ public BlockTermsWriter(TermsIndexWriterBase termsIndexWriter, } } - private void WriteHeader(IndexOutput output) + private static void WriteHeader(IndexOutput output) // LUCENENET: CA1822: Mark members as static { CodecUtil.WriteHeader(output, CODEC_NAME, VERSION_CURRENT); } diff --git a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs index db8f2926e1..9afcc48cba 100644 --- a/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs +++ b/src/Lucene.Net.Codecs/BlockTerms/FixedGapTermsIndexWriter.cs @@ -77,7 +77,7 @@ public FixedGapTermsIndexWriter(SegmentWriteState state) } } - private void WriteHeader(IndexOutput output) + private static void WriteHeader(IndexOutput output) // LUCENENET: CA1822: Mark members as static { CodecUtil.WriteHeader(output, CODEC_NAME, VERSION_CURRENT); } diff --git a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs index 474ae6fc48..6590ae0226 100644 --- a/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs +++ b/src/Lucene.Net.Codecs/BlockTerms/VariableGapTermsIndexWriter.cs @@ -203,7 +203,7 @@ public VariableGapTermsIndexWriter(SegmentWriteState state, IndexTermSelector po } } - private void WriteHeader(IndexOutput output) + private static void WriteHeader(IndexOutput output) // LUCENENET: CA1822: Mark members as static { CodecUtil.WriteHeader(output, CODEC_NAME, VERSION_CURRENT); } diff --git a/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs b/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs index 3ca2aba908..8390aa6961 100644 --- a/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs +++ b/src/Lucene.Net.Codecs/Memory/FSTOrdTermsReader.cs @@ -119,7 +119,7 @@ public FSTOrdTermsReader(SegmentReadState state, PostingsReaderBase postingsRead } } - private int ReadHeader(IndexInput @in) + private static int ReadHeader(IndexInput @in) // LUCENENET: CA1822: Mark members as static { return CodecUtil.CheckHeader(@in, FSTOrdTermsWriter.TERMS_CODEC_NAME, FSTOrdTermsWriter.TERMS_VERSION_START, FSTOrdTermsWriter.TERMS_VERSION_CURRENT); } @@ -137,7 +137,7 @@ private void SeekDir(IndexInput @in) @in.Seek(@in.ReadInt64()); } - private void CheckFieldSummary(SegmentInfo info, IndexInput indexIn, IndexInput blockIn, TermsReader field, TermsReader previous) + private static void CheckFieldSummary(SegmentInfo info, IndexInput indexIn, IndexInput blockIn, TermsReader field, TermsReader previous) // LUCENENET: CA1822: Mark members as static { // #docs with field must be <= #docs if (field.docCount < 0 || field.docCount > info.DocCount) diff --git a/src/Lucene.Net.Codecs/Memory/FSTOrdTermsWriter.cs b/src/Lucene.Net.Codecs/Memory/FSTOrdTermsWriter.cs index 3bf6b56eb4..39d3cac17e 100644 --- a/src/Lucene.Net.Codecs/Memory/FSTOrdTermsWriter.cs +++ b/src/Lucene.Net.Codecs/Memory/FSTOrdTermsWriter.cs @@ -239,12 +239,12 @@ protected override void Dispose(bool disposing) } } - private void WriteHeader(IndexOutput @out) + private static void WriteHeader(IndexOutput @out) // LUCENENET: CA1822: Mark members as static { CodecUtil.WriteHeader(@out, TERMS_CODEC_NAME, TERMS_VERSION_CURRENT); } - private void WriteTrailer(IndexOutput output, long dirStart) + private static void WriteTrailer(IndexOutput output, long dirStart) // LUCENENET: CA1822: Mark members as static { output.WriteInt64(dirStart); } diff --git a/src/Lucene.Net.Codecs/Memory/FSTTermsReader.cs b/src/Lucene.Net.Codecs/Memory/FSTTermsReader.cs index 04f12b0223..6bd5b555dc 100644 --- a/src/Lucene.Net.Codecs/Memory/FSTTermsReader.cs +++ b/src/Lucene.Net.Codecs/Memory/FSTTermsReader.cs @@ -116,7 +116,7 @@ public FSTTermsReader(SegmentReadState state, PostingsReaderBase postingsReader) } } - private int ReadHeader(IndexInput @in) + private static int ReadHeader(IndexInput @in) // LUCENENET: CA1822: Mark members as static { return CodecUtil.CheckHeader(@in, FSTTermsWriter.TERMS_CODEC_NAME, FSTTermsWriter.TERMS_VERSION_START, FSTTermsWriter.TERMS_VERSION_CURRENT); } @@ -135,7 +135,7 @@ private void SeekDir(IndexInput @in) } - private void CheckFieldSummary(SegmentInfo info, IndexInput @in, TermsReader field, TermsReader previous) + private static void CheckFieldSummary(SegmentInfo info, IndexInput @in, TermsReader field, TermsReader previous) // LUCENENET: CA1822: Mark members as static { // #docs with field must be <= #docs if (field.docCount < 0 || field.docCount > info.DocCount) diff --git a/src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs b/src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs index af4ebfcfd8..b16525dd44 100644 --- a/src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs +++ b/src/Lucene.Net.Codecs/Memory/FSTTermsWriter.cs @@ -152,12 +152,12 @@ public FSTTermsWriter(SegmentWriteState state, PostingsWriterBase postingsWriter } } - private void WriteHeader(IndexOutput output) + private static void WriteHeader(IndexOutput output) // LUCENENET: CA1822: Mark members as static { CodecUtil.WriteHeader(output, TERMS_CODEC_NAME, TERMS_VERSION_CURRENT); } - private void WriteTrailer(IndexOutput output, long dirStart) + private static void WriteTrailer(IndexOutput output, long dirStart) // LUCENENET: CA1822: Mark members as static { output.WriteInt64(dirStart); } diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs index a7c423a289..d5ccaa2523 100644 --- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs +++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextFieldInfosReader.cs @@ -164,7 +164,7 @@ public virtual Index.DocValuesType DocValuesType(string dvType) return "false".Equals(dvType, StringComparison.Ordinal) ? Index.DocValuesType.NONE : (Index.DocValuesType)Enum.Parse(typeof(Index.DocValuesType), dvType, true); } - private string ReadString(int offset, BytesRef scratch) + private static string ReadString(int offset, BytesRef scratch) // LUCENENET: CA1822: Mark members as static { return Encoding.UTF8.GetString(scratch.Bytes, scratch.Offset + offset, scratch.Length - offset); } diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextLiveDocsFormat.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextLiveDocsFormat.cs index bf1aaa54af..aa0501f875 100644 --- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextLiveDocsFormat.cs +++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextLiveDocsFormat.cs @@ -115,7 +115,7 @@ public override IBits ReadLiveDocs(Directory dir, SegmentCommitInfo info, IOCont /// /// NOTE: This was parseIntAt() in Lucene. /// - private int ParseInt32At(BytesRef bytes, int offset, CharsRef scratch) + private static int ParseInt32At(BytesRef bytes, int offset, CharsRef scratch) // LUCENENET: CA1822: Mark members as static { UnicodeUtil.UTF8toUTF16(bytes.Bytes, bytes.Offset + offset, bytes.Length - offset, scratch); return ArrayUtil.ParseInt32(scratch.Chars, 0, scratch.Length); diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextSegmentInfoReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextSegmentInfoReader.cs index 3bcae92ce2..d9ab87fb0d 100644 --- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextSegmentInfoReader.cs +++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextSegmentInfoReader.cs @@ -115,7 +115,7 @@ public override SegmentInfo Read(Directory directory, string segmentName, IOCont } } - private string ReadString(int offset, BytesRef scratch) + private static string ReadString(int offset, BytesRef scratch) // LUCENENET: CA1822: Mark members as static { return Encoding.UTF8.GetString(scratch.Bytes, scratch.Offset + offset, scratch.Length - offset); } diff --git a/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs b/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs index 92bff47402..4fd3999a44 100644 --- a/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs +++ b/src/Lucene.Net.Codecs/SimpleText/SimpleTextStoredFieldsReader.cs @@ -260,7 +260,7 @@ private int ParseInt32At(int offset) return ArrayUtil.ParseInt32(_scratchUtf16.Chars, 0, _scratchUtf16.Length); } - private bool EqualsAt(BytesRef a, BytesRef b, int bOffset) + private static bool EqualsAt(BytesRef a, BytesRef b, int bOffset) // LUCENENET: CA1822: Mark members as static { return a.Length == b.Length - bOffset && ArrayUtil.Equals(a.Bytes, a.Offset, b.Bytes, b.Offset + bOffset, b.Length - bOffset); diff --git a/src/Lucene.Net.Facet/FacetsConfig.cs b/src/Lucene.Net.Facet/FacetsConfig.cs index 350431fbd5..dd66e3f3cd 100644 --- a/src/Lucene.Net.Facet/FacetsConfig.cs +++ b/src/Lucene.Net.Facet/FacetsConfig.cs @@ -488,7 +488,7 @@ private void ProcessFacetFields(ITaxonomyWriter taxoWriter, IDictionary> byField, Document doc) + private static void ProcessSSDVFacetFields(IDictionary> byField, Document doc) // LUCENENET: CA1822: Mark members as static { //System.out.println("process SSDV: " + byField); foreach (KeyValuePair> ent in byField) @@ -513,7 +513,7 @@ private void ProcessSSDVFacetFields(IDictionary> byField, Document doc) + private static void ProcessAssocFacetFields(ITaxonomyWriter taxoWriter, IDictionary> byField, Document doc) // LUCENENET: CA1822: Mark members as static { foreach (KeyValuePair> ent in byField) { diff --git a/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs b/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs index 46c4309abd..4ef6105051 100644 --- a/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs +++ b/src/Lucene.Net.Facet/Taxonomy/CategoryPath.cs @@ -170,7 +170,7 @@ private static void HasDelimiter(string offender, char delimiter) // LUCENENET: } [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void NoDelimiter(char[] buf, int offset, int len, char delimiter) + private static void NoDelimiter(char[] buf, int offset, int len, char delimiter) // LUCENENET: CA1822: Mark members as static { for (int idx = 0; idx < len; idx++) { diff --git a/src/Lucene.Net.Grouping/Term/TermDistinctValuesCollector.cs b/src/Lucene.Net.Grouping/Term/TermDistinctValuesCollector.cs index 025d6d9c17..19d711b0b6 100644 --- a/src/Lucene.Net.Grouping/Term/TermDistinctValuesCollector.cs +++ b/src/Lucene.Net.Grouping/Term/TermDistinctValuesCollector.cs @@ -94,7 +94,7 @@ public override void Collect(int doc) } } - private bool DoesNotContainOrd(int ord, int[] ords) + private static bool DoesNotContainOrd(int ord, int[] ords) // LUCENENET: CA1822: Mark members as static { if (ords.Length == 0) { diff --git a/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs b/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs index 6113b6a31a..5c0504b16b 100644 --- a/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs +++ b/src/Lucene.Net.Memory/MemoryIndex.MemoryIndexReader.cs @@ -231,7 +231,7 @@ public MemoryTermsEnum(MemoryIndex.MemoryIndexReader outerInstance, Info info) info.SortTerms(); } - internal int BinarySearch(BytesRef b, BytesRef bytesRef, int low, int high, BytesRefHash hash, int[] ords, IComparer comparer) + internal static int BinarySearch(BytesRef b, BytesRef bytesRef, int low, int high, BytesRefHash hash, int[] ords, IComparer comparer) // LUCENENET: CA1822: Mark members as static { int mid; // LUCENENET: IDE0059: Remove unnecessary value assignment while (low <= high) diff --git a/src/Lucene.Net.Misc/Index/PKIndexSplitter.cs b/src/Lucene.Net.Misc/Index/PKIndexSplitter.cs index 07a8a6d3fa..d6d4d8adb0 100644 --- a/src/Lucene.Net.Misc/Index/PKIndexSplitter.cs +++ b/src/Lucene.Net.Misc/Index/PKIndexSplitter.cs @@ -99,7 +99,7 @@ public virtual void Split() } } - private void CreateIndex(IndexWriterConfig config, Directory target, IndexReader reader, Filter preserveFilter, bool negateFilter) + private static void CreateIndex(IndexWriterConfig config, Directory target, IndexReader reader, Filter preserveFilter, bool negateFilter) // LUCENENET: CA1822: Mark members as static { bool success = false; IndexWriter w = new IndexWriter(target, config); diff --git a/src/Lucene.Net.Queries/CommonTermsQuery.cs b/src/Lucene.Net.Queries/CommonTermsQuery.cs index d0125af8c9..40407b2a35 100644 --- a/src/Lucene.Net.Queries/CommonTermsQuery.cs +++ b/src/Lucene.Net.Queries/CommonTermsQuery.cs @@ -180,7 +180,7 @@ protected virtual int CalcHighFreqMinimumNumberShouldMatch(int numOptional) return MinNrShouldMatch(m_highFreqMinNrShouldMatch, numOptional); } - private int MinNrShouldMatch(float minNrShouldMatch, int numOptional) + private static int MinNrShouldMatch(float minNrShouldMatch, int numOptional) // LUCENENET: CA1822: Mark members as static { if (minNrShouldMatch >= 1.0f || minNrShouldMatch == 0.0f) { diff --git a/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs b/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs index ada4c8061d..b132f3d252 100644 --- a/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs +++ b/src/Lucene.Net.QueryParser/Classic/MultiFieldQueryParser.cs @@ -137,7 +137,7 @@ protected internal override Query GetFieldQuery(string field, string queryText, return q2; } - private void ApplySlop(Query q, int slop) + private static void ApplySlop(Query q, int slop) // LUCENENET: CA1822: Mark members as static { if (q is PhraseQuery phraseQuery) { diff --git a/src/Lucene.Net.QueryParser/Flexible/Precedence/Processors/BooleanModifiersQueryNodeProcessor.cs b/src/Lucene.Net.QueryParser/Flexible/Precedence/Processors/BooleanModifiersQueryNodeProcessor.cs index cb54cbb057..ab4b348c2f 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Precedence/Processors/BooleanModifiersQueryNodeProcessor.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Precedence/Processors/BooleanModifiersQueryNodeProcessor.cs @@ -93,7 +93,7 @@ protected override IQueryNode PostProcessNode(IQueryNode node) return node; } - private IQueryNode ApplyModifier(IQueryNode node, Modifier mod) + private static IQueryNode ApplyModifier(IQueryNode node, Modifier mod) // LUCENENET: CA1822: Mark members as static { // check if modifier is not already defined and is default if (!(node is ModifierQueryNode modNode)) diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/EscapeQuerySyntaxImpl.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/EscapeQuerySyntaxImpl.cs index 182a82caae..67adf0bcb1 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/EscapeQuerySyntaxImpl.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Parser/EscapeQuerySyntaxImpl.cs @@ -74,7 +74,7 @@ private static ICharSequence EscapeChar(ICharSequence str, CultureInfo locale) return buffer; } - private ICharSequence EscapeQuoted(ICharSequence str, CultureInfo locale) + private static ICharSequence EscapeQuoted(ICharSequence str, CultureInfo locale) // LUCENENET: CA1822: Mark members as static { if (str is null || str.Length == 0) return str; diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/BooleanQuery2ModifierNodeProcessor.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/BooleanQuery2ModifierNodeProcessor.cs index 06dfe0e464..6fc7f9d7d2 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/BooleanQuery2ModifierNodeProcessor.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/BooleanQuery2ModifierNodeProcessor.cs @@ -167,7 +167,7 @@ protected virtual bool IsDefaultBooleanQueryNode(IQueryNode toTest) return toTest != null && typeof(BooleanQueryNode).Equals(toTest.GetType()); } - private IQueryNode ApplyModifier(IQueryNode node, Modifier mod) + private static IQueryNode ApplyModifier(IQueryNode node, Modifier mod) // LUCENENET: CA1822: Mark members as static { // check if modifier is not already defined and is default if (!(node is ModifierQueryNode modNode)) diff --git a/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/WildcardQueryNodeProcessor.cs b/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/WildcardQueryNodeProcessor.cs index 40d9c15f83..8f3f055095 100644 --- a/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/WildcardQueryNodeProcessor.cs +++ b/src/Lucene.Net.QueryParser/Flexible/Standard/Processors/WildcardQueryNodeProcessor.cs @@ -93,7 +93,7 @@ private static bool IsWildcard(string text) // LUCENENET: CA1822: Mark members a return false; } - private bool IsPrefixWildcard(string text) + private static bool IsPrefixWildcard(string text) // LUCENENET: CA1822: Mark members as static { if (text is null || text.Length <= 0 || !IsWildcard(text)) return false; diff --git a/src/Lucene.Net.Suggest/Spell/JaroWinklerDistance.cs b/src/Lucene.Net.Suggest/Spell/JaroWinklerDistance.cs index 614981eb15..cde1b7a907 100644 --- a/src/Lucene.Net.Suggest/Spell/JaroWinklerDistance.cs +++ b/src/Lucene.Net.Suggest/Spell/JaroWinklerDistance.cs @@ -37,7 +37,7 @@ public JaroWinklerDistance() { } - private int[] Matches(string s1, string s2) + private static int[] Matches(string s1, string s2) // LUCENENET: CA1822: Mark members as static { string max, min; if (s1.Length > s2.Length) diff --git a/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs b/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs index 27f13cb69c..19ef74b12a 100644 --- a/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs +++ b/src/Lucene.Net.Suggest/Suggest/Analyzing/FreeTextSuggester.cs @@ -866,7 +866,7 @@ protected override bool AcceptResult(Int32sRef input, Int64 output) /// /// weight -> cost - private long EncodeWeight(long ngramCount) + private static long EncodeWeight(long ngramCount) // LUCENENET: CA1822: Mark members as static { return long.MaxValue - ngramCount; } @@ -881,7 +881,7 @@ private static long DecodeWeight(long? output) } // NOTE: copied from WFSTCompletionLookup & tweaked - private Int64 LookupPrefix(FST fst, FST.BytesReader bytesReader, BytesRef scratch, FST.Arc arc) + private static Int64 LookupPrefix(FST fst, FST.BytesReader bytesReader, BytesRef scratch, FST.Arc arc) // LUCENENET: CA1822: Mark members as static { Int64 output = fst.Outputs.NoOutput; diff --git a/src/Lucene.Net.Suggest/Suggest/DocumentDictionary.cs b/src/Lucene.Net.Suggest/Suggest/DocumentDictionary.cs index 3bab83dbc0..eaf1c746b5 100644 --- a/src/Lucene.Net.Suggest/Suggest/DocumentDictionary.cs +++ b/src/Lucene.Net.Suggest/Suggest/DocumentDictionary.cs @@ -229,7 +229,7 @@ protected internal virtual long GetWeight(Document doc, int docId) } } - private ISet GetRelevantFields(params string[] fields) + private static ISet GetRelevantFields(params string[] fields) // LUCENENET: CA1822: Mark members as static { var relevantFields = new JCG.HashSet(); foreach (string relevantField in fields) diff --git a/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs b/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs index 7d717861fb..3992a1ee4a 100644 --- a/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs +++ b/src/Lucene.Net.Suggest/Suggest/Fst/FSTCompletion.cs @@ -343,7 +343,7 @@ private JCG.List LookupSortedByWeight(BytesRef key, int num, bool co /// Returns true if and only if contained /// . /// - private bool CheckExistingAndReorder(IList list, BytesRef key) + private static bool CheckExistingAndReorder(IList list, BytesRef key) // LUCENENET: CA1822: Mark members as static { // We assume list does not have duplicates (because of how the FST is created). for (int i = list.Count; --i >= 0; ) diff --git a/src/Lucene.Net.TestFramework/Analysis/CollationTestBase.cs b/src/Lucene.Net.TestFramework/Analysis/CollationTestBase.cs index 0754a79e36..de5c261b78 100644 --- a/src/Lucene.Net.TestFramework/Analysis/CollationTestBase.cs +++ b/src/Lucene.Net.TestFramework/Analysis/CollationTestBase.cs @@ -206,23 +206,23 @@ public virtual void TestCollationKeySort(Analyzer usAnalyzer, Search.Query queryY = new TermQuery(new Term("contents", "y")); sort.SetSort(new SortField("US", SortFieldType.STRING)); - this.AssertMatches(searcher, queryY, sort, usResult); + AssertMatches(searcher, queryY, sort, usResult); sort.SetSort(new SortField("France", SortFieldType.STRING)); - this.AssertMatches(searcher, queryX, sort, frResult); + AssertMatches(searcher, queryX, sort, frResult); sort.SetSort(new SortField("Sweden", SortFieldType.STRING)); - this.AssertMatches(searcher, queryY, sort, svResult); + AssertMatches(searcher, queryY, sort, svResult); sort.SetSort(new SortField("Denmark", SortFieldType.STRING)); - this.AssertMatches(searcher, queryY, sort, dkResult); + AssertMatches(searcher, queryY, sort, dkResult); } /// /// Make sure the documents returned by the search match the expected list /// // Copied from TestSort.java - private void AssertMatches(IndexSearcher searcher, Search.Query query, Sort sort, string expectedResult) + private static void AssertMatches(IndexSearcher searcher, Search.Query query, Sort sort, string expectedResult) // LUCENENET: CA1822: Mark members as static { ScoreDoc[] result = searcher.Search(query, null, 1000, sort).ScoreDocs; StringBuilder buff = new StringBuilder(10); diff --git a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs index 688bfda5df..7caf1f9c67 100644 --- a/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs +++ b/src/Lucene.Net.TestFramework/Index/BaseDocValuesFormatTestCase.cs @@ -1262,7 +1262,7 @@ internal abstract class Int64Producer internal abstract long Next(); } - private void DoTestNumericsVsStoredFields(long minValue, long maxValue) + private static void DoTestNumericsVsStoredFields(long minValue, long maxValue) // LUCENENET: CA1822: Mark members as static { DoTestNumericsVsStoredFields(new Int64ProducerAnonymousClass(minValue, maxValue)); } @@ -1344,7 +1344,7 @@ private static void DoTestNumericsVsStoredFields(Int64Producer longs) // LUCENEN } } - private void DoTestMissingVsFieldCache(long minValue, long maxValue) + private static void DoTestMissingVsFieldCache(long minValue, long maxValue) // LUCENENET: CA1822: Mark members as static { DoTestMissingVsFieldCache(new Int64ProducerAnonymousClass2(minValue, maxValue)); } @@ -1518,7 +1518,7 @@ public virtual void TestInt64MissingVsFieldCache() // LUCENENET specific - renam } } - private void DoTestBinaryVsStoredFields(int minLength, int maxLength) + private static void DoTestBinaryVsStoredFields(int minLength, int maxLength) // LUCENENET: CA1822: Mark members as static { using Directory dir = NewDirectory(); IndexWriterConfig conf = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random)); @@ -1604,7 +1604,7 @@ public virtual void TestBinaryVariableLengthVsStoredFields() } } - private void DoTestSortedVsStoredFields(int minLength, int maxLength) + private static void DoTestSortedVsStoredFields(int minLength, int maxLength) // LUCENENET: CA1822: Mark members as static { using Directory dir = NewDirectory(); IndexWriterConfig conf = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random)); @@ -1669,7 +1669,7 @@ private void DoTestSortedVsStoredFields(int minLength, int maxLength) } } - private void DoTestSortedVsFieldCache(int minLength, int maxLength) + private static void DoTestSortedVsFieldCache(int minLength, int maxLength) // LUCENENET: CA1822: Mark members as static { using Directory dir = NewDirectory(); IndexWriterConfig conf = NewIndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random)); @@ -2316,7 +2316,7 @@ public virtual void TestSortedSetTermsEnum() } } - private void DoTestSortedSetVsStoredFields(int minLength, int maxLength, int maxValuesPerDoc) + private static void DoTestSortedSetVsStoredFields(int minLength, int maxLength, int maxValuesPerDoc) // LUCENENET: CA1822: Mark members as static { using Directory dir = NewDirectory(); IndexWriterConfig conf = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random)); @@ -2575,7 +2575,7 @@ private static void AssertEquals(long numOrds, TermsEnum expected, TermsEnum act } } - private void DoTestSortedSetVsUninvertedField(int minLength, int maxLength) + private static void DoTestSortedSetVsUninvertedField(int minLength, int maxLength) // LUCENENET: CA1822: Mark members as static { using Directory dir = NewDirectory(); IndexWriterConfig conf = new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(Random)); diff --git a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs index 14d97d6685..d73deed438 100644 --- a/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs +++ b/src/Lucene.Net.TestFramework/Index/ThreadedIndexingAndSearchingTestCase.cs @@ -520,7 +520,7 @@ public override void Run() //if (VERBOSE) { //System.out.println(Thread.currentThread().getName() + " now search body:" + term.Utf8ToString()); //} - totHits.AddAndGet(outerInstance.RunQuery(s, new TermQuery(new Term("body", termsEnum.Term)))); + totHits.AddAndGet(RunQuery(s, new TermQuery(new Term("body", termsEnum.Term)))); } } //if (VERBOSE) { @@ -906,7 +906,7 @@ public static implicit operator BooleanRef(bool boolean) } } - private int RunQuery(IndexSearcher s, Query q) + private static int RunQuery(IndexSearcher s, Query q) // LUCENENET: CA1822: Mark members as static { s.Search(q, 10); int hitCount = s.Search(q, null, 10, new Sort(new SortField("title", SortFieldType.STRING))).TotalHits; diff --git a/src/Lucene.Net.TestFramework/Support/Util/LuceneRandomSeedInitializer.cs b/src/Lucene.Net.TestFramework/Support/Util/LuceneRandomSeedInitializer.cs index 70a5737727..0e8ff50b66 100644 --- a/src/Lucene.Net.TestFramework/Support/Util/LuceneRandomSeedInitializer.cs +++ b/src/Lucene.Net.TestFramework/Support/Util/LuceneRandomSeedInitializer.cs @@ -44,7 +44,7 @@ internal class LuceneRandomSeedInitializer /// The random seed for a new instance. /// Note this is a subclass of , since the default doesn't produce consistent results across platforms. /// true if the seed was found in context; false if the seed was generated. - private bool TryGetRandomSeedsFromContext(Test test, out long seed, out long? testSeed) + private static bool TryGetRandomSeedsFromContext(Test test, out long seed, out long? testSeed) { //bool generate; seed = default; diff --git a/src/Lucene.Net.TestFramework/Support/Util/UseTempLineDocsFileRule.cs b/src/Lucene.Net.TestFramework/Support/Util/UseTempLineDocsFileRule.cs index 3f87cb82f1..a1687c235c 100644 --- a/src/Lucene.Net.TestFramework/Support/Util/UseTempLineDocsFileRule.cs +++ b/src/Lucene.Net.TestFramework/Support/Util/UseTempLineDocsFileRule.cs @@ -28,7 +28,7 @@ internal class UseTempLineDocsFileRule : AbstractBeforeAfterRule { private bool lineFileDocsExtracted; - private bool IsEnabled() + private static bool IsEnabled() // LUCENENET: CA1822: Mark members as static { bool enabled = false; Assembly assembly = RandomizedContext.CurrentContext.CurrentTestAssembly; diff --git a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs index f16f2c81b3..6bcc5cf1d6 100644 --- a/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs +++ b/src/Lucene.Net.TestFramework/Util/LuceneTestCase.cs @@ -3166,7 +3166,7 @@ internal static void LogNativeFSFactoryDebugInfo() // LUCENENET specific - moved this here so we can reference it more readily (similar to how Spatial does it). // However, this is also available as an extension method of the System.Random class in RandomizedTesting.Generators. // This method was originally in carrotsearch.randomizedtesting.RandomizedTest. - public double RandomGaussian() + public static double RandomGaussian() // LUCENENET: CA1822: Mark members as static { return Random.NextGaussian(); } diff --git a/src/Lucene.Net/Analysis/Token.cs b/src/Lucene.Net/Analysis/Token.cs index a91a8a44e0..031d4f32c6 100644 --- a/src/Lucene.Net/Analysis/Token.cs +++ b/src/Lucene.Net/Analysis/Token.cs @@ -628,7 +628,7 @@ public override void ReflectWith(IAttributeReflector reflector) reflector.Reflect(typeof(ITypeAttribute), "type", type); } - private void CheckOffsets(int startOffset, int endOffset) + private static void CheckOffsets(int startOffset, int endOffset) // LUCENENET: CA1822: Mark members as static { if (startOffset < 0 || endOffset < startOffset) { diff --git a/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs b/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs index 7fc3639ce5..1b1002c7bb 100644 --- a/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs +++ b/src/Lucene.Net/Codecs/BlockTreeTermsWriter.cs @@ -936,7 +936,7 @@ internal virtual void WriteBlocks(Int32sRef prevTerm, int prefixLength, int coun // for debugging #pragma warning disable IDE0051 // Remove unused private members - private string ToString(BytesRef b) + private static string ToString(BytesRef b) // LUCENENET: CA1822: Mark members as static #pragma warning restore IDE0051 // Remove unused private members { try diff --git a/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsReader.cs b/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsReader.cs index ce00fb7907..321ad82d18 100644 --- a/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsReader.cs +++ b/src/Lucene.Net/Codecs/Compressing/CompressingTermVectorsReader.cs @@ -590,7 +590,7 @@ public override Fields Get(int doc) } // field -> term index -> position index - private int[][] PositionIndex(int skip, int numFields, PackedInt32s.Reader numTerms, int[] termFreqs) + private static int[][] PositionIndex(int skip, int numFields, PackedInt32s.Reader numTerms, int[] termFreqs) // LUCENENET: CA1822: Mark members as static { int[][] positionIndex = new int[numFields][]; int termIndex = 0; diff --git a/src/Lucene.Net/Codecs/DocValuesConsumer.cs b/src/Lucene.Net/Codecs/DocValuesConsumer.cs index b0d70cd020..8f055b0e90 100644 --- a/src/Lucene.Net/Codecs/DocValuesConsumer.cs +++ b/src/Lucene.Net/Codecs/DocValuesConsumer.cs @@ -116,7 +116,7 @@ public virtual void MergeNumericField(FieldInfo fieldInfo, MergeState mergeState AddNumericField(fieldInfo, GetMergeNumericFieldEnumerable(/* fieldInfo, // LUCENENET: Never read */ mergeState, toMerge, docsWithField)); } - private IEnumerable GetMergeNumericFieldEnumerable(/*FieldInfo fieldinfo, // LUCENENET: Never read */ MergeState mergeState, IList toMerge, IList docsWithField) + private static IEnumerable GetMergeNumericFieldEnumerable(/*FieldInfo fieldinfo, // LUCENENET: Never read */ MergeState mergeState, IList toMerge, IList docsWithField) // LUCENENET: CA1822: Mark members as static { int readerUpto = -1; int docIDUpto = 0; @@ -178,7 +178,7 @@ public virtual void MergeBinaryField(FieldInfo fieldInfo, MergeState mergeState, AddBinaryField(fieldInfo, GetMergeBinaryFieldEnumerable(/*fieldInfo, // LUCENENET: Never read */ mergeState, toMerge, docsWithField)); } - private IEnumerable GetMergeBinaryFieldEnumerable(/*FieldInfo fieldInfo, // LUCENENET: Never read */ MergeState mergeState, IList toMerge, IList docsWithField) + private static IEnumerable GetMergeBinaryFieldEnumerable(/*FieldInfo fieldInfo, // LUCENENET: Never read */ MergeState mergeState, IList toMerge, IList docsWithField) // LUCENENET: CA1822: Mark members as static { int readerUpto = -1; int docIDUpto = 0; @@ -281,7 +281,7 @@ public virtual void MergeSortedField(FieldInfo fieldInfo, MergeState mergeState, ); } - private IEnumerable GetMergeSortValuesEnumerable(OrdinalMap map, SortedDocValues[] dvs) + private static IEnumerable GetMergeSortValuesEnumerable(OrdinalMap map, SortedDocValues[] dvs) // LUCENENET: CA1822: Mark members as static { var scratch = new BytesRef(); int currentOrd = 0; @@ -296,7 +296,7 @@ private IEnumerable GetMergeSortValuesEnumerable(OrdinalMap map, Sorte } } - private IEnumerable GetMergeSortedFieldDocToOrdEnumerable(AtomicReader[] readers, SortedDocValues[] dvs, OrdinalMap map) + private static IEnumerable GetMergeSortedFieldDocToOrdEnumerable(AtomicReader[] readers, SortedDocValues[] dvs, OrdinalMap map) // LUCENENET: CA1822: Mark members as static { int readerUpTo = -1; int docIDUpTo = 0; @@ -387,7 +387,7 @@ public virtual void MergeSortedSetField(FieldInfo fieldInfo, MergeState mergeSta ); } - private IEnumerable GetMergeSortedSetValuesEnumerable(OrdinalMap map, SortedSetDocValues[] dvs) + private static IEnumerable GetMergeSortedSetValuesEnumerable(OrdinalMap map, SortedSetDocValues[] dvs) // LUCENENET: CA1822: Mark members as static { var scratch = new BytesRef(); long currentOrd = 0; @@ -402,7 +402,7 @@ private IEnumerable GetMergeSortedSetValuesEnumerable(OrdinalMap map, } } - private IEnumerable GetMergeSortedSetDocToOrdCountEnumerable(AtomicReader[] readers, SortedSetDocValues[] dvs) + private static IEnumerable GetMergeSortedSetDocToOrdCountEnumerable(AtomicReader[] readers, SortedSetDocValues[] dvs) // LUCENENET: CA1822: Mark members as static { int readerUpto = -1; int docIDUpto = 0; @@ -446,7 +446,7 @@ private IEnumerable GetMergeSortedSetValuesEnumerable(OrdinalMap map, } } - private IEnumerable GetMergeSortedSetOrdsEnumerable(AtomicReader[] readers, SortedSetDocValues[] dvs, OrdinalMap map) + private static IEnumerable GetMergeSortedSetOrdsEnumerable(AtomicReader[] readers, SortedSetDocValues[] dvs, OrdinalMap map) // LUCENENET: CA1822: Mark members as static { int readerUpto = -1; int docIDUpto = 0; diff --git a/src/Lucene.Net/Codecs/Lucene41/Lucene41PostingsReader.cs b/src/Lucene.Net/Codecs/Lucene41/Lucene41PostingsReader.cs index b5f20dc1ba..4ae6171910 100644 --- a/src/Lucene.Net/Codecs/Lucene41/Lucene41PostingsReader.cs +++ b/src/Lucene.Net/Codecs/Lucene41/Lucene41PostingsReader.cs @@ -200,7 +200,7 @@ public override void DecodeTerm(long[] longs, DataInput @in, FieldInfo fieldInfo } } - private void DecodeTerm(DataInput @in, FieldInfo fieldInfo, Lucene41PostingsWriter.Int32BlockTermState termState) + private static void DecodeTerm(DataInput @in, FieldInfo fieldInfo, Lucene41PostingsWriter.Int32BlockTermState termState) // LUCENENET: CA1822: Mark members as static { // LUCENENET specific - to avoid boxing, changed from CompareTo() to IndexOptionsComparer.Compare() bool fieldHasPositions = IndexOptionsComparer.Default.Compare(fieldInfo.IndexOptions, IndexOptions.DOCS_AND_FREQS_AND_POSITIONS) >= 0; diff --git a/src/Lucene.Net/Codecs/Lucene45/Lucene45DocValuesConsumer.cs b/src/Lucene.Net/Codecs/Lucene45/Lucene45DocValuesConsumer.cs index 81de68cca6..24350ed5af 100644 --- a/src/Lucene.Net/Codecs/Lucene45/Lucene45DocValuesConsumer.cs +++ b/src/Lucene.Net/Codecs/Lucene45/Lucene45DocValuesConsumer.cs @@ -482,7 +482,7 @@ public override void AddSortedSetField(FieldInfo field, IEnumerable va writer.Finish(); } - private IEnumerable GetSortedSetEnumerable(IEnumerable docToOrdCount, IEnumerable ords) + private static IEnumerable GetSortedSetEnumerable(IEnumerable docToOrdCount, IEnumerable ords) // LUCENENET: CA1822: Mark members as static { IEnumerator docToOrdCountIter = docToOrdCount.GetEnumerator(); IEnumerator ordsIter = ords.GetEnumerator(); diff --git a/src/Lucene.Net/Index/FreqProxTermsWriterPerField.cs b/src/Lucene.Net/Index/FreqProxTermsWriterPerField.cs index 5d110c6c40..e98203d745 100644 --- a/src/Lucene.Net/Index/FreqProxTermsWriterPerField.cs +++ b/src/Lucene.Net/Index/FreqProxTermsWriterPerField.cs @@ -386,10 +386,7 @@ internal override int BytesPerPosting() } } - [MethodImpl(MethodImplOptions.NoInlining)] - public void Abort() - { - } + // LUCENENET: Removed Abort() method because it is not in use. internal BytesRef payload; diff --git a/src/Lucene.Net/Index/PrefixCodedTerms.cs b/src/Lucene.Net/Index/PrefixCodedTerms.cs index 0676dc72f8..4c1090a1f5 100644 --- a/src/Lucene.Net/Index/PrefixCodedTerms.cs +++ b/src/Lucene.Net/Index/PrefixCodedTerms.cs @@ -195,7 +195,7 @@ public virtual PrefixCodedTerms Finish() } } - private int SharedPrefix(BytesRef term1, BytesRef term2) + private static int SharedPrefix(BytesRef term1, BytesRef term2) // LUCENENET: CA1822: Mark members as static { int pos1 = 0; int pos1End = pos1 + Math.Min(term1.Length, term2.Length); diff --git a/src/Lucene.Net/Index/ReadersAndUpdates.cs b/src/Lucene.Net/Index/ReadersAndUpdates.cs index e70bea4f7e..8d4d04a5ca 100644 --- a/src/Lucene.Net/Index/ReadersAndUpdates.cs +++ b/src/Lucene.Net/Index/ReadersAndUpdates.cs @@ -749,7 +749,7 @@ public virtual void WriteFieldUpdates(Directory dir, DocValuesFieldUpdates.Conta /// /// NOTE: This was getLongEnumerable() in Lucene /// - private IEnumerable GetInt64Enumerable(SegmentReader reader, string field, NumericDocValuesFieldUpdates fieldUpdates) + private static IEnumerable GetInt64Enumerable(SegmentReader reader, string field, NumericDocValuesFieldUpdates fieldUpdates) // LUCENENET: CA1822: Mark members as static { int maxDoc = reader.MaxDoc; IBits DocsWithField = reader.GetDocsWithField(field); @@ -781,7 +781,7 @@ public virtual void WriteFieldUpdates(Directory dir, DocValuesFieldUpdates.Conta } } - private IEnumerable GetBytesRefEnumerable(SegmentReader reader, string field, BinaryDocValuesFieldUpdates fieldUpdates) + private static IEnumerable GetBytesRefEnumerable(SegmentReader reader, string field, BinaryDocValuesFieldUpdates fieldUpdates) // LUCENENET: CA1822: Mark members as static { BinaryDocValues currentValues = reader.GetBinaryDocValues(field); IBits DocsWithField = reader.GetDocsWithField(field); diff --git a/src/Lucene.Net/Index/TermVectorsConsumerPerField.cs b/src/Lucene.Net/Index/TermVectorsConsumerPerField.cs index 481714a782..d69bf0df5d 100644 --- a/src/Lucene.Net/Index/TermVectorsConsumerPerField.cs +++ b/src/Lucene.Net/Index/TermVectorsConsumerPerField.cs @@ -140,10 +140,7 @@ internal override bool Start(IIndexableField[] fields, int count) return doVectors; } - [MethodImpl(MethodImplOptions.NoInlining)] - public void Abort() - { - } + // LUCENENET: Removed Abort() method because it is not in use. /// /// Called once per field per document if term vectors diff --git a/src/Lucene.Net/Search/FieldCacheImpl.cs b/src/Lucene.Net/Search/FieldCacheImpl.cs index cc86ee1f5b..86bdeecb37 100644 --- a/src/Lucene.Net/Search/FieldCacheImpl.cs +++ b/src/Lucene.Net/Search/FieldCacheImpl.cs @@ -163,7 +163,7 @@ public virtual FieldCache.CacheEntry[] GetCacheEntries() return result.ToArray(); } - private void AddCacheEntries(IList result, Type cacheType, Cache cache) where TKey : CacheKey + private void AddCacheEntries(IList result, Type cacheType, Cache cache) where TKey : CacheKey // LUCENENET: CA1822: Mark members as static { UninterruptableMonitor.Enter(cache.readerCache); try diff --git a/src/Lucene.Net/Search/FuzzyTermsEnum.cs b/src/Lucene.Net/Search/FuzzyTermsEnum.cs index 0711c60128..342c45765b 100644 --- a/src/Lucene.Net/Search/FuzzyTermsEnum.cs +++ b/src/Lucene.Net/Search/FuzzyTermsEnum.cs @@ -259,7 +259,7 @@ protected virtual void MaxEditDistanceChanged(BytesRef lastTerm, int maxEdits, b } // for some raw min similarity and input term length, the maximum # of edits - private int InitialMaxDistance(float minimumSimilarity, int termLen) + private static int InitialMaxDistance(float minimumSimilarity, int termLen) // LUCENENET: CA1822: Mark members as static { return (int)((1D - minimumSimilarity) * termLen); } diff --git a/src/Lucene.Net/Search/MultiPhraseQuery.cs b/src/Lucene.Net/Search/MultiPhraseQuery.cs index 93c6ed3221..5801324cae 100644 --- a/src/Lucene.Net/Search/MultiPhraseQuery.cs +++ b/src/Lucene.Net/Search/MultiPhraseQuery.cs @@ -477,7 +477,7 @@ private int TermArraysHashCode() } // Breakout calculation of the termArrays equals - private bool TermArraysEquals(IList termArrays1, IList termArrays2) + private static bool TermArraysEquals(IList termArrays1, IList termArrays2) // LUCENENET: CA1822: Mark members as static { if (termArrays1.Count != termArrays2.Count) { diff --git a/src/Lucene.Net/Search/PhraseQuery.cs b/src/Lucene.Net/Search/PhraseQuery.cs index e70fe656a2..81bbf45f2f 100644 --- a/src/Lucene.Net/Search/PhraseQuery.cs +++ b/src/Lucene.Net/Search/PhraseQuery.cs @@ -400,7 +400,7 @@ public override Scorer GetScorer(AtomicReaderContext context, IBits acceptDocs) } // only called from assert - private bool TermNotInReader(AtomicReader reader, Term term) + private static bool TermNotInReader(AtomicReader reader, Term term) // LUCENENET: CA1822: Mark members as static { return reader.DocFreq(term) == 0; } diff --git a/src/Lucene.Net/Store/CompoundFileWriter.cs b/src/Lucene.Net/Store/CompoundFileWriter.cs index 64de6e3f43..a1e53cbf80 100644 --- a/src/Lucene.Net/Store/CompoundFileWriter.cs +++ b/src/Lucene.Net/Store/CompoundFileWriter.cs @@ -236,7 +236,7 @@ private static long CopyFileEntry(IndexOutput dataOut, FileEntry fileEntry) // L } } - private void WriteEntryTable(ICollection entries, IndexOutput entryOut) + private static void WriteEntryTable(ICollection entries, IndexOutput entryOut) // LUCENENET: CA1822: Mark members as static { CodecUtil.WriteHeader(entryOut, ENTRY_CODEC, VERSION_CURRENT); entryOut.WriteVInt32(entries.Count); diff --git a/src/Lucene.Net/Store/NativeFSLockFactory.cs b/src/Lucene.Net/Store/NativeFSLockFactory.cs index 374deeeed7..5935a3ecf7 100644 --- a/src/Lucene.Net/Store/NativeFSLockFactory.cs +++ b/src/Lucene.Net/Store/NativeFSLockFactory.cs @@ -463,7 +463,7 @@ public SharingNativeFSLock(DirectoryInfo lockDir, string path) /// /// Return true if the is the result of a share violation /// - private bool IsShareViolation(IOException e) + private static bool IsShareViolation(IOException e) // LUCENENET: CA1822: Mark members as static { return e.HResult == NativeFSLockFactory.HRESULT_FILE_SHARE_VIOLATION; } @@ -645,7 +645,7 @@ public NativeFSLock(DirectoryInfo lockDir, string path) /// /// Return true if the is the result of a lock violation /// - private bool IsLockViolation(IOException e) + private static bool IsLockViolation(IOException e) // LUCENENET: CA1822: Mark members as static { return e.HResult == NativeFSLockFactory.HRESULT_FILE_LOCK_VIOLATION; } diff --git a/src/Lucene.Net/Util/AttributeSource.cs b/src/Lucene.Net/Util/AttributeSource.cs index fd5300ece2..285c5432ad 100644 --- a/src/Lucene.Net/Util/AttributeSource.cs +++ b/src/Lucene.Net/Util/AttributeSource.cs @@ -85,7 +85,7 @@ public override Attribute CreateAttributeInstance() } // LUCENENET: optimize known creation of built-in types - private Attribute CreateInstance(Type attributeType) + private static Attribute CreateInstance(Type attributeType) // LUCENENET: CA1822: Mark members as static { if (ReferenceEquals(typeof(CharTermAttribute), attributeType)) return new CharTermAttribute(); diff --git a/src/Lucene.Net/Util/Fst/PositiveIntOutputs.cs b/src/Lucene.Net/Util/Fst/PositiveIntOutputs.cs index 10fcacb35b..8d8820e9a8 100644 --- a/src/Lucene.Net/Util/Fst/PositiveIntOutputs.cs +++ b/src/Lucene.Net/Util/Fst/PositiveIntOutputs.cs @@ -133,7 +133,7 @@ public override Int64 Read(DataInput @in) } } - private bool Valid(Int64 o) + private static bool Valid(Int64 o) // LUCENENET: CA1822: Mark members as static { Debugging.Assert(o != null, "PositiveIntOutput precondition fail"); Debugging.Assert(o == NO_OUTPUT || o > 0,"o={0}", o); diff --git a/src/Lucene.Net/Util/RamUsageEstimator.cs b/src/Lucene.Net/Util/RamUsageEstimator.cs index de77938b82..7732aa948d 100644 --- a/src/Lucene.Net/Util/RamUsageEstimator.cs +++ b/src/Lucene.Net/Util/RamUsageEstimator.cs @@ -947,7 +947,7 @@ private static int NextCapacity(int current) // LUCENENET NOTE: made private, si /// /// Round the capacity to the next allowed value. /// - private int RoundCapacity(int requestedCapacity) // LUCENENET NOTE: made private, since protected is not valid in a sealed class + private static int RoundCapacity(int requestedCapacity) // LUCENENET NOTE: made private, since protected is not valid in a sealed class // LUCENENET: CA1822: Mark members as static { // Maximum positive integer that is a power of two. if (requestedCapacity > ((int)(0x80000000 >> 1))) // LUCENENET: No need to cast to uint because it already is diff --git a/src/dotnet/tools/lucene-cli/CommandLine/CommandLineApplication.cs b/src/dotnet/tools/lucene-cli/CommandLine/CommandLineApplication.cs index 3360c50593..3709664dff 100644 --- a/src/dotnet/tools/lucene-cli/CommandLine/CommandLineApplication.cs +++ b/src/dotnet/tools/lucene-cli/CommandLine/CommandLineApplication.cs @@ -516,7 +516,7 @@ public virtual void ShowRootCommandFullNameAndVersion() Out.WriteLine(); } - private void HandleUnexpectedArg(CommandLineApplication command, string[] args, int index, string argTypeName) + private static void HandleUnexpectedArg(CommandLineApplication command, string[] args, int index, string argTypeName) // LUCENENET: CA1822: Mark members as static { if (command._throwOnUnexpectedArg) { diff --git a/src/dotnet/tools/lucene-cli/CommandLine/CommandOption.cs b/src/dotnet/tools/lucene-cli/CommandLine/CommandOption.cs index 784c9f5a8e..9c59bcd6f4 100644 --- a/src/dotnet/tools/lucene-cli/CommandLine/CommandOption.cs +++ b/src/dotnet/tools/lucene-cli/CommandLine/CommandOption.cs @@ -121,7 +121,7 @@ public string Value() return HasValue() ? Values[0] : null; } - private bool IsEnglishLetter(char c) + private static bool IsEnglishLetter(char c) // LUCENENET: CA1822: Mark members as static { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); }