Skip to content

Commit be14517

Browse files
committed
Fix csharpsquid:S2223 issues, #679
1 parent 8620f97 commit be14517

File tree

41 files changed

+255
-205
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+255
-205
lines changed

src/Lucene.Net.Analysis.Common/Analysis/En/KStemData1.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,10 @@ internal class KStemData1
4848
private KStemData1()
4949
{
5050
}
51+
52+
// LUCENENET specific - made readonly
5153
// KStemData1 ... KStemData8 are created from "head_word_list.txt"
52-
internal static string[] data = new string[] {
54+
internal static readonly string[] data = {
5355
"aback","abacus","abandon","abandoned","abase",
5456
"abash","abate","abattoir","abbess","abbey",
5557
"abbot","abbreviate","abbreviation","abc","abdicate",
@@ -752,4 +754,4 @@ private KStemData1()
752754
"cascara","case","casebook","casein","casework",
753755
};
754756
}
755-
}
757+
}

src/Lucene.Net.Analysis.Common/Analysis/En/KStemData2.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ internal class KStemData2
4747
private KStemData2()
4848
{
4949
}
50-
internal static string[] data = new string[] {
50+
51+
// LUCENENET specific - made readonly
52+
internal static readonly string[] data = {
5153
"cash","cashew","cashier","cashmere","casing",
5254
"casino","cask","casket","casque","cassava",
5355
"casserole","cassette","cassock","cassowary","cast",
@@ -750,4 +752,4 @@ private KStemData2()
750752
"distal","distance","distant","distantly","distaste",
751753
};
752754
}
753-
}
755+
}

src/Lucene.Net.Analysis.Common/Analysis/En/KStemData3.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ internal class KStemData3
4747
private KStemData3()
4848
{
4949
}
50-
internal static string[] data = new string[] {
50+
51+
// LUCENENET specific - made readonly
52+
internal static readonly string[] data = {
5153
"distasteful","distemper","distempered","distend","distension",
5254
"distil","distill","distillation","distiller","distillery",
5355
"distinct","distinction","distinctive","distinguish","distinguishable",
@@ -750,4 +752,4 @@ private KStemData3()
750752
"grange","granite","grannie","granny","grant",
751753
};
752754
}
753-
}
755+
}

src/Lucene.Net.Analysis.Common/Analysis/En/KStemData4.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ internal class KStemData4
4747
private KStemData4()
4848
{
4949
}
50-
internal static string[] data = new string[] {
50+
51+
// LUCENENET specific - made readonly
52+
internal static readonly string[] data = {
5153
"granular","granulate","granule","grape","grapefruit",
5254
"grapeshot","grapevine","graph","graphic","graphical",
5355
"graphically","graphite","graphology","grapnel","grapple",
@@ -750,4 +752,4 @@ private KStemData4()
750752
"locate","located","location","loch","loci",
751753
};
752754
}
753-
}
755+
}

src/Lucene.Net.Analysis.Common/Analysis/En/KStemData5.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ internal class KStemData5
4747
private KStemData5()
4848
{
4949
}
50-
internal static string[] data = new string[] {
50+
51+
// LUCENENET specific - made readonly
52+
internal static readonly string[] data = {
5153
"lock","locker","locket","lockjaw","locknut",
5254
"lockout","locks","locksmith","lockstitch","lockup",
5355
"loco","locomotion","locomotive","locum","locus",
@@ -750,4 +752,4 @@ private KStemData5()
750752
"peculiarly","pecuniary","pedagogue","pedagogy","pedal",
751753
};
752754
}
753-
}
755+
}

src/Lucene.Net.Analysis.Common/Analysis/En/KStemData6.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ internal class KStemData6
4747
private KStemData6()
4848
{
4949
}
50-
internal static string[] data = new string[] {
50+
51+
// LUCENENET specific - made readonly
52+
internal static readonly string[] data = {
5153
"pedant","pedantic","pedantry","peddle","peddler",
5254
"pederast","pederasty","pedestal","pedestrian","pediatrician",
5355
"pediatrics","pedicab","pedicel","pedicure","pedigree",
@@ -750,4 +752,4 @@ private KStemData6()
750752
"running","runny","runs","runt","runway",
751753
};
752754
}
753-
}
755+
}

src/Lucene.Net.Analysis.Common/Analysis/En/KStemData7.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ internal class KStemData7
4747
private KStemData7()
4848
{
4949
}
50-
internal static string[] data = new string[] {
50+
51+
// LUCENENET specific - made readonly
52+
internal static readonly string[] data = {
5153
"rupee","rupture","rural","ruritanian","ruse",
5254
"rush","rushes","rushlight","rusk","russet",
5355
"rust","rustic","rusticate","rustication","rustle",
@@ -750,4 +752,4 @@ private KStemData7()
750752
"tenement","tenet","tenner","tennis","tenon",
751753
};
752754
}
753-
}
755+
}

src/Lucene.Net.Analysis.Common/Analysis/En/KStemData8.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ internal class KStemData8
4747
private KStemData8()
4848
{
4949
}
50-
internal static string[] data = new string[] {
50+
51+
// LUCENENET specific - made readonly
52+
internal static readonly string[] data = {
5153
"tenor","tenpin","tense","tensile","tension",
5254
"tent","tentacle","tentative","tenterhooks","tenuity",
5355
"tenuous","tenure","tepee","tepid","tequila",
@@ -649,4 +651,4 @@ private KStemData8()
649651
"zoom","zoophyte","zouave","zucchini","zulu",
650652
};
651653
}
652-
}
654+
}

src/Lucene.Net.Analysis.OpenNLP/OpenNLPTokenizer.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ namespace Lucene.Net.Analysis.OpenNlp
3232
/// </summary>
3333
public sealed class OpenNLPTokenizer : SegmentingTokenizerBase
3434
{
35-
public static int EOS_FLAG_BIT = 1;
35+
// LUCENENET specific - made const, since it is never modified. Removed in Lucene 9.5.0.
36+
public const int EOS_FLAG_BIT = 1;
3637

3738
private readonly ICharTermAttribute termAtt;
3839
private readonly IFlagsAttribute flagsAtt;

src/Lucene.Net.Analysis.SmartCn/AnalyzerProfile.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace Lucene.Net.Analysis.Cn.Smart
3434
/// To place the files in an alternate location, set an environment variable named "smartcn.data.dir"
3535
/// with the name of the directory the "bigramdict.dct" and "coredict.dct" files can be located within.
3636
/// <para/>
37-
/// The default "bigramdict.dct" and "coredict.dct" files can be found at:
37+
/// The default "bigramdict.dct" and "coredict.dct" files can be found at:
3838
/// <a href="https://issues.apache.org/jira/browse/LUCENE-1629">https://issues.apache.org/jira/browse/LUCENE-1629</a>.
3939
/// <para/>
4040
/// @lucene.experimental
@@ -44,14 +44,15 @@ public static class AnalyzerProfile // LUCENENET specific: CA1052 Static holder
4444
/// <summary>
4545
/// Global indicating the configured analysis data directory
4646
/// </summary>
47-
public static string ANALYSIS_DATA_DIR = "";
47+
// LUCENENET specific - changed from a mutable static field to a property.
48+
public static string ANALYSIS_DATA_DIR { get; set; } = "";
4849

4950
static AnalyzerProfile()
5051
{
5152
Init();
5253
}
5354

54-
// LUCENENET specific - changed the logic here to leave the
55+
// LUCENENET specific - changed the logic here to leave the
5556
// ANALYSIS_DATA_DIR an empty string if it is not found. This
5657
// allows us to skip loading files from disk if there are no files
5758
// to load (and fixes LUCENE-1817 that prevents the on-disk files
@@ -79,7 +80,6 @@ private static void Init()
7980
ANALYSIS_DATA_DIR = candidatePath;
8081
return;
8182
}
82-
8383

8484
try
8585
{

0 commit comments

Comments
 (0)