Skip to content

Commit 728d555

Browse files
authoredJan 19, 2025
SWEEP: Make private/internal fields readonly where possible, #661 (#1103)
1 parent 5374caa commit 728d555

File tree

105 files changed

+398
-397
lines changed

Some content is hidden

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

105 files changed

+398
-397
lines changed
 

‎src/Lucene.Net.Analysis.Common/Analysis/Br/BrazilianAnalyzer.cs

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ namespace Lucene.Net.Analysis.Br
2828
*/
2929

3030
/// <summary>
31-
/// <see cref="Analyzer"/> for Brazilian Portuguese language.
31+
/// <see cref="Analyzer"/> for Brazilian Portuguese language.
3232
/// <para>
3333
/// Supports an external list of stopwords (words that
3434
/// will not be indexed at all) and an external list of exclusions (words that will
3535
/// not be stemmed, but indexed).
3636
/// </para>
37-
///
37+
///
3838
/// <para><b>NOTE</b>: This class uses the same <see cref="LuceneVersion"/>
3939
/// dependent settings as <see cref="StandardAnalyzer"/>.</para>
4040
/// </summary>
@@ -77,7 +77,7 @@ private static CharArraySet LoadDefaultStopSet() // LUCENENET: Avoid static cons
7777
/// <summary>
7878
/// Contains words that should be indexed but not stemmed.
7979
/// </summary>
80-
private CharArraySet excltable = CharArraySet.Empty;
80+
private readonly CharArraySet excltable = CharArraySet.Empty; // LUCENENET: marked readonly
8181

8282
/// <summary>
8383
/// Builds an analyzer with the default stop words (<see cref="DefaultStopSet"/>).
@@ -135,4 +135,4 @@ protected internal override TokenStreamComponents CreateComponents(string fieldN
135135
return new TokenStreamComponents(source, new BrazilianStemFilter(result));
136136
}
137137
}
138-
}
138+
}

‎src/Lucene.Net.Analysis.Common/Analysis/CharFilter/HTMLStripCharFilter.cs

+6-6
Original file line numberDiff line numberDiff line change
@@ -30792,19 +30792,19 @@ CharArrayDictionary<char> result
3079230792
private static readonly char STYLE_REPLACEMENT = '\n';
3079330793
private static readonly char REPLACEMENT_CHARACTER = '\uFFFD';
3079430794

30795-
private CharArraySet escapedTags = null;
30795+
private readonly CharArraySet escapedTags = null; // LUCENENET: marked readonly
3079630796
private int inputStart;
3079730797
private int cumulativeDiff;
30798-
private bool escapeBR = false;
30799-
private bool escapeSCRIPT = false;
30800-
private bool escapeSTYLE = false;
30798+
private readonly bool escapeBR = false; // LUCENENET: marked readonly
30799+
private readonly bool escapeSCRIPT = false; // LUCENENET: marked readonly
30800+
private readonly bool escapeSTYLE = false; // LUCENENET: marked readonly
3080130801
private int restoreState;
3080230802
private int previousRestoreState;
3080330803
private int outputCharCount;
3080430804
private int eofReturnValue;
30805-
private TextSegment inputSegment = new TextSegment(INITIAL_INPUT_SEGMENT_SIZE);
30805+
private readonly TextSegment inputSegment = new TextSegment(INITIAL_INPUT_SEGMENT_SIZE); // LUCENENET: marked readonly
3080630806
private TextSegment outputSegment;
30807-
private TextSegment entitySegment = new TextSegment(2);
30807+
private readonly TextSegment entitySegment = new TextSegment(2); // LUCENENET: marked readonly
3080830808

3080930809
/// <summary>
3081030810
/// Creates a new HTMLStripCharFilter over the provided TextReader.

0 commit comments

Comments
 (0)