Skip to content

Commit 8c1d216

Browse files
committed
Fix csharpsquid:S2223 issues, #679
1 parent 5ccea37 commit 8c1d216

41 files changed

Lines changed: 135 additions & 85 deletions

File tree

Some content is hidden

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

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

Lines changed: 3 additions & 1 deletion
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",

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

Lines changed: 3 additions & 1 deletion
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",

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

Lines changed: 3 additions & 1 deletion
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",

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

Lines changed: 3 additions & 1 deletion
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",

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

Lines changed: 3 additions & 1 deletion
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",

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

Lines changed: 3 additions & 1 deletion
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",

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

Lines changed: 3 additions & 1 deletion
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",

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

Lines changed: 3 additions & 1 deletion
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",

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

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

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

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ 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
{
@@ -80,7 +81,6 @@ private static void Init()
8081
return;
8182
}
8283

83-
8484
try
8585
{
8686
while (new DirectoryInfo(currentPath).Parent != null)

0 commit comments

Comments
 (0)