diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java index 566105878f8..f1341326df5 100644 --- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java +++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/JapaneseTokenizer.java @@ -70,7 +70,7 @@ import org.apache.lucene.util.fst.FST; public final class JapaneseTokenizer extends Tokenizer { /** Tokenization mode: this determines how the tokenizer handles compound and unknown words. */ - public static enum Mode { + public enum Mode { /** Ordinary segmentation: no decomposition for compounds, */ NORMAL, diff --git a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/CharacterDefinition.java b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/CharacterDefinition.java index 562dddc2464..d19d020d128 100644 --- a/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/CharacterDefinition.java +++ b/lucene/analysis/kuromoji/src/java/org/apache/lucene/analysis/ja/dict/CharacterDefinition.java @@ -34,7 +34,7 @@ public final class CharacterDefinition { public static final int CLASS_COUNT = CharacterClass.values().length; // only used internally for lookup: - private static enum CharacterClass { + private enum CharacterClass { NGRAM, DEFAULT, SPACE, diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50StoredFieldsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50StoredFieldsFormat.java index fec31425428..0e5a6b5c451 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50StoredFieldsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene50/Lucene50StoredFieldsFormat.java @@ -105,7 +105,7 @@ import org.apache.lucene.util.packed.DirectMonotonicWriter; public class Lucene50StoredFieldsFormat extends StoredFieldsFormat { /** Configuration option for stored fields. */ - public static enum Mode { + public enum Mode { /** Trade compression ratio for retrieval speed. */ BEST_SPEED, /** Trade retrieval speed for compression ratio. */ diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene80/Lucene80DocValuesFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene80/Lucene80DocValuesFormat.java index 4f80698cc63..3dde8a74c7c 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene80/Lucene80DocValuesFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene80/Lucene80DocValuesFormat.java @@ -140,7 +140,7 @@ import org.apache.lucene.util.packed.DirectWriter; public final class Lucene80DocValuesFormat extends DocValuesFormat { /** Configuration option for doc values. */ - public static enum Mode { + public enum Mode { /** Trade compression ratio for retrieval speed. */ BEST_SPEED, /** Trade retrieval speed for compression ratio. */ diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java index e261f51638b..b1819c0e743 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87Codec.java @@ -55,7 +55,7 @@ import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat; public class Lucene87Codec extends Codec { /** Configuration option for the codec. */ - public static enum Mode { + public enum Mode { /** Trade compression ratio for retrieval speed. */ BEST_SPEED(Lucene87StoredFieldsFormat.Mode.BEST_SPEED, Lucene80DocValuesFormat.Mode.BEST_SPEED), /** Trade retrieval speed for compression ratio. */ diff --git a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87StoredFieldsFormat.java b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87StoredFieldsFormat.java index bf4d634e2b5..8904cc2aa5c 100644 --- a/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87StoredFieldsFormat.java +++ b/lucene/backward-codecs/src/java/org/apache/lucene/backward_codecs/lucene87/Lucene87StoredFieldsFormat.java @@ -103,7 +103,7 @@ import org.apache.lucene.util.packed.DirectMonotonicWriter; public class Lucene87StoredFieldsFormat extends StoredFieldsFormat { /** Configuration option for stored fields. */ - public static enum Mode { + public enum Mode { /** Trade compression ratio for retrieval speed. */ BEST_SPEED, /** Trade retrieval speed for compression ratio. */ diff --git a/lucene/core/src/java/org/apache/lucene/analysis/package-info.java b/lucene/core/src/java/org/apache/lucene/analysis/package-info.java index 4c3270dc117..52f18765188 100644 --- a/lucene/core/src/java/org/apache/lucene/analysis/package-info.java +++ b/lucene/core/src/java/org/apache/lucene/analysis/package-info.java @@ -782,7 +782,7 @@ * *
  *   public interface PartOfSpeechAttribute extends Attribute {
- *     public static enum PartOfSpeech {
+ *     public enum PartOfSpeech {
  *       Noun, Verb, Adjective, Adverb, Pronoun, Preposition, Conjunction, Article, Unknown
  *     }
  *
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90Codec.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90Codec.java
index c2491282178..3ce67e1cc4c 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90Codec.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90Codec.java
@@ -46,7 +46,7 @@ import org.apache.lucene.codecs.perfield.PerFieldPostingsFormat;
 public class Lucene90Codec extends Codec {
 
   /** Configuration option for the codec. */
-  public static enum Mode {
+  public enum Mode {
     /** Trade compression ratio for retrieval speed. */
     BEST_SPEED(Lucene90StoredFieldsFormat.Mode.BEST_SPEED, Lucene90DocValuesFormat.Mode.BEST_SPEED),
     /** Trade retrieval speed for compression ratio. */
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesFormat.java
index 51db858deb7..6c6788cc3a0 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesFormat.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90DocValuesFormat.java
@@ -140,7 +140,7 @@ import org.apache.lucene.util.packed.DirectWriter;
 public final class Lucene90DocValuesFormat extends DocValuesFormat {
 
   /** Configuration option for doc values. */
-  public static enum Mode {
+  public enum Mode {
     /** Trade compression ratio for retrieval speed. */
     BEST_SPEED,
     /** Trade retrieval speed for compression ratio. */
diff --git a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90StoredFieldsFormat.java b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90StoredFieldsFormat.java
index 104223e6f2d..77e24c6a2b7 100644
--- a/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90StoredFieldsFormat.java
+++ b/lucene/core/src/java/org/apache/lucene/codecs/lucene90/Lucene90StoredFieldsFormat.java
@@ -103,7 +103,7 @@ import org.apache.lucene.util.packed.DirectMonotonicWriter;
 public class Lucene90StoredFieldsFormat extends StoredFieldsFormat {
 
   /** Configuration option for stored fields. */
-  public static enum Mode {
+  public enum Mode {
     /** Trade compression ratio for retrieval speed. */
     BEST_SPEED,
     /** Trade retrieval speed for compression ratio. */
diff --git a/lucene/core/src/java/org/apache/lucene/document/DateTools.java b/lucene/core/src/java/org/apache/lucene/document/DateTools.java
index 49e404b73ef..c9ee4b02d1e 100644
--- a/lucene/core/src/java/org/apache/lucene/document/DateTools.java
+++ b/lucene/core/src/java/org/apache/lucene/document/DateTools.java
@@ -169,7 +169,7 @@ public class DateTools {
   }
 
   /** Specifies the time granularity. */
-  public static enum Resolution {
+  public enum Resolution {
 
     /** Limit a date's resolution to year granularity. */
     YEAR(4),
diff --git a/lucene/core/src/java/org/apache/lucene/document/Field.java b/lucene/core/src/java/org/apache/lucene/document/Field.java
index ef66beff0cc..126e85e3e22 100644
--- a/lucene/core/src/java/org/apache/lucene/document/Field.java
+++ b/lucene/core/src/java/org/apache/lucene/document/Field.java
@@ -579,7 +579,7 @@ public class Field implements IndexableField {
   }
 
   /** Specifies whether and how a field should be stored. */
-  public static enum Store {
+  public enum Store {
 
     /**
      * Store the original field value in the index. This is useful for short texts like a document's
diff --git a/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java b/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java
index ffa6d2dc3cc..5ee99878567 100644
--- a/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java
+++ b/lucene/core/src/java/org/apache/lucene/index/FilteredTermsEnum.java
@@ -47,7 +47,7 @@ public abstract class FilteredTermsEnum extends TermsEnum {
    *
    * @see #accept(BytesRef)
    */
-  protected static enum AcceptStatus {
+  protected enum AcceptStatus {
     /** Accept the term and position the enum at the next term. */
     YES,
     /**
diff --git a/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java b/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java
index 1463c0a9547..e014af761ec 100644
--- a/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java
+++ b/lucene/core/src/java/org/apache/lucene/index/IndexWriterConfig.java
@@ -53,7 +53,7 @@ import org.apache.lucene.util.Version;
 public final class IndexWriterConfig extends LiveIndexWriterConfig {
 
   /** Specifies the open mode for {@link IndexWriter}. */
-  public static enum OpenMode {
+  public enum OpenMode {
     /** Creates a new index or overwrites an existing one. */
     CREATE,
 
diff --git a/lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java b/lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java
index 81316cd44db..5ff45f40c56 100644
--- a/lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java
+++ b/lucene/core/src/java/org/apache/lucene/index/StoredFieldVisitor.java
@@ -69,7 +69,7 @@ public abstract class StoredFieldVisitor {
   public abstract Status needsField(FieldInfo fieldInfo) throws IOException;
 
   /** Enumeration of possible return values for {@link #needsField}. */
-  public static enum Status {
+  public enum Status {
     /** YES: the field should be visited. */
     YES,
     /** NO: don't visit this field, but continue processing fields for this document. */
diff --git a/lucene/core/src/java/org/apache/lucene/search/BooleanClause.java b/lucene/core/src/java/org/apache/lucene/search/BooleanClause.java
index 8455e0c8ac4..7d52cdec77c 100644
--- a/lucene/core/src/java/org/apache/lucene/search/BooleanClause.java
+++ b/lucene/core/src/java/org/apache/lucene/search/BooleanClause.java
@@ -22,7 +22,7 @@ import java.util.Objects;
 public final class BooleanClause {
 
   /** Specifies how clauses are to occur in matching documents. */
-  public static enum Occur {
+  public enum Occur {
 
     /** Use this operator for clauses that must appear in the matching documents. */
     MUST {
diff --git a/lucene/core/src/java/org/apache/lucene/search/SortField.java b/lucene/core/src/java/org/apache/lucene/search/SortField.java
index 337c24b5c8c..ccd135dc579 100644
--- a/lucene/core/src/java/org/apache/lucene/search/SortField.java
+++ b/lucene/core/src/java/org/apache/lucene/search/SortField.java
@@ -48,7 +48,7 @@ import org.apache.lucene.util.NumericUtils;
 public class SortField {
 
   /** Specifies the type of the terms to be sorted, or special types such as CUSTOM */
-  public static enum Type {
+  public enum Type {
 
     /**
      * Sort by document score (relevance). Sort values are Float and higher values are at the front.
diff --git a/lucene/core/src/java/org/apache/lucene/search/spans/FilterSpans.java b/lucene/core/src/java/org/apache/lucene/search/spans/FilterSpans.java
index b12e651a2df..0102f30d05d 100644
--- a/lucene/core/src/java/org/apache/lucene/search/spans/FilterSpans.java
+++ b/lucene/core/src/java/org/apache/lucene/search/spans/FilterSpans.java
@@ -209,7 +209,7 @@ public abstract class FilterSpans extends Spans {
    * Status returned from {@link FilterSpans#accept(Spans)} that indicates whether a candidate match
    * should be accepted, rejected, or rejected and move on to the next document.
    */
-  public static enum AcceptStatus {
+  public enum AcceptStatus {
     /** Indicates the match should be accepted */
     YES,
 
diff --git a/lucene/expressions/src/java/org/apache/lucene/expressions/js/VariableContext.java b/lucene/expressions/src/java/org/apache/lucene/expressions/js/VariableContext.java
index 2674325e2c7..5c39f80395e 100644
--- a/lucene/expressions/src/java/org/apache/lucene/expressions/js/VariableContext.java
+++ b/lucene/expressions/src/java/org/apache/lucene/expressions/js/VariableContext.java
@@ -26,7 +26,7 @@ import java.util.List;
 public class VariableContext {
 
   /** Represents what a piece of a variable does. */
-  public static enum Type {
+  public enum Type {
     /** A member of the previous context (ie "dot" access). */
     MEMBER,
 
diff --git a/lucene/queries/src/java/org/apache/lucene/queries/payloads/SpanPayloadCheckQuery.java b/lucene/queries/src/java/org/apache/lucene/queries/payloads/SpanPayloadCheckQuery.java
index 0d89a1fd8ce..f007d325a1d 100644
--- a/lucene/queries/src/java/org/apache/lucene/queries/payloads/SpanPayloadCheckQuery.java
+++ b/lucene/queries/src/java/org/apache/lucene/queries/payloads/SpanPayloadCheckQuery.java
@@ -49,7 +49,7 @@ public class SpanPayloadCheckQuery extends SpanQuery {
   protected final MatchOperation operation;
   protected final PayloadType payloadType;
   /** The payload type. This specifies the decoding of the ByteRef for the payload. */
-  public static enum PayloadType {
+  public enum PayloadType {
     /** INT is for a 4 byte payload that is a packed integer */
     INT,
     /** FLOAT is a 4 byte payload decoded to a float(32bit). */
@@ -59,7 +59,7 @@ public class SpanPayloadCheckQuery extends SpanQuery {
   };
 
   /** The payload type. This specifies the decoding of the ByteRef for the payload. */
-  public static enum MatchOperation {
+  public enum MatchOperation {
     /** Checks for binary equality of the byte array (default) */
     EQ,
     /** GT Matches if the payload value is greater than the reference */
diff --git a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/StandardQueryConfigHandler.java b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/StandardQueryConfigHandler.java
index 12aa3349c40..6cd4d969e49 100644
--- a/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/StandardQueryConfigHandler.java
+++ b/lucene/queryparser/src/java/org/apache/lucene/queryparser/flexible/standard/config/StandardQueryConfigHandler.java
@@ -183,7 +183,7 @@ public class StandardQueryConfigHandler extends QueryConfigHandler {
   }
 
   /** Boolean Operator: AND or OR */
-  public static enum Operator {
+  public enum Operator {
     AND,
     OR;
   }
diff --git a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggester.java b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggester.java
index 9fee03a1c66..61681cd7322 100644
--- a/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggester.java
+++ b/lucene/suggest/src/java/org/apache/lucene/search/suggest/analyzing/BlendedInfixSuggester.java
@@ -69,7 +69,7 @@ public class BlendedInfixSuggester extends AnalyzingInfixSuggester {
   private final BlenderType blenderType;
 
   /** The different types of blender. */
-  public static enum BlenderType {
+  public enum BlenderType {
     /** Application dependent; override {@link #calculateCoefficient} to compute it. */
     CUSTOM,
     /** weight*(1 - 0.10*position) */
diff --git a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockTokenizer.java b/lucene/test-framework/src/java/org/apache/lucene/analysis/MockTokenizer.java
index 880e0c2a396..02d189cd0d0 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/analysis/MockTokenizer.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/analysis/MockTokenizer.java
@@ -71,7 +71,7 @@ public class MockTokenizer extends Tokenizer {
   // TODO: "register" with LuceneTestCase to ensure all streams are closed() ?
   // currently, we can only check that the lifecycle is correct if someone is reusing,
   // but not for "one-offs".
-  private static enum State {
+  private enum State {
     SETREADER, // consumer set a reader input either via ctor or via reset(Reader)
     RESET, // consumer has called reset()
     INCREMENT, // consumer is consuming, has called incrementToken() == true
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/AlcoholicMergePolicy.java b/lucene/test-framework/src/java/org/apache/lucene/index/AlcoholicMergePolicy.java
index 22ec838b888..3291ec00760 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/AlcoholicMergePolicy.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/AlcoholicMergePolicy.java
@@ -63,7 +63,7 @@ public class AlcoholicMergePolicy extends LogMergePolicy {
     return info.sizeInBytes();
   }
 
-  private static enum Drink {
+  private enum Drink {
     Beer(15),
     Wine(17),
     Champagne(21),
diff --git a/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java b/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java
index 74def721051..636603fe52c 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/index/AssertingLeafReader.java
@@ -349,7 +349,7 @@ public class AssertingLeafReader extends FilterLeafReader {
     }
   }
 
-  static enum DocsEnumState {
+  enum DocsEnumState {
     START,
     ITERATING,
     FINISHED
diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorer.java b/lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorer.java
index 9c231df102e..83ffc789b40 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorer.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/search/AssertingScorer.java
@@ -24,7 +24,7 @@ import java.util.Random;
 /** Wraps a Scorer with additional checks */
 public class AssertingScorer extends Scorer {
 
-  static enum IteratorState {
+  enum IteratorState {
     APPROXIMATING,
     ITERATING,
     SHALLOW_ADVANCING,
diff --git a/lucene/test-framework/src/java/org/apache/lucene/search/spans/AssertingSpans.java b/lucene/test-framework/src/java/org/apache/lucene/search/spans/AssertingSpans.java
index ec5a2edad36..45898d1628b 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/search/spans/AssertingSpans.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/search/spans/AssertingSpans.java
@@ -26,7 +26,7 @@ class AssertingSpans extends Spans {
   int doc = -1;
 
   /** tracks current state of this spans */
-  static enum State {
+  enum State {
     /** document iteration has not yet begun ({@link #docID()} = -1) */
     DOC_START,
 
diff --git a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
index d81baa62506..40dd1432356 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/store/MockDirectoryWrapper.java
@@ -170,7 +170,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper {
    *
    * 

WARNING: can make tests very slow. */ - public static enum Throttling { + public enum Throttling { /** always emulate a slow hard disk. could be very slow! */ ALWAYS, /** sometimes (0.5% of the time) emulate a slow hard disk. */ @@ -756,7 +756,7 @@ public class MockDirectoryWrapper extends BaseDirectoryWrapper { return maybeThrottle(name, io); } - private static enum Handle { + private enum Handle { Input, Output, Slice