diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java index 32889f373337..706b87cf80d5 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilter.java @@ -59,11 +59,11 @@ public class MinHashFilter extends TokenFilter { private final List>> minHashSets; - private int hashSetSize = DEFAULT_HASH_SET_SIZE; + private final int hashSetSize; - private int bucketCount = DEFAULT_BUCKET_COUNT; + private final int bucketCount; - private int hashCount = DEFAULT_HASH_COUNT; + private final int hashCount; private boolean requiresInitialisation = true; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilterFactory.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilterFactory.java index 1d2cda64e2f2..dec09cb58f31 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilterFactory.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/minhash/MinHashFilterFactory.java @@ -32,13 +32,13 @@ public class MinHashFilterFactory extends TokenFilterFactory { /** SPI name */ public static final String NAME = "minHash"; - private int hashCount = MinHashFilter.DEFAULT_HASH_COUNT; + private final int hashCount; - private int bucketCount = MinHashFilter.DEFAULT_BUCKET_COUNT; + private final int bucketCount; - private int hashSetSize = MinHashFilter.DEFAULT_HASH_SET_SIZE; + private final int hashSetSize; - private boolean withRotation; + private final boolean withRotation; /** Create a {@link MinHashFilterFactory}. */ public MinHashFilterFactory(Map args) { diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterGraphFilterFactory.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterGraphFilterFactory.java index 63634687e2b6..570487a20b84 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterGraphFilterFactory.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/WordDelimiterGraphFilterFactory.java @@ -67,7 +67,7 @@ public class WordDelimiterGraphFilterFactory extends TokenFilterFactory private final int flags; byte[] typeTable = null; private CharArraySet protectedWords = null; - private boolean adjustOffsets = false; + private final boolean adjustOffsets; /** Creates a new WordDelimiterGraphFilterFactory */ public WordDelimiterGraphFilterFactory(Map args) { diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java index 89c67f9a8325..ef188fbc42c0 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/nl/DutchAnalyzer.java @@ -89,7 +89,7 @@ private static class DefaultSetHolder { private final CharArraySet stoptable; /** Contains words that should be indexed but not stemmed. */ - private CharArraySet excltable = CharArraySet.EMPTY_SET; + private final CharArraySet excltable; private final StemmerOverrideMap stemdict; diff --git a/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternCaptureGroupFilterFactory.java b/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternCaptureGroupFilterFactory.java index da0892e16e19..fc6c78ba7833 100644 --- a/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternCaptureGroupFilterFactory.java +++ b/lucene/analysis/common/src/java/org/apache/lucene/analysis/pattern/PatternCaptureGroupFilterFactory.java @@ -41,8 +41,8 @@ public class PatternCaptureGroupFilterFactory extends TokenFilterFactory { /** SPI name */ public static final String NAME = "patternCaptureGroup"; - private Pattern pattern; - private boolean preserveOriginal = true; + private final Pattern pattern; + private final boolean preserveOriginal; public PatternCaptureGroupFilterFactory(Map args) { super(args); diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizerFactory.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizerFactory.java index 76105a93744a..911df4eb0107 100644 --- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizerFactory.java +++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizerFactory.java @@ -114,7 +114,7 @@ public class JapaneseTokenizerFactory extends TokenizerFactory implements Resour * /箱根山-箱根/成田空港-成田/ requests "箱根" and "成田" to be in the result in NBEST output. */ private final String nbestExamples; - private int nbestCost = -1; + private int nbestCost; /** Creates a new JapaneseTokenizerFactory */ public JapaneseTokenizerFactory(Map args) { diff --git a/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/OpenNLPTokenizer.java b/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/OpenNLPTokenizer.java index b9903630b257..b8a679551074 100644 --- a/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/OpenNLPTokenizer.java +++ b/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/OpenNLPTokenizer.java @@ -44,7 +44,7 @@ public final class OpenNLPTokenizer extends SegmentingTokenizerBase { private int sentenceStart = 0; private int sentenceIndex = -1; - private NLPTokenizerOp tokenizerOp = null; + private final NLPTokenizerOp tokenizerOp; public OpenNLPTokenizer( AttributeFactory factory, NLPSentenceDetectorOp sentenceOp, NLPTokenizerOp tokenizerOp) diff --git a/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/tools/NLPChunkerOp.java b/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/tools/NLPChunkerOp.java index 3bd4b3639575..ca67cd5b7444 100644 --- a/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/tools/NLPChunkerOp.java +++ b/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/tools/NLPChunkerOp.java @@ -23,7 +23,7 @@ /** Supply OpenNLP Chunking tool Requires binary models from OpenNLP project on SourceForge. */ public class NLPChunkerOp { - private ChunkerME chunker = null; + private final ChunkerME chunker; public NLPChunkerOp(ChunkerModel chunkerModel) throws IOException { chunker = new ChunkerME(chunkerModel); diff --git a/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/tools/NLPPOSTaggerOp.java b/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/tools/NLPPOSTaggerOp.java index 3301e2f446fb..dee4afefc58a 100644 --- a/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/tools/NLPPOSTaggerOp.java +++ b/lucene/analysis/opennlp/src/java/org/apache/lucene/analysis/opennlp/tools/NLPPOSTaggerOp.java @@ -27,7 +27,7 @@ * SourceForge. */ public class NLPPOSTaggerOp { - private POSTagger tagger = null; + private final POSTagger tagger; public NLPPOSTaggerOp(POSModel model) throws IOException { tagger = new POSTaggerME(model); diff --git a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DaitchMokotoffSoundexFilter.java b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DaitchMokotoffSoundexFilter.java index 5f6f0119178f..5207175e5aad 100644 --- a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DaitchMokotoffSoundexFilter.java +++ b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/DaitchMokotoffSoundexFilter.java @@ -32,10 +32,10 @@ */ public final class DaitchMokotoffSoundexFilter extends TokenFilter { /** true if encoded tokens should be added as synonyms */ - protected boolean inject = true; + private final boolean inject; /** phonetic encoder */ - protected DaitchMokotoffSoundex encoder = new DaitchMokotoffSoundex(); + private final DaitchMokotoffSoundex encoder = new DaitchMokotoffSoundex(); // output is a string such as ab|ac|... private static final Pattern pattern = Pattern.compile("([^|]+)"); diff --git a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilter.java b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilter.java index 0212c97fac91..2084e5fc2d99 100644 --- a/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilter.java +++ b/lucene/analysis/phonetic/src/java/org/apache/lucene/analysis/phonetic/PhoneticFilter.java @@ -32,13 +32,13 @@ */ public final class PhoneticFilter extends TokenFilter { /** true if encoded tokens should be added as synonyms */ - protected boolean inject = true; + private final boolean inject; /** phonetic encoder */ - protected Encoder encoder = null; + private final Encoder encoder; /** captured state, non-null when inject=true and a token is buffered */ - protected State save = null; + private State save = null; private final CharTermAttribute termAtt = addAttribute(CharTermAttribute.class); private final PositionIncrementAttribute posAtt = addAttribute(PositionIncrementAttribute.class); diff --git a/lucene/analysis/stempel/src/java/org/egothor/stemmer/Trie.java b/lucene/analysis/stempel/src/java/org/egothor/stemmer/Trie.java index 8251e4c4b787..aef5d1897470 100644 --- a/lucene/analysis/stempel/src/java/org/egothor/stemmer/Trie.java +++ b/lucene/analysis/stempel/src/java/org/egothor/stemmer/Trie.java @@ -73,7 +73,7 @@ public class Trie { List cmds = new ArrayList<>(); int root; - boolean forward = false; + boolean forward; /** * Constructor for the Trie object. diff --git a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/TaskSequence.java b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/TaskSequence.java index afa8d7b4f678..ee2d160b5868 100644 --- a/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/TaskSequence.java +++ b/lucene/benchmark/src/java/org/apache/lucene/benchmark/byTask/tasks/TaskSequence.java @@ -41,7 +41,7 @@ public class TaskSequence extends PerfTask { private boolean resetExhausted = false; private PerfTask[] tasksArray; private boolean anyExhaustibleTasks; - private boolean collapsable = false; // to not collapse external sequence named in alg. + private final boolean collapsable; // to not collapse external sequence named in alg. private boolean fixedTime; // true if we run for fixed time private double runTimeSec; // how long to run for diff --git a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestTrecContentSource.java b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestTrecContentSource.java index 9a038b2bde72..71aca1e19644 100644 --- a/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestTrecContentSource.java +++ b/lucene/benchmark/src/test/org/apache/lucene/benchmark/byTask/feeds/TestTrecContentSource.java @@ -36,7 +36,7 @@ public class TestTrecContentSource extends LuceneTestCase { /** A TrecDocMaker which works on a String and not files. */ private static class StringableTrecSource extends TrecContentSource { - private String docs = null; + private final String docs; public StringableTrecSource(String docs, boolean forever) { this.docs = docs; diff --git a/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java b/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java index fea11b675da7..7c2afd4177d0 100644 --- a/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java +++ b/lucene/core/src/java/org/apache/lucene/index/FieldInfo.java @@ -32,7 +32,7 @@ public final class FieldInfo { /** Internal field number */ public final int number; - private DocValuesType docValuesType = DocValuesType.NONE; + private DocValuesType docValuesType; // True if any document indexed term vectors private boolean storeTermVector; diff --git a/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java b/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java index d9ac4f37d84c..c9db6d0c6f66 100644 --- a/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java +++ b/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java @@ -84,7 +84,7 @@ public class LiveIndexWriterConfig { protected volatile int perThreadHardLimitMB; /** True if segment flushes should use compound file format */ - protected volatile boolean useCompoundFile = IndexWriterConfig.DEFAULT_USE_COMPOUND_FILE_SYSTEM; + protected volatile boolean useCompoundFile; /** True if calls to {@link IndexWriter#close()} should first do a commit. */ protected boolean commitOnClose = IndexWriterConfig.DEFAULT_COMMIT_ON_CLOSE; diff --git a/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java b/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java index 0b7a2cb72962..b8df032549be 100644 --- a/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java +++ b/lucene/core/src/java/org/apache/lucene/index/MergePolicy.java @@ -601,12 +601,12 @@ public MergeAbortedException(String message) { * If the size of the merge segment exceeds this ratio of the total index size then it will remain * in non-compound format */ - protected double noCFSRatio = DEFAULT_NO_CFS_RATIO; + protected double noCFSRatio; /** * If the size of the merged segment exceeds this value then it will not use compound file format. */ - protected long maxCFSSegmentSize = DEFAULT_MAX_CFS_SEGMENT_SIZE; + protected long maxCFSSegmentSize; /** Creates a new merge policy instance. */ protected MergePolicy() { diff --git a/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java b/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java index 7fa2a3386539..d33d3a00d37f 100644 --- a/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java +++ b/lucene/core/src/java/org/apache/lucene/search/WANDScorer.java @@ -120,7 +120,7 @@ private static long scaleMinScore(float minScore, int scalingFactor) { private final int scalingFactor; // scaled min competitive score - private long minCompetitiveScore = 0; + private long minCompetitiveScore; private final Scorer[] allScorers; diff --git a/lucene/core/src/java/org/apache/lucene/search/comparators/TermOrdValComparator.java b/lucene/core/src/java/org/apache/lucene/search/comparators/TermOrdValComparator.java index 4e9463cf82b9..31199c3cd2c7 100644 --- a/lucene/core/src/java/org/apache/lucene/search/comparators/TermOrdValComparator.java +++ b/lucene/core/src/java/org/apache/lucene/search/comparators/TermOrdValComparator.java @@ -89,7 +89,7 @@ public class TermOrdValComparator extends FieldComparator { private boolean singleSort; /** Whether this comparator is allowed to skip documents. */ - private boolean canSkipDocuments = true; + private boolean canSkipDocuments; /** Whether the collector is done with counting hits so that we can start skipping documents. */ private boolean hitsThresholdReached = false; diff --git a/lucene/core/src/java/org/apache/lucene/util/RoaringDocIdSet.java b/lucene/core/src/java/org/apache/lucene/util/RoaringDocIdSet.java index 7957c7ca0d1f..ccd92a74250e 100644 --- a/lucene/core/src/java/org/apache/lucene/util/RoaringDocIdSet.java +++ b/lucene/core/src/java/org/apache/lucene/util/RoaringDocIdSet.java @@ -253,7 +253,7 @@ public DocIdSetIterator iterator() throws IOException { private class Iterator extends DocIdSetIterator { int block; - DocIdSetIterator sub = null; + DocIdSetIterator sub; int doc; Iterator() throws IOException { diff --git a/lucene/core/src/java/org/apache/lucene/util/automaton/LimitedFiniteStringsIterator.java b/lucene/core/src/java/org/apache/lucene/util/automaton/LimitedFiniteStringsIterator.java index 853f51c81277..b4ebfe39ed06 100644 --- a/lucene/core/src/java/org/apache/lucene/util/automaton/LimitedFiniteStringsIterator.java +++ b/lucene/core/src/java/org/apache/lucene/util/automaton/LimitedFiniteStringsIterator.java @@ -31,7 +31,7 @@ */ public class LimitedFiniteStringsIterator extends FiniteStringsIterator { /** Maximum number of finite strings to create. */ - private int limit = Integer.MAX_VALUE; + private final int limit; /** Number of generated finite strings. */ private int count = 0; diff --git a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/OffsetsEnum.java b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/OffsetsEnum.java index ed96d83d9a9a..a18527fbb4b1 100644 --- a/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/OffsetsEnum.java +++ b/lucene/highlighter/src/java/org/apache/lucene/search/uhighlight/OffsetsEnum.java @@ -123,7 +123,7 @@ public static class OfPostings extends OffsetsEnum { private final PostingsEnum postingsEnum; // with offsets private final int freq; - private int posCounter = -1; + private int posCounter; public OfPostings(BytesRef term, int freq, PostingsEnum postingsEnum) throws IOException { this.term = Objects.requireNonNull(term); diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.java index 42bc83cef880..a8c39a41110c 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/BoostQueryNode.java @@ -30,7 +30,7 @@ */ public class BoostQueryNode extends QueryNodeImpl { - private float value = 0; + private float value; /** * Constructs a boost node diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java index ed0fbdeb5148..e367b70e8c9f 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ModifierQueryNode.java @@ -84,7 +84,7 @@ public String toLargeString() { } } - private Modifier modifier = Modifier.MOD_NONE; + private Modifier modifier; /** * Used to store the modifier value on the original query string diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/OpaqueQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/OpaqueQueryNode.java index 52eaad22b15b..d6fd81d98be6 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/OpaqueQueryNode.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/OpaqueQueryNode.java @@ -25,9 +25,9 @@ */ public class OpaqueQueryNode extends QueryNodeImpl { - private CharSequence schema = null; + private CharSequence schema; - private CharSequence value = null; + private CharSequence value; /** * @param schema - schema identifier diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PathQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PathQueryNode.java index 93ac8463349f..620f0d2d680b 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PathQueryNode.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PathQueryNode.java @@ -41,7 +41,7 @@ public class PathQueryNode extends QueryNodeImpl { /** Term text with a beginning and end position */ public static class QueryText implements Cloneable { - CharSequence value = null; + CharSequence value; /** != null The term's begin position. */ int begin; @@ -97,7 +97,7 @@ public String toString() { } } - private List values = null; + private List values; /** * @param pathElements - List of QueryText objects diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.java index 23d772b7b20d..e3794ac6b2b1 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/PhraseSlopQueryNode.java @@ -25,7 +25,7 @@ /** Query node for {@link PhraseQuery}'s slop factor. */ public class PhraseSlopQueryNode extends QueryNodeImpl implements FieldableNode { - private int value = 0; + private int value; /** * @exception QueryNodeError throw in overridden method to disallow diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ProximityQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ProximityQueryNode.java index 5df14d555dde..e12632751c7e 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ProximityQueryNode.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/ProximityQueryNode.java @@ -57,9 +57,9 @@ CharSequence toQueryString() { /** utility class containing the distance condition and number */ public static class ProximityType { - int pDistance = 0; + int pDistance; - Type pType = null; + Type pType; public ProximityType(Type type) { this(type, 0); @@ -71,10 +71,10 @@ public ProximityType(Type type, int distance) { } } - private Type proximityType = Type.SENTENCE; + private Type proximityType; private int distance = -1; - private boolean inorder = false; - private CharSequence field = null; + private final boolean inorder; + private CharSequence field; /** * @param clauses - QueryNode children diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/SlopQueryNode.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/SlopQueryNode.java index 0ad088dba7f2..2af07255a1b3 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/SlopQueryNode.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/core/nodes/SlopQueryNode.java @@ -32,7 +32,7 @@ */ public class SlopQueryNode extends QueryNodeImpl implements FieldableNode { - private int value = 0; + private int value; /** * @param query - QueryNode Tree with the phrase diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/FieldBoostMapFCListener.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/FieldBoostMapFCListener.java index 3f65b3409b12..465dc8b1ca02 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/FieldBoostMapFCListener.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/FieldBoostMapFCListener.java @@ -34,7 +34,7 @@ */ public class FieldBoostMapFCListener implements FieldConfigListener { - private QueryConfigHandler config = null; + private final QueryConfigHandler config; public FieldBoostMapFCListener(QueryConfigHandler config) { this.config = config; diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/FieldDateResolutionFCListener.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/FieldDateResolutionFCListener.java index 2987a470093e..1ff7d54893b1 100644 --- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/FieldDateResolutionFCListener.java +++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/FieldDateResolutionFCListener.java @@ -36,7 +36,7 @@ */ public class FieldDateResolutionFCListener implements FieldConfigListener { - private QueryConfigHandler config = null; + private final QueryConfigHandler config; public FieldDateResolutionFCListener(QueryConfigHandler config) { this.config = config; diff --git a/lucene/test-framework/src/java/org/apache/lucene/tests/index/DocHelper.java b/lucene/test-framework/src/java/org/apache/lucene/tests/index/DocHelper.java index f8fea3c8c065..b51842c8a401 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/tests/index/DocHelper.java +++ b/lucene/test-framework/src/java/org/apache/lucene/tests/index/DocHelper.java @@ -175,7 +175,7 @@ public class DocHelper { public static Field textUtfField2 = new Field(TEXT_FIELD_UTF2_KEY, FIELD_UTF2_TEXT, TEXT_TYPE_STORED_WITH_TVS); - public static Map nameValues = null; + public static Map nameValues; // ordered list of all the fields... // could use LinkedHashMap for this purpose if Java1.4 is OK