diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/InternalElasticsearchDistributionTypes.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/InternalElasticsearchDistributionTypes.java index 28776f03d17e8..c44b1212e6489 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/InternalElasticsearchDistributionTypes.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/distribution/InternalElasticsearchDistributionTypes.java @@ -14,14 +14,14 @@ import java.util.List; public class InternalElasticsearchDistributionTypes { - public static ElasticsearchDistributionType DEB = new DebElasticsearchDistributionType(); - public static ElasticsearchDistributionType RPM = new RpmElasticsearchDistributionType(); - public static ElasticsearchDistributionType DOCKER = new DockerElasticsearchDistributionType(); - public static ElasticsearchDistributionType DOCKER_IRONBANK = new DockerIronBankElasticsearchDistributionType(); - public static ElasticsearchDistributionType DOCKER_CLOUD_ESS = new DockerCloudEssElasticsearchDistributionType(); - public static ElasticsearchDistributionType DOCKER_WOLFI = new DockerWolfiElasticsearchDistributionType(); + public static final ElasticsearchDistributionType DEB = new DebElasticsearchDistributionType(); + public static final ElasticsearchDistributionType RPM = new RpmElasticsearchDistributionType(); + public static final ElasticsearchDistributionType DOCKER = new DockerElasticsearchDistributionType(); + public static final ElasticsearchDistributionType DOCKER_IRONBANK = new DockerIronBankElasticsearchDistributionType(); + public static final ElasticsearchDistributionType DOCKER_CLOUD_ESS = new DockerCloudEssElasticsearchDistributionType(); + public static final ElasticsearchDistributionType DOCKER_WOLFI = new DockerWolfiElasticsearchDistributionType(); - public static List ALL_INTERNAL = List.of( + public static final List ALL_INTERNAL = List.of( DEB, RPM, DOCKER, diff --git a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rerun/TestRerunTaskExtension.java b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rerun/TestRerunTaskExtension.java index f08d3dadc1bb0..8e4519b55e15b 100644 --- a/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rerun/TestRerunTaskExtension.java +++ b/build-tools-internal/src/main/java/org/elasticsearch/gradle/internal/test/rerun/TestRerunTaskExtension.java @@ -30,7 +30,7 @@ public class TestRerunTaskExtension { /** * The name of the extension added to each test task. */ - public static String NAME = "rerun"; + public static final String NAME = "rerun"; private final Property maxReruns; diff --git a/build-tools/src/main/java/org/elasticsearch/gradle/distribution/ElasticsearchDistributionTypes.java b/build-tools/src/main/java/org/elasticsearch/gradle/distribution/ElasticsearchDistributionTypes.java index 8a53d56e3c4ce..68eef25df5be1 100644 --- a/build-tools/src/main/java/org/elasticsearch/gradle/distribution/ElasticsearchDistributionTypes.java +++ b/build-tools/src/main/java/org/elasticsearch/gradle/distribution/ElasticsearchDistributionTypes.java @@ -12,6 +12,6 @@ import org.elasticsearch.gradle.ElasticsearchDistributionType; public class ElasticsearchDistributionTypes { - public static ElasticsearchDistributionType ARCHIVE = new ArchiveElasticsearchDistributionType(); - public static ElasticsearchDistributionType INTEG_TEST_ZIP = new IntegTestZipElasticsearchDistributionType(); + public static final ElasticsearchDistributionType ARCHIVE = new ArchiveElasticsearchDistributionType(); + public static final ElasticsearchDistributionType INTEG_TEST_ZIP = new IntegTestZipElasticsearchDistributionType(); } diff --git a/libs/grok/src/main/java/org/elasticsearch/grok/PatternBank.java b/libs/grok/src/main/java/org/elasticsearch/grok/PatternBank.java index e6f8af9b566d5..cf8edf07f280a 100644 --- a/libs/grok/src/main/java/org/elasticsearch/grok/PatternBank.java +++ b/libs/grok/src/main/java/org/elasticsearch/grok/PatternBank.java @@ -23,7 +23,7 @@ public class PatternBank { - public static PatternBank EMPTY = new PatternBank(Map.of()); + public static final PatternBank EMPTY = new PatternBank(Map.of()); private final Map bank; diff --git a/libs/h3/src/main/java/org/elasticsearch/h3/Constants.java b/libs/h3/src/main/java/org/elasticsearch/h3/Constants.java index 3b3f760c0534f..fa52ff6ee56cf 100644 --- a/libs/h3/src/main/java/org/elasticsearch/h3/Constants.java +++ b/libs/h3/src/main/java/org/elasticsearch/h3/Constants.java @@ -29,7 +29,7 @@ final class Constants { /** * sqrt(3) / 2.0 */ - public static double M_SQRT3_2 = 0.8660254037844386467637231707529361834714; + public static final double M_SQRT3_2 = 0.8660254037844386467637231707529361834714; /** * 2.0 * PI */ @@ -37,19 +37,19 @@ final class Constants { /** * The number of H3 base cells */ - public static int NUM_BASE_CELLS = 122; + public static final int NUM_BASE_CELLS = 122; /** * The number of vertices in a hexagon */ - public static int NUM_HEX_VERTS = 6; + public static final int NUM_HEX_VERTS = 6; /** * The number of vertices in a pentagon */ - public static int NUM_PENT_VERTS = 5; + public static final int NUM_PENT_VERTS = 5; /** * H3 index modes */ - public static int H3_CELL_MODE = 1; + public static final int H3_CELL_MODE = 1; /** * square root of 7 */ @@ -64,14 +64,14 @@ final class Constants { * (or distance between adjacent cell center points * on the plane) to gnomonic unit length. */ - public static double RES0_U_GNOMONIC = 0.38196601125010500003; + public static final double RES0_U_GNOMONIC = 0.38196601125010500003; /** * rotation angle between Class II and Class III resolution axes * (asin(sqrt(3.0 / 28.0))) */ - public static double M_AP7_ROT_RADS = 0.333473172251832115336090755351601070065900389; + public static final double M_AP7_ROT_RADS = 0.333473172251832115336090755351601070065900389; /** * threshold epsilon */ - public static double EPSILON = 0.0000000000000001; + public static final double EPSILON = 0.0000000000000001; } diff --git a/libs/h3/src/main/java/org/elasticsearch/h3/H3.java b/libs/h3/src/main/java/org/elasticsearch/h3/H3.java index 08031088728ba..ac35fe6670c1b 100644 --- a/libs/h3/src/main/java/org/elasticsearch/h3/H3.java +++ b/libs/h3/src/main/java/org/elasticsearch/h3/H3.java @@ -33,7 +33,7 @@ public final class H3 { /** * max H3 resolution; H3 version 1 has 16 resolutions, numbered 0 through 15 */ - public static int MAX_H3_RES = 15; + public static final int MAX_H3_RES = 15; private static final long[] NORTH = new long[MAX_H3_RES + 1]; private static final long[] SOUTH = new long[MAX_H3_RES + 1]; diff --git a/libs/h3/src/main/java/org/elasticsearch/h3/H3Index.java b/libs/h3/src/main/java/org/elasticsearch/h3/H3Index.java index 2b1b9cade21a4..88261dd458feb 100644 --- a/libs/h3/src/main/java/org/elasticsearch/h3/H3Index.java +++ b/libs/h3/src/main/java/org/elasticsearch/h3/H3Index.java @@ -41,22 +41,22 @@ public static boolean H3_is_pentagon(long h3) { return BaseCells.isBaseCellPentagon(H3Index.H3_get_base_cell(h3)) && H3Index.h3LeadingNonZeroDigit(h3) == 0; } - public static long H3_INIT = 35184372088831L; + public static final long H3_INIT = 35184372088831L; /** * The bit offset of the mode in an H3 index. */ - public static int H3_MODE_OFFSET = 59; + public static final int H3_MODE_OFFSET = 59; /** * 1's in the 4 mode bits, 0's everywhere else. */ - public static long H3_MODE_MASK = 15L << H3_MODE_OFFSET; + public static final long H3_MODE_MASK = 15L << H3_MODE_OFFSET; /** * 0's in the 4 mode bits, 1's everywhere else. */ - public static long H3_MODE_MASK_NEGATIVE = ~H3_MODE_MASK; + public static final long H3_MODE_MASK_NEGATIVE = ~H3_MODE_MASK; public static long H3_set_mode(long h3, long mode) { return (h3 & H3_MODE_MASK_NEGATIVE) | (mode << H3_MODE_OFFSET); @@ -65,16 +65,16 @@ public static long H3_set_mode(long h3, long mode) { /** * The bit offset of the base cell in an H3 index. */ - public static int H3_BC_OFFSET = 45; + public static final int H3_BC_OFFSET = 45; /** * 1's in the 7 base cell bits, 0's everywhere else. */ - public static long H3_BC_MASK = 127L << H3_BC_OFFSET; + public static final long H3_BC_MASK = 127L << H3_BC_OFFSET; /** * 0's in the 7 base cell bits, 1's everywhere else. */ - public static long H3_BC_MASK_NEGATIVE = ~H3_BC_MASK; + public static final long H3_BC_MASK_NEGATIVE = ~H3_BC_MASK; /** * Sets the integer base cell of h3 to bc. @@ -83,26 +83,26 @@ public static long H3_set_base_cell(long h3, long bc) { return (h3 & H3_BC_MASK_NEGATIVE) | (bc << H3_BC_OFFSET); } - public static int H3_RES_OFFSET = 52; + public static final int H3_RES_OFFSET = 52; /** * 1's in the 4 resolution bits, 0's everywhere else. */ - public static long H3_RES_MASK = 15L << H3_RES_OFFSET; + public static final long H3_RES_MASK = 15L << H3_RES_OFFSET; /** * 0's in the 4 resolution bits, 1's everywhere else. */ - public static long H3_RES_MASK_NEGATIVE = ~H3_RES_MASK; + public static final long H3_RES_MASK_NEGATIVE = ~H3_RES_MASK; /** * The bit offset of the max resolution digit in an H3 index. */ - public static int H3_MAX_OFFSET = 63; + public static final int H3_MAX_OFFSET = 63; /** * 1 in the highest bit, 0's everywhere else. */ - public static long H3_HIGH_BIT_MASK = (1L << H3_MAX_OFFSET); + public static final long H3_HIGH_BIT_MASK = (1L << H3_MAX_OFFSET); /** * Gets the highest bit of the H3 index. @@ -121,12 +121,12 @@ public static long H3_set_resolution(long h3, long res) { /** * The bit offset of the reserved bits in an H3 index. */ - public static int H3_RESERVED_OFFSET = 56; + public static final int H3_RESERVED_OFFSET = 56; /** * 1's in the 3 reserved bits, 0's everywhere else. */ - public static long H3_RESERVED_MASK = (7L << H3_RESERVED_OFFSET); + public static final long H3_RESERVED_MASK = (7L << H3_RESERVED_OFFSET); /** * Gets a value in the reserved space. Should always be zero for valid indexes. @@ -149,12 +149,12 @@ public static int H3_get_resolution(long h3) { /** * The number of bits in a single H3 resolution digit. */ - public static int H3_PER_DIGIT_OFFSET = 3; + public static final int H3_PER_DIGIT_OFFSET = 3; /** * 1's in the 3 bits of res 15 digit bits, 0's everywhere else. */ - public static long H3_DIGIT_MASK = 7L; + public static final long H3_DIGIT_MASK = 7L; /** * Gets the resolution res integer digit (0-7) of h3. diff --git a/libs/logstash-bridge/src/main/java/org/elasticsearch/logstashbridge/ingest/IngestDocumentBridge.java b/libs/logstash-bridge/src/main/java/org/elasticsearch/logstashbridge/ingest/IngestDocumentBridge.java index da97be39d97c5..1df089c0427dc 100644 --- a/libs/logstash-bridge/src/main/java/org/elasticsearch/logstashbridge/ingest/IngestDocumentBridge.java +++ b/libs/logstash-bridge/src/main/java/org/elasticsearch/logstashbridge/ingest/IngestDocumentBridge.java @@ -20,8 +20,6 @@ public class IngestDocumentBridge extends StableBridgeAPI.Proxy { - public static String INGEST_KEY = IngestDocument.INGEST_KEY; - public static IngestDocumentBridge wrap(final IngestDocument ingestDocument) { if (ingestDocument == null) { return null; diff --git a/libs/tdigest/src/main/java/org/elasticsearch/tdigest/MergingDigest.java b/libs/tdigest/src/main/java/org/elasticsearch/tdigest/MergingDigest.java index 06724b049f821..61bec8e41b163 100644 --- a/libs/tdigest/src/main/java/org/elasticsearch/tdigest/MergingDigest.java +++ b/libs/tdigest/src/main/java/org/elasticsearch/tdigest/MergingDigest.java @@ -111,7 +111,7 @@ public class MergingDigest extends AbstractTDigest { // based on accumulated k-index. This can be much faster since we // scale functions are more expensive than the corresponding // weight limits. - public static boolean useWeightLimit = true; + public static final boolean useWeightLimit = true; static MergingDigest create(TDigestArrays arrays, double compression) { arrays.adjustBreaker(SHALLOW_SIZE); diff --git a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintAnalyzerProvider.java b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintAnalyzerProvider.java index 1fcbfb4bc2c8d..68acf46f21c24 100644 --- a/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintAnalyzerProvider.java +++ b/modules/analysis-common/src/main/java/org/elasticsearch/analysis/common/FingerprintAnalyzerProvider.java @@ -24,11 +24,11 @@ */ public class FingerprintAnalyzerProvider extends AbstractIndexAnalyzerProvider { - public static ParseField SEPARATOR = new ParseField("separator"); - public static ParseField MAX_OUTPUT_SIZE = new ParseField("max_output_size"); + public static final ParseField SEPARATOR = new ParseField("separator"); + public static final ParseField MAX_OUTPUT_SIZE = new ParseField("max_output_size"); - public static int DEFAULT_MAX_OUTPUT_SIZE = 255; - public static CharArraySet DEFAULT_STOP_WORDS = CharArraySet.EMPTY_SET; + public static final int DEFAULT_MAX_OUTPUT_SIZE = 255; + public static final CharArraySet DEFAULT_STOP_WORDS = CharArraySet.EMPTY_SET; public static final char DEFAULT_SEPARATOR = ' '; private final FingerprintAnalyzer analyzer; diff --git a/modules/dot-prefix-validation/src/main/java/org/elasticsearch/validation/DotPrefixValidator.java b/modules/dot-prefix-validation/src/main/java/org/elasticsearch/validation/DotPrefixValidator.java index 7f65bbb6937d9..80fb8a3b2e364 100644 --- a/modules/dot-prefix-validation/src/main/java/org/elasticsearch/validation/DotPrefixValidator.java +++ b/modules/dot-prefix-validation/src/main/java/org/elasticsearch/validation/DotPrefixValidator.java @@ -67,7 +67,7 @@ public abstract class DotPrefixValidator implements MappedActionFil ".ml-state", ".ml-anomalies-unrelated" ); - public static Setting> IGNORED_INDEX_PATTERNS_SETTING = Setting.stringListSetting( + public static final Setting> IGNORED_INDEX_PATTERNS_SETTING = Setting.stringListSetting( "cluster.indices.validate_ignored_dot_patterns", List.of( "\\.ml-state-\\d+", diff --git a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateResponse.java b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateResponse.java index 9bb80d5688b5f..f8a56dcfc990e 100644 --- a/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateResponse.java +++ b/modules/lang-mustache/src/main/java/org/elasticsearch/script/mustache/SearchTemplateResponse.java @@ -27,7 +27,7 @@ import java.io.InputStream; public class SearchTemplateResponse extends ActionResponse implements ToXContentObject { - public static ParseField TEMPLATE_OUTPUT_FIELD = new ParseField("template_output"); + public static final ParseField TEMPLATE_OUTPUT_FIELD = new ParseField("template_output"); /** Contains the source of the rendered template **/ private BytesReference source; diff --git a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java index b0634f0f1332f..6127b4beb71ff 100644 --- a/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java +++ b/modules/legacy-geo/src/main/java/org/elasticsearch/legacygeo/mapper/LegacyGeoShapeFieldMapper.java @@ -359,7 +359,7 @@ public LegacyGeoShapeFieldMapper build(MapperBuilderContext context) { } @Deprecated - public static Mapper.TypeParser PARSER = (name, node, parserContext) -> { + public static final Mapper.TypeParser PARSER = (name, node, parserContext) -> { boolean ignoreMalformedByDefault = IGNORE_MALFORMED_SETTING.get(parserContext.getSettings()); boolean coerceByDefault = COERCE_SETTING.get(parserContext.getSettings()); FieldMapper.Builder builder = new LegacyGeoShapeFieldMapper.Builder( diff --git a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/TokenCountFieldMapper.java b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/TokenCountFieldMapper.java index fd0098851c5f8..db2762a028e6a 100644 --- a/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/TokenCountFieldMapper.java +++ b/modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/extras/TokenCountFieldMapper.java @@ -127,7 +127,7 @@ public ValueFetcher valueFetcher(SearchExecutionContext context, String format) } } - public static TypeParser PARSER = new TypeParser((n, c) -> new Builder(n)); + public static final TypeParser PARSER = new TypeParser((n, c) -> new Builder(n)); private final boolean index; private final boolean hasDocValues; diff --git a/modules/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureStorageService.java b/modules/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureStorageService.java index 7373ed9485784..4c7d42e6080cd 100644 --- a/modules/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureStorageService.java +++ b/modules/repository-azure/src/main/java/org/elasticsearch/repositories/azure/AzureStorageService.java @@ -37,7 +37,7 @@ public class AzureStorageService { * The maximum size of a BlockBlob block. * See https://docs.microsoft.com/en-us/rest/api/storageservices/understanding-block-blobs--append-blobs--and-page-blobs */ - public static ByteSizeValue MAX_BLOCK_SIZE = new ByteSizeValue(100, ByteSizeUnit.MB); + public static final ByteSizeValue MAX_BLOCK_SIZE = new ByteSizeValue(100, ByteSizeUnit.MB); /** * The maximum number of blocks. diff --git a/modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3RepositoriesMetrics.java b/modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3RepositoriesMetrics.java index 03106c26c9a29..6f28eda81a9b9 100644 --- a/modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3RepositoriesMetrics.java +++ b/modules/repository-s3/src/main/java/org/elasticsearch/repositories/s3/S3RepositoriesMetrics.java @@ -21,7 +21,7 @@ public record S3RepositoriesMetrics( LongHistogram retryDeletesHistogram ) { - public static S3RepositoriesMetrics NOOP = new S3RepositoriesMetrics(RepositoriesMetrics.NOOP); + public static final S3RepositoriesMetrics NOOP = new S3RepositoriesMetrics(RepositoriesMetrics.NOOP); public static final String METRIC_RETRY_EVENT_TOTAL = "es.repositories.s3.input_stream.retry.event.total"; public static final String METRIC_RETRY_SUCCESS_TOTAL = "es.repositories.s3.input_stream.retry.success.total"; diff --git a/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Plugin.java b/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Plugin.java index 449fd72669dad..3feaa2874ebdc 100644 --- a/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Plugin.java +++ b/modules/transport-netty4/src/main/java/org/elasticsearch/transport/netty4/Netty4Plugin.java @@ -91,7 +91,7 @@ public class Netty4Plugin extends Plugin implements NetworkPlugin { */ private static final ByteSizeValue MTU = ByteSizeValue.ofBytes(Long.parseLong(System.getProperty("es.net.mtu", "1500"))); private static final String SETTING_KEY_HTTP_NETTY_MAX_COMPOSITE_BUFFER_COMPONENTS = "http.netty.max_composite_buffer_components"; - public static Setting SETTING_HTTP_NETTY_MAX_COMPOSITE_BUFFER_COMPONENTS = new Setting<>( + public static final Setting SETTING_HTTP_NETTY_MAX_COMPOSITE_BUFFER_COMPONENTS = new Setting<>( SETTING_KEY_HTTP_NETTY_MAX_COMPOSITE_BUFFER_COMPONENTS, (s) -> { ByteSizeValue maxContentLength = SETTING_HTTP_MAX_CONTENT_LENGTH.get(s); diff --git a/plugins/mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapper.java b/plugins/mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapper.java index c12849d545b33..6eaa95c7f0553 100644 --- a/plugins/mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapper.java +++ b/plugins/mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext/AnnotatedTextFieldMapper.java @@ -167,7 +167,7 @@ public AnnotatedTextFieldMapper build(MapperBuilderContext context) { } } - public static TypeParser PARSER = new TypeParser( + public static final TypeParser PARSER = new TypeParser( (n, c) -> new Builder(n, c.indexVersionCreated(), c.getIndexAnalyzers(), SourceFieldMapper.isSynthetic(c.getIndexSettings())) ); diff --git a/plugins/mapper-murmur3/src/main/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapper.java b/plugins/mapper-murmur3/src/main/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapper.java index 2440668ff57be..738fb7ab7c25e 100644 --- a/plugins/mapper-murmur3/src/main/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapper.java +++ b/plugins/mapper-murmur3/src/main/java/org/elasticsearch/index/mapper/murmur3/Murmur3FieldMapper.java @@ -63,7 +63,7 @@ public Murmur3FieldMapper build(MapperBuilderContext context) { } } - public static TypeParser PARSER = new TypeParser((n, c) -> new Builder(n)); + public static final TypeParser PARSER = new TypeParser((n, c) -> new Builder(n)); // this only exists so a check can be done to match the field type to using murmur3 hashing... public static class Murmur3FieldType extends MappedFieldType { diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java index b6ced06623306..bfdf41e58f6d3 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/create/CreateSnapshotRequest.java @@ -61,7 +61,7 @@ public class CreateSnapshotRequest extends MasterNodeRequest repositoryFailures; diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java index b7a513b3cb08e..03e05ca0e4247 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/snapshots/restore/RestoreSnapshotRequest.java @@ -54,7 +54,7 @@ public class RestoreSnapshotRequest extends MasterNodeRequest statsByRepository ) implements ToXContentObject, Writeable { - public static ClusterSnapshotStats EMPTY = new ClusterSnapshotStats(0, 0, 0, 0, List.of()); + public static final ClusterSnapshotStats EMPTY = new ClusterSnapshotStats(0, 0, 0, 0, List.of()); public static ClusterSnapshotStats of(ClusterState clusterState, long currentTimeMillis) { return of( diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java index 998217e93c426..45433c4cba107 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/ComposableIndexTemplate.java @@ -427,7 +427,7 @@ public DataStreamTemplate(boolean hidden, boolean allowCustomRouting) { /** * A mapping snippet for a backing index with `_data_stream_timestamp` meta field mapper properly configured. */ - public static CompressedXContent DATA_STREAM_MAPPING_SNIPPET; + public static final CompressedXContent DATA_STREAM_MAPPING_SNIPPET; static { try { diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java index c1b015dc3700b..286ecb3113337 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/DataStream.java @@ -82,7 +82,7 @@ public static boolean isFailureStoreFeatureFlagEnabled() { public static final DateFormatter DATE_FORMATTER = DateFormatter.forPattern("uuuu.MM.dd"); public static final String TIMESTAMP_FIELD_NAME = "@timestamp"; // Timeseries indices' leaf readers should be sorted by desc order of their timestamp field, as it allows search time optimizations - public static Comparator TIMESERIES_LEAF_READERS_SORTER = Comparator.comparingLong((LeafReader r) -> { + public static final Comparator TIMESERIES_LEAF_READERS_SORTER = Comparator.comparingLong((LeafReader r) -> { try { PointValues points = r.getPointValues(TIMESTAMP_FIELD_NAME); if (points != null) { diff --git a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java index f8545c6cf1686..c50f51fb99df6 100644 --- a/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java +++ b/server/src/main/java/org/elasticsearch/cluster/metadata/Metadata.java @@ -116,25 +116,25 @@ public enum XContentContext { /** * Indicates that this custom metadata will be returned as part of an API call but will not be persisted */ - public static EnumSet API_ONLY = EnumSet.of(XContentContext.API); + public static final EnumSet API_ONLY = EnumSet.of(XContentContext.API); /** * Indicates that this custom metadata will be returned as part of an API call and will be persisted between * node restarts, but will not be a part of a snapshot global state */ - public static EnumSet API_AND_GATEWAY = EnumSet.of(XContentContext.API, XContentContext.GATEWAY); + public static final EnumSet API_AND_GATEWAY = EnumSet.of(XContentContext.API, XContentContext.GATEWAY); /** * Indicates that this custom metadata will be returned as part of an API call and stored as a part of * a snapshot global state, but will not be persisted between node restarts */ - public static EnumSet API_AND_SNAPSHOT = EnumSet.of(XContentContext.API, XContentContext.SNAPSHOT); + public static final EnumSet API_AND_SNAPSHOT = EnumSet.of(XContentContext.API, XContentContext.SNAPSHOT); /** * Indicates that this custom metadata will be returned as part of an API call, stored as a part of * a snapshot global state, and will be persisted between node restarts */ - public static EnumSet ALL_CONTEXTS = EnumSet.allOf(XContentContext.class); + public static final EnumSet ALL_CONTEXTS = EnumSet.allOf(XContentContext.class); /** * Custom metadata that persists (via XContent) across restarts. The deserialization method for each implementation must be registered diff --git a/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodeRole.java b/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodeRole.java index 19f920fbe3c8a..e28786d8c8818 100644 --- a/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodeRole.java +++ b/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNodeRole.java @@ -153,7 +153,7 @@ public boolean isEnabledByDefault(Settings settings) { /** * Represents the role for a content node. */ - public static DiscoveryNodeRole DATA_CONTENT_NODE_ROLE = new DiscoveryNodeRole("data_content", "s", true) { + public static final DiscoveryNodeRole DATA_CONTENT_NODE_ROLE = new DiscoveryNodeRole("data_content", "s", true) { @Override public boolean isEnabledByDefault(final Settings settings) { @@ -164,7 +164,7 @@ public boolean isEnabledByDefault(final Settings settings) { /** * Represents the role for a hot node. */ - public static DiscoveryNodeRole DATA_HOT_NODE_ROLE = new DiscoveryNodeRole("data_hot", "h", true) { + public static final DiscoveryNodeRole DATA_HOT_NODE_ROLE = new DiscoveryNodeRole("data_hot", "h", true) { @Override public boolean isEnabledByDefault(final Settings settings) { @@ -175,7 +175,7 @@ public boolean isEnabledByDefault(final Settings settings) { /** * Represents the role for a warm node. */ - public static DiscoveryNodeRole DATA_WARM_NODE_ROLE = new DiscoveryNodeRole("data_warm", "w", true) { + public static final DiscoveryNodeRole DATA_WARM_NODE_ROLE = new DiscoveryNodeRole("data_warm", "w", true) { @Override public boolean isEnabledByDefault(final Settings settings) { @@ -186,7 +186,7 @@ public boolean isEnabledByDefault(final Settings settings) { /** * Represents the role for a cold node. */ - public static DiscoveryNodeRole DATA_COLD_NODE_ROLE = new DiscoveryNodeRole("data_cold", "c", true) { + public static final DiscoveryNodeRole DATA_COLD_NODE_ROLE = new DiscoveryNodeRole("data_cold", "c", true) { @Override public boolean isEnabledByDefault(final Settings settings) { @@ -197,7 +197,7 @@ public boolean isEnabledByDefault(final Settings settings) { /** * Represents the role for a frozen node. */ - public static DiscoveryNodeRole DATA_FROZEN_NODE_ROLE = new DiscoveryNodeRole("data_frozen", "f", true) { + public static final DiscoveryNodeRole DATA_FROZEN_NODE_ROLE = new DiscoveryNodeRole("data_frozen", "f", true) { @Override public boolean isEnabledByDefault(final Settings settings) { diff --git a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/ClusterBalanceStats.java b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/ClusterBalanceStats.java index 410531b3fdf07..b1eb08255dccb 100644 --- a/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/ClusterBalanceStats.java +++ b/server/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/ClusterBalanceStats.java @@ -39,7 +39,7 @@ public record ClusterBalanceStats( Map nodes ) implements Writeable, ToXContentObject { - public static ClusterBalanceStats EMPTY = new ClusterBalanceStats(0, 0, Map.of(), Map.of()); + public static final ClusterBalanceStats EMPTY = new ClusterBalanceStats(0, 0, Map.of(), Map.of()); public static ClusterBalanceStats createFrom( ClusterState clusterState, diff --git a/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java b/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java index 01ee60a29b341..75b33a7e20f59 100644 --- a/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java +++ b/server/src/main/java/org/elasticsearch/cluster/service/ClusterStateUpdateStats.java @@ -140,7 +140,7 @@ public void writeTo(StreamOutput out) throws IOException { out.writeVLong(failedNotificationElapsedMillis); } - public static ClusterStateUpdateStats EMPTY = new ClusterStateUpdateStats( + public static final ClusterStateUpdateStats EMPTY = new ClusterStateUpdateStats( 0L, 0L, 0L, diff --git a/server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java b/server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java index c85df7c6be908..ef5b318a8b426 100644 --- a/server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java +++ b/server/src/main/java/org/elasticsearch/common/logging/DeprecationLogger.java @@ -39,7 +39,7 @@ public class DeprecationLogger { * Deprecation messages are logged at this level. * More serious that WARN by 1, but less serious than ERROR */ - public static Level CRITICAL = Level.forName("CRITICAL", Level.WARN.intLevel() - 1); + public static final Level CRITICAL = Level.forName("CRITICAL", Level.WARN.intLevel() - 1); private static volatile List skipTheseDeprecations = Collections.emptyList(); private final Logger logger; diff --git a/server/src/main/java/org/elasticsearch/common/settings/SettingsFilter.java b/server/src/main/java/org/elasticsearch/common/settings/SettingsFilter.java index 7b4f82c1072c6..376333cf7cdf7 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/SettingsFilter.java +++ b/server/src/main/java/org/elasticsearch/common/settings/SettingsFilter.java @@ -27,7 +27,7 @@ public final class SettingsFilter { /** * Can be used to specify settings filter that will be used to filter out matching settings in toXContent method */ - public static String SETTINGS_FILTER_PARAM = "settings_filter"; + public static final String SETTINGS_FILTER_PARAM = "settings_filter"; private final Set patterns; private final String patternString; diff --git a/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java b/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java index 9120576815bac..b45b348376fdf 100644 --- a/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java +++ b/server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java @@ -510,14 +510,14 @@ public void rejectedExecution(Runnable task, ThreadPoolExecutor executor) { public static class TaskTrackingConfig { // This is a random starting point alpha. TODO: revisit this with actual testing and/or make it configurable - public static double DEFAULT_EWMA_ALPHA = 0.3; + public static final double DEFAULT_EWMA_ALPHA = 0.3; private final boolean trackExecutionTime; private final boolean trackOngoingTasks; private final double ewmaAlpha; - public static TaskTrackingConfig DO_NOT_TRACK = new TaskTrackingConfig(false, false, DEFAULT_EWMA_ALPHA); - public static TaskTrackingConfig DEFAULT = new TaskTrackingConfig(true, false, DEFAULT_EWMA_ALPHA); + public static final TaskTrackingConfig DO_NOT_TRACK = new TaskTrackingConfig(false, false, DEFAULT_EWMA_ALPHA); + public static final TaskTrackingConfig DEFAULT = new TaskTrackingConfig(true, false, DEFAULT_EWMA_ALPHA); public TaskTrackingConfig(boolean trackOngoingTasks, double ewmaAlpha) { this(true, trackOngoingTasks, ewmaAlpha); diff --git a/server/src/main/java/org/elasticsearch/env/DefaultBuildVersion.java b/server/src/main/java/org/elasticsearch/env/DefaultBuildVersion.java index 70aa3f6639a4d..913a352debfb8 100644 --- a/server/src/main/java/org/elasticsearch/env/DefaultBuildVersion.java +++ b/server/src/main/java/org/elasticsearch/env/DefaultBuildVersion.java @@ -30,7 +30,7 @@ */ final class DefaultBuildVersion extends BuildVersion { - public static BuildVersion CURRENT = new DefaultBuildVersion(Version.CURRENT.id()); + public static final BuildVersion CURRENT = new DefaultBuildVersion(Version.CURRENT.id()); final Version version; diff --git a/server/src/main/java/org/elasticsearch/index/Index.java b/server/src/main/java/org/elasticsearch/index/Index.java index b6aa8cf19a7e2..d587d8ef2feef 100644 --- a/server/src/main/java/org/elasticsearch/index/Index.java +++ b/server/src/main/java/org/elasticsearch/index/Index.java @@ -30,7 +30,7 @@ public class Index implements Writeable, ToXContentObject { public static final Index[] EMPTY_ARRAY = new Index[0]; - public static Comparator COMPARE_BY_NAME = Comparator.comparing(Index::getName); + public static final Comparator COMPARE_BY_NAME = Comparator.comparing(Index::getName); private static final String INDEX_UUID_KEY = "index_uuid"; private static final String INDEX_NAME_KEY = "index_name"; diff --git a/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java index 0824e5381ff65..4ebcbbf8a068b 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/GeoPointFieldMapper.java @@ -228,7 +228,7 @@ public FieldMapper build(MapperBuilderContext context) { } - public static TypeParser PARSER = createTypeParserWithLegacySupport( + public static final TypeParser PARSER = createTypeParserWithLegacySupport( (n, c) -> new Builder( n, c.scriptCompiler(), diff --git a/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java index e970789225059..fb9448978e3d6 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/KeywordFieldMapper.java @@ -104,7 +104,7 @@ public static class Defaults { FIELD_TYPE = freezeAndDeduplicateFieldType(ft); } - public static TextSearchInfo TEXT_SEARCH_INFO = new TextSearchInfo( + public static final TextSearchInfo TEXT_SEARCH_INFO = new TextSearchInfo( FIELD_TYPE, null, Lucene.KEYWORD_ANALYZER, diff --git a/server/src/main/java/org/elasticsearch/index/mapper/MapperMetrics.java b/server/src/main/java/org/elasticsearch/index/mapper/MapperMetrics.java index fa87dd449dba8..d107957179d6e 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/MapperMetrics.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/MapperMetrics.java @@ -14,5 +14,5 @@ * Main purpose of this class is to avoid verbosity of passing individual metric instances around. */ public record MapperMetrics(SourceFieldMetrics sourceFieldMetrics) { - public static MapperMetrics NOOP = new MapperMetrics(SourceFieldMetrics.NOOP); + public static final MapperMetrics NOOP = new MapperMetrics(SourceFieldMetrics.NOOP); } diff --git a/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesRoutingHashFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesRoutingHashFieldMapper.java index 6336ed831b78d..e155249b9c38c 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesRoutingHashFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/TimeSeriesRoutingHashFieldMapper.java @@ -49,7 +49,7 @@ public class TimeSeriesRoutingHashFieldMapper extends MetadataFieldMapper { public static final TypeParser PARSER = new FixedTypeParser(c -> c.getIndexSettings().getMode().timeSeriesRoutingHashFieldMapper()); static final NodeFeature TS_ROUTING_HASH_FIELD_PARSES_BYTES_REF = new NodeFeature("tsdb.ts_routing_hash_doc_value_parse_byte_ref"); - public static DocValueFormat TS_ROUTING_HASH_DOC_VALUE_FORMAT = TimeSeriesRoutingHashFieldType.DOC_VALUE_FORMAT; + public static final DocValueFormat TS_ROUTING_HASH_DOC_VALUE_FORMAT = TimeSeriesRoutingHashFieldType.DOC_VALUE_FORMAT; static final class TimeSeriesRoutingHashFieldType extends MappedFieldType { diff --git a/server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java b/server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java index 8c6e874ff577f..3584523505aea 100644 --- a/server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java +++ b/server/src/main/java/org/elasticsearch/index/mapper/vectors/DenseVectorFieldMapper.java @@ -119,10 +119,11 @@ public static boolean isNotUnitVector(float magnitude) { public static final IndexVersion LITTLE_ENDIAN_FLOAT_STORED_INDEX_VERSION = IndexVersions.V_8_9_0; public static final String CONTENT_TYPE = "dense_vector"; - public static short MAX_DIMS_COUNT = 4096; // maximum allowed number of dimensions - public static int MAX_DIMS_COUNT_BIT = 4096 * Byte.SIZE; // maximum allowed number of dimensions + public static final short MAX_DIMS_COUNT = 4096; // maximum allowed number of dimensions + public static final int MAX_DIMS_COUNT_BIT = 4096 * Byte.SIZE; // maximum allowed number of dimensions - public static short MIN_DIMS_FOR_DYNAMIC_FLOAT_MAPPING = 128; // minimum number of dims for floats to be dynamically mapped to vector + public static final short MIN_DIMS_FOR_DYNAMIC_FLOAT_MAPPING = 128; // minimum number of dims for floats to be dynamically mapped to + // vector public static final int MAGNITUDE_BYTES = 4; public static final int NUM_CANDS_OVERSAMPLE_LIMIT = 10_000; // Max oversample allowed for k and num_candidates diff --git a/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java b/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java index b63cf232eca9b..458ff598737fa 100644 --- a/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java +++ b/server/src/main/java/org/elasticsearch/index/query/SpanNearQueryBuilder.java @@ -41,9 +41,9 @@ public class SpanNearQueryBuilder extends AbstractQueryBuilder FIELDS_SET = new HashSet<>(); + public static final Set FIELDS_SET = new HashSet<>(); static { FIELDS_SET.add(SLICE_ID_FIELD); FIELDS_SET.add(TOTAL_FIELD); @@ -774,7 +774,7 @@ public static class StatusOrException implements Writeable, ToXContentObject { private final Status status; private final Exception exception; - public static Set EXPECTED_EXCEPTION_FIELDS = new HashSet<>(); + public static final Set EXPECTED_EXCEPTION_FIELDS = new HashSet<>(); static { EXPECTED_EXCEPTION_FIELDS.add("type"); EXPECTED_EXCEPTION_FIELDS.add("reason"); diff --git a/server/src/main/java/org/elasticsearch/index/seqno/GlobalCheckpointSyncAction.java b/server/src/main/java/org/elasticsearch/index/seqno/GlobalCheckpointSyncAction.java index 5707abc220d3f..54904323a25ad 100644 --- a/server/src/main/java/org/elasticsearch/index/seqno/GlobalCheckpointSyncAction.java +++ b/server/src/main/java/org/elasticsearch/index/seqno/GlobalCheckpointSyncAction.java @@ -39,8 +39,8 @@ public class GlobalCheckpointSyncAction extends TransportReplicationAction< GlobalCheckpointSyncAction.Request, ReplicationResponse> { - public static String ACTION_NAME = "indices:admin/seq_no/global_checkpoint_sync"; - public static ActionType TYPE = new ActionType<>(ACTION_NAME); + public static final String ACTION_NAME = "indices:admin/seq_no/global_checkpoint_sync"; + public static final ActionType TYPE = new ActionType<>(ACTION_NAME); @Inject public GlobalCheckpointSyncAction( diff --git a/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeases.java b/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeases.java index b6b6e709f4f17..76b8d814ee8f3 100644 --- a/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeases.java +++ b/server/src/main/java/org/elasticsearch/index/seqno/RetentionLeases.java @@ -118,7 +118,7 @@ public RetentionLease get(final String id) { * Represents an empty an un-versioned retention lease collection. This is used when no retention lease collection is found in the * commit point */ - public static RetentionLeases EMPTY = new RetentionLeases(1, 0, Collections.emptyList()); + public static final RetentionLeases EMPTY = new RetentionLeases(1, 0, Collections.emptyList()); /** * Constructs a new retention lease collection with the specified version and underlying collection of retention leases. diff --git a/server/src/main/java/org/elasticsearch/index/translog/Translog.java b/server/src/main/java/org/elasticsearch/index/translog/Translog.java index 75f38ed5f7342..dd13f905b6cb8 100644 --- a/server/src/main/java/org/elasticsearch/index/translog/Translog.java +++ b/server/src/main/java/org/elasticsearch/index/translog/Translog.java @@ -971,7 +971,7 @@ public TranslogDeletionPolicy getDeletionPolicy() { public record Location(long generation, long translogLocation, int size) implements Comparable { - public static Location EMPTY = new Location(0, 0, 0); + public static final Location EMPTY = new Location(0, 0, 0); @Override public String toString() { diff --git a/server/src/main/java/org/elasticsearch/indices/ExecutorNames.java b/server/src/main/java/org/elasticsearch/indices/ExecutorNames.java index e1bf11227592c..2bfc642111d87 100644 --- a/server/src/main/java/org/elasticsearch/indices/ExecutorNames.java +++ b/server/src/main/java/org/elasticsearch/indices/ExecutorNames.java @@ -20,7 +20,7 @@ public record ExecutorNames(String threadPoolForGet, String threadPoolForSearch, /** * The thread pools for a typical system index. */ - public static ExecutorNames DEFAULT_SYSTEM_INDEX_THREAD_POOLS = new ExecutorNames( + public static final ExecutorNames DEFAULT_SYSTEM_INDEX_THREAD_POOLS = new ExecutorNames( ThreadPool.Names.SYSTEM_READ, ThreadPool.Names.SYSTEM_READ, ThreadPool.Names.SYSTEM_WRITE @@ -29,7 +29,7 @@ public record ExecutorNames(String threadPoolForGet, String threadPoolForSearch, /** * The thread pools for a typical system data stream. These are also the usual thread pools for non-system indices and data streams. */ - public static ExecutorNames DEFAULT_SYSTEM_DATA_STREAM_THREAD_POOLS = new ExecutorNames( + public static final ExecutorNames DEFAULT_SYSTEM_DATA_STREAM_THREAD_POOLS = new ExecutorNames( ThreadPool.Names.GET, ThreadPool.Names.SEARCH, ThreadPool.Names.WRITE @@ -38,7 +38,7 @@ public record ExecutorNames(String threadPoolForGet, String threadPoolForSearch, /** * The thread pools that should be used for critical system index operations. */ - public static ExecutorNames CRITICAL_SYSTEM_INDEX_THREAD_POOLS = new ExecutorNames( + public static final ExecutorNames CRITICAL_SYSTEM_INDEX_THREAD_POOLS = new ExecutorNames( ThreadPool.Names.SYSTEM_CRITICAL_READ, ThreadPool.Names.SYSTEM_CRITICAL_READ, ThreadPool.Names.SYSTEM_CRITICAL_WRITE diff --git a/server/src/main/java/org/elasticsearch/inference/EmptyTaskSettings.java b/server/src/main/java/org/elasticsearch/inference/EmptyTaskSettings.java index cba0282f7fed8..5b3ee08d205d5 100644 --- a/server/src/main/java/org/elasticsearch/inference/EmptyTaskSettings.java +++ b/server/src/main/java/org/elasticsearch/inference/EmptyTaskSettings.java @@ -24,7 +24,7 @@ public record EmptyTaskSettings() implements TaskSettings { public static final String NAME = "empty_task_settings"; - public static EmptyTaskSettings INSTANCE = new EmptyTaskSettings(); + public static final EmptyTaskSettings INSTANCE = new EmptyTaskSettings(); public EmptyTaskSettings(StreamInput in) { this(); diff --git a/server/src/main/java/org/elasticsearch/inference/TaskType.java b/server/src/main/java/org/elasticsearch/inference/TaskType.java index fcb8ea7213795..f319157828dfa 100644 --- a/server/src/main/java/org/elasticsearch/inference/TaskType.java +++ b/server/src/main/java/org/elasticsearch/inference/TaskType.java @@ -31,7 +31,7 @@ public boolean isAnyOrSame(TaskType other) { } }; - public static String NAME = "task_type"; + public static final String NAME = "task_type"; public static TaskType fromString(String name) { return valueOf(name.trim().toUpperCase(Locale.ROOT)); diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoriesMetrics.java b/server/src/main/java/org/elasticsearch/repositories/RepositoriesMetrics.java index 2cd6e2b11ef7a..a4185a12d7c3b 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoriesMetrics.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoriesMetrics.java @@ -33,7 +33,7 @@ public record RepositoriesMetrics( LongHistogram httpRequestTimeInMillisHistogram ) { - public static RepositoriesMetrics NOOP = new RepositoriesMetrics(MeterRegistry.NOOP); + public static final RepositoriesMetrics NOOP = new RepositoriesMetrics(MeterRegistry.NOOP); /** * Is incremented for each request sent to the blob store (including retries) diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java b/server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java index 1c4b7cfdab4ef..abff4d0725355 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoriesService.java @@ -955,7 +955,7 @@ public List> getPreRestoreVersionChecks() { return preRestoreChecks; } - public static String COUNT_USAGE_STATS_NAME = "count"; + public static final String COUNT_USAGE_STATS_NAME = "count"; public RepositoryUsageStats getUsageStats() { if (repositories.isEmpty()) { diff --git a/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java b/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java index 713f7eacb2c16..2ebbf24d65670 100644 --- a/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java +++ b/server/src/main/java/org/elasticsearch/repositories/RepositoryData.java @@ -1153,7 +1153,7 @@ private static String parseLegacySnapshotUUID(XContentParser parser) throws IOEx */ public static class SnapshotDetails { - public static SnapshotDetails EMPTY = new SnapshotDetails(null, null, -1, -1, null); + public static final SnapshotDetails EMPTY = new SnapshotDetails(null, null, -1, -1, null); @Nullable // TODO forbid nulls here, this only applies to very old repositories private final SnapshotState snapshotState; diff --git a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/CreateIndexCapabilities.java b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/CreateIndexCapabilities.java index 900a352d42f30..9083c781ae167 100644 --- a/server/src/main/java/org/elasticsearch/rest/action/admin/indices/CreateIndexCapabilities.java +++ b/server/src/main/java/org/elasticsearch/rest/action/admin/indices/CreateIndexCapabilities.java @@ -26,5 +26,5 @@ public class CreateIndexCapabilities { */ private static final String LOOKUP_INDEX_MODE_CAPABILITY = "lookup_index_mode"; - public static Set CAPABILITIES = Set.of(LOGSDB_INDEX_MODE_CAPABILITY, LOOKUP_INDEX_MODE_CAPABILITY); + public static final Set CAPABILITIES = Set.of(LOGSDB_INDEX_MODE_CAPABILITY, LOOKUP_INDEX_MODE_CAPABILITY); } diff --git a/server/src/main/java/org/elasticsearch/script/Metadata.java b/server/src/main/java/org/elasticsearch/script/Metadata.java index f6212de58df84..dc5ae51e45af0 100644 --- a/server/src/main/java/org/elasticsearch/script/Metadata.java +++ b/server/src/main/java/org/elasticsearch/script/Metadata.java @@ -51,7 +51,7 @@ public class Metadata { protected static final String IF_PRIMARY_TERM = "_if_primary_term"; protected static final String DYNAMIC_TEMPLATES = "_dynamic_templates"; - public static FieldProperty ObjectField = new FieldProperty<>(Object.class); + public static final FieldProperty ObjectField = new FieldProperty<>(Object.class); public static FieldProperty StringField = new FieldProperty<>(String.class); public static FieldProperty LongField = new FieldProperty<>(Number.class).withValidation(FieldProperty.LONGABLE_NUMBER); @@ -335,7 +335,7 @@ public FieldProperty withValidation(BiConsumer extendedValidation) return new FieldProperty<>(type, nullable, writable, extendedValidation); } - public static BiConsumer LONGABLE_NUMBER = (k, v) -> { + public static final BiConsumer LONGABLE_NUMBER = (k, v) -> { long version = v.longValue(); // did we round? if (v.doubleValue() == version) { @@ -346,7 +346,7 @@ public FieldProperty withValidation(BiConsumer extendedValidation) ); }; - public static FieldProperty ALLOW_ALL = new FieldProperty<>(null, true, true, null); + public static final FieldProperty ALLOW_ALL = new FieldProperty<>(null, true, true, null); @SuppressWarnings("fallthrough") public void check(MapOperation op, String key, Object value) { diff --git a/server/src/main/java/org/elasticsearch/script/ScriptedMetricAggContexts.java b/server/src/main/java/org/elasticsearch/script/ScriptedMetricAggContexts.java index 2e2ae4e73c6f0..79725eb9c3b87 100644 --- a/server/src/main/java/org/elasticsearch/script/ScriptedMetricAggContexts.java +++ b/server/src/main/java/org/elasticsearch/script/ScriptedMetricAggContexts.java @@ -170,8 +170,8 @@ public interface Factory extends ScriptFactory { CombineScript newInstance(Map params, Map state); } - public static String[] PARAMETERS = {}; - public static ScriptContext CONTEXT = new ScriptContext<>("aggs_combine", Factory.class); + public static final String[] PARAMETERS = {}; + public static final ScriptContext CONTEXT = new ScriptContext<>("aggs_combine", Factory.class); } public abstract static class ReduceScript { @@ -198,6 +198,6 @@ public interface Factory extends ScriptFactory { } public static String[] PARAMETERS = {}; - public static ScriptContext CONTEXT = new ScriptContext<>("aggs_reduce", Factory.class); + public static final ScriptContext CONTEXT = new ScriptContext<>("aggs_reduce", Factory.class); } } diff --git a/test/framework/src/main/java/org/elasticsearch/test/disruption/NetworkDisruption.java b/test/framework/src/main/java/org/elasticsearch/test/disruption/NetworkDisruption.java index 2558edea9c165..5e503d0fd8b5f 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/disruption/NetworkDisruption.java +++ b/test/framework/src/main/java/org/elasticsearch/test/disruption/NetworkDisruption.java @@ -451,8 +451,8 @@ public String toString() { */ public static class NetworkDelay extends NetworkLinkDisruptionType { - public static TimeValue DEFAULT_DELAY_MIN = TimeValue.timeValueSeconds(10); - public static TimeValue DEFAULT_DELAY_MAX = TimeValue.timeValueSeconds(90); + public static final TimeValue DEFAULT_DELAY_MIN = TimeValue.timeValueSeconds(10); + public static final TimeValue DEFAULT_DELAY_MAX = TimeValue.timeValueSeconds(90); private final TimeValue delay; diff --git a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/BlobCacheMetrics.java b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/BlobCacheMetrics.java index 0fb4267745cb8..218569c825258 100644 --- a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/BlobCacheMetrics.java +++ b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/BlobCacheMetrics.java @@ -96,7 +96,7 @@ public BlobCacheMetrics(MeterRegistry meterRegistry) { this.cachePopulationTime = cachePopulationTime; } - public static BlobCacheMetrics NOOP = new BlobCacheMetrics(TelemetryProvider.NOOP.getMeterRegistry()); + public static final BlobCacheMetrics NOOP = new BlobCacheMetrics(TelemetryProvider.NOOP.getMeterRegistry()); public LongCounter getCacheMissCounter() { return cacheMissCounter; diff --git a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBytes.java b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBytes.java index ad0d99104e8a4..7e1d732befe34 100644 --- a/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBytes.java +++ b/x-pack/plugin/blob-cache/src/main/java/org/elasticsearch/blobcache/shared/SharedBytes.java @@ -44,7 +44,7 @@ public class SharedBytes extends AbstractRefCounted { ); private static final Logger logger = LogManager.getLogger(SharedBytes.class); - public static int PAGE_SIZE = 4096; + public static final int PAGE_SIZE = 4096; private static final String CACHE_FILE_NAME = "shared_snapshot_cache"; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/ExpandedIdsMatcher.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/ExpandedIdsMatcher.java index 2e0a799ea99a5..ac071fab1d69a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/ExpandedIdsMatcher.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/action/util/ExpandedIdsMatcher.java @@ -34,8 +34,6 @@ */ public final class ExpandedIdsMatcher { - public static String ALL = "_all"; - /** * Split {@code expression} into tokens separated by a ',' * diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobModelSnapshotsUpgradeStatsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobModelSnapshotsUpgradeStatsAction.java index ec49603c89cb8..a6df290be67bd 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobModelSnapshotsUpgradeStatsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/action/GetJobModelSnapshotsUpgradeStatsAction.java @@ -46,7 +46,6 @@ public class GetJobModelSnapshotsUpgradeStatsAction extends ActionType, ToXConten // Used for QueryPage public static final ParseField RESULTS_FIELD = new ParseField("datafeeds"); - public static String TYPE = "datafeed"; + public static final String TYPE = "datafeed"; /** * The field name used to specify document counts in Elasticsearch diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AllocationStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AllocationStatus.java index 9216fc89a810d..d27e64752d7d8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AllocationStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AllocationStatus.java @@ -42,9 +42,9 @@ public String toString() { } } - public static ParseField ALLOCATION_COUNT = new ParseField("allocation_count"); - public static ParseField TARGET_ALLOCATION_COUNT = new ParseField("target_allocation_count"); - public static ParseField STATE = new ParseField("state"); + public static final ParseField ALLOCATION_COUNT = new ParseField("allocation_count"); + public static final ParseField TARGET_ALLOCATION_COUNT = new ParseField("target_allocation_count"); + public static final ParseField STATE = new ParseField("state"); private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "allocation_health", diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedNlpInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedNlpInferenceResults.java index 9c1316d4d094f..177b9f61c0fd4 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedNlpInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ChunkedNlpInferenceResults.java @@ -13,8 +13,8 @@ public abstract class ChunkedNlpInferenceResults extends NlpInferenceResults { - public static String TEXT = "text"; - public static String INFERENCE = "inference"; + public static final String TEXT = "text"; + public static final String INFERENCE = "inference"; ChunkedNlpInferenceResults(boolean isTruncated) { super(isTruncated); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java index 12921166b1489..3881625c05aba 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/results/ClassificationInferenceResults.java @@ -22,7 +22,7 @@ import java.util.stream.Collectors; public class ClassificationInferenceResults extends SingleValueInferenceResults { - public static String PREDICTION_PROBABILITY = "prediction_probability"; + public static final String PREDICTION_PROBABILITY = "prediction_probability"; public static final String NAME = "classification"; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationUpdate.java index a833048c76a55..7f4f63dee718a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertJapaneseTokenizationUpdate.java @@ -21,7 +21,7 @@ public class BertJapaneseTokenizationUpdate extends AbstractTokenizationUpdate { public static final ParseField NAME = BertJapaneseTokenization.NAME; - public static ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "bert_japanese_tokenization_update", a -> new BertJapaneseTokenizationUpdate(a[0] == null ? null : Tokenization.Truncate.fromString((String) a[0]), (Integer) a[1]) ); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationUpdate.java index 3bda6f0070f03..065acdfd50307 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/BertTokenizationUpdate.java @@ -21,7 +21,7 @@ public class BertTokenizationUpdate extends AbstractTokenizationUpdate { public static final ParseField NAME = BertTokenization.NAME; - public static ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "bert_tokenization_update", a -> new BertTokenizationUpdate(a[0] == null ? null : Tokenization.Truncate.fromString((String) a[0]), (Integer) a[1]) ); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java index 6985769f08cb6..b04b49e645bcb 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfig.java @@ -29,7 +29,7 @@ public class ClassificationConfig implements LenientlyParsedInferenceConfig, Str public static final ParseField PREDICTION_FIELD_TYPE = new ParseField("prediction_field_type"); private static final MlConfigVersion MIN_SUPPORTED_VERSION = MlConfigVersion.V_7_6_0; - public static ClassificationConfig EMPTY_PARAMS = new ClassificationConfig( + public static final ClassificationConfig EMPTY_PARAMS = new ClassificationConfig( 0, DEFAULT_RESULTS_FIELD, DEFAULT_TOP_CLASSES_RESULTS_FIELD, diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdate.java index 1cf1c0ddeb570..9ee97029541f1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ClassificationConfigUpdate.java @@ -32,7 +32,7 @@ public class ClassificationConfigUpdate implements InferenceConfigUpdate, NamedX public static final ParseField NAME = ClassificationConfig.NAME; - public static ClassificationConfigUpdate EMPTY_PARAMS = new ClassificationConfigUpdate(null, null, null, null, null); + public static final ClassificationConfigUpdate EMPTY_PARAMS = new ClassificationConfigUpdate(null, null, null, null, null); private final Integer numTopClasses; private final String topClassesResultsField; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/DebertaV2TokenizationUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/DebertaV2TokenizationUpdate.java index 683b27793402d..8f9743231ba60 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/DebertaV2TokenizationUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/DebertaV2TokenizationUpdate.java @@ -20,7 +20,7 @@ public class DebertaV2TokenizationUpdate extends AbstractTokenizationUpdate { public static final ParseField NAME = new ParseField(DebertaV2Tokenization.NAME); - public static ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "deberta_v2_tokenization_update", a -> new DebertaV2TokenizationUpdate(a[0] == null ? null : Tokenization.Truncate.fromString((String) a[0]), (Integer) a[1]) ); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/LearningToRankConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/LearningToRankConfig.java index a4d7c9c7fa08f..31ebcdf2d1e60 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/LearningToRankConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/LearningToRankConfig.java @@ -45,7 +45,7 @@ public class LearningToRankConfig extends RegressionConfig implements Rewriteabl public static final ParseField FEATURE_EXTRACTORS = new ParseField("feature_extractors"); public static final ParseField DEFAULT_PARAMS = new ParseField("default_params"); - public static LearningToRankConfig EMPTY_PARAMS = new LearningToRankConfig(null, null, null); + public static final LearningToRankConfig EMPTY_PARAMS = new LearningToRankConfig(null, null, null); private static final ObjectParser LENIENT_PARSER = createParser(true); private static final ObjectParser STRICT_PARSER = createParser(false); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java index 403a747d6801f..13c63b9cc7ba0 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfig.java @@ -25,7 +25,7 @@ public class RegressionConfig implements LenientlyParsedInferenceConfig, Strictl private static final MlConfigVersion MIN_SUPPORTED_VERSION = MlConfigVersion.V_7_6_0; public static final ParseField NUM_TOP_FEATURE_IMPORTANCE_VALUES = new ParseField("num_top_feature_importance_values"); - public static RegressionConfig EMPTY_PARAMS = new RegressionConfig(DEFAULT_RESULTS_FIELD, null); + public static final RegressionConfig EMPTY_PARAMS = new RegressionConfig(DEFAULT_RESULTS_FIELD, null); private static final ObjectParser LENIENT_PARSER = createParser(true); private static final ObjectParser STRICT_PARSER = createParser(false); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java index ceebe3105eb63..c7b66ef95943e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RegressionConfigUpdate.java @@ -29,7 +29,7 @@ public class RegressionConfigUpdate implements InferenceConfigUpdate, NamedXCont public static final ParseField NAME = RegressionConfig.NAME; - public static RegressionConfigUpdate EMPTY_PARAMS = new RegressionConfigUpdate(null, null); + public static final RegressionConfigUpdate EMPTY_PARAMS = new RegressionConfigUpdate(null, null); public static RegressionConfigUpdate fromMap(Map map) { Map options = new HashMap<>(map); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RobertaTokenizationUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RobertaTokenizationUpdate.java index 3763a2350dadc..90e55e8b8ba37 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RobertaTokenizationUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/RobertaTokenizationUpdate.java @@ -20,7 +20,7 @@ public class RobertaTokenizationUpdate extends AbstractTokenizationUpdate { public static final ParseField NAME = new ParseField(RobertaTokenization.NAME); - public static ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "roberta_tokenization_update", a -> new RobertaTokenizationUpdate(a[0] == null ? null : Tokenization.Truncate.fromString((String) a[0]), (Integer) a[1]) ); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java index 57493c7d34d72..6be122c0ccfa1 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfig.java @@ -29,7 +29,7 @@ public class TextEmbeddingConfig implements NlpConfig { public static final String NAME = "text_embedding"; - public static ParseField EMBEDDING_SIZE = new ParseField("embedding_size"); + public static final ParseField EMBEDDING_SIZE = new ParseField("embedding_size"); public static TextEmbeddingConfig fromXContentStrict(XContentParser parser) { return STRICT_PARSER.apply(parser, null); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java index e89281a59f7d2..67b54b3642860 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/TextEmbeddingConfigUpdate.java @@ -29,7 +29,7 @@ public class TextEmbeddingConfigUpdate extends NlpConfigUpdate implements NamedX public static final String NAME = TextEmbeddingConfig.NAME; - public static TextEmbeddingConfigUpdate EMPTY_INSTANCE = new TextEmbeddingConfigUpdate(null, null); + public static final TextEmbeddingConfigUpdate EMPTY_INSTANCE = new TextEmbeddingConfigUpdate(null, null); public static TextEmbeddingConfigUpdate fromMap(Map map) { Map options = new HashMap<>(map); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationUpdate.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationUpdate.java index 5ddfdff4a5a41..58df6a8454a43 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationUpdate.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/XLMRobertaTokenizationUpdate.java @@ -20,7 +20,7 @@ public class XLMRobertaTokenizationUpdate extends AbstractTokenizationUpdate { public static final ParseField NAME = new ParseField(XLMRobertaTokenization.NAME); - public static ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "xlm_roberta_tokenization_update", a -> new XLMRobertaTokenizationUpdate(a[0] == null ? null : Tokenization.Truncate.fromString((String) a[0]), (Integer) a[1]) ); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ltr/QueryExtractorBuilder.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ltr/QueryExtractorBuilder.java index d9e90b92382e3..4fb79c5b2919b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ltr/QueryExtractorBuilder.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/trainedmodel/ltr/QueryExtractorBuilder.java @@ -34,7 +34,7 @@ public record QueryExtractorBuilder(String featureName, QueryProvider query, flo public static final ParseField QUERY = new ParseField("query"); public static final ParseField DEFAULT_SCORE = new ParseField("default_score"); - public static float DEFAULT_SCORE_DEFAULT = 0f; + public static final float DEFAULT_SCORE_DEFAULT = 0f; private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( NAME.getPreferredName(), diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshot.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshot.java index 3114c03879eb7..66ce4a135e50f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshot.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/job/process/autodetect/state/ModelSnapshot.java @@ -94,7 +94,7 @@ private static ObjectParser createParser(boolean ignoreUnknownFie return parser; } - public static String EMPTY_SNAPSHOT_ID = "empty"; + public static final String EMPTY_SNAPSHOT_ID = "empty"; private final String jobId; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/SubmitAsyncSearchRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/SubmitAsyncSearchRequest.java index 4b9700a37ad71..e68a1d73a14d8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/SubmitAsyncSearchRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/search/action/SubmitAsyncSearchRequest.java @@ -29,7 +29,7 @@ * @see AsyncSearchResponse */ public class SubmitAsyncSearchRequest extends ActionRequest { - public static long MIN_KEEP_ALIVE = TimeValue.timeValueSeconds(1).millis(); + public static final long MIN_KEEP_ALIVE = TimeValue.timeValueSeconds(1).millis(); private TimeValue waitForCompletionTimeout = TimeValue.timeValueSeconds(1); private boolean keepOnCompletion = false; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java index c2f40a3e393b9..13c65c457d96b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java @@ -1198,7 +1198,7 @@ public static boolean isFileOrNativeRealm(String realmType) { return FileRealmSettings.TYPE.equals(realmType) || NativeRealmSettings.TYPE.equals(realmType); } - public static ConstructingObjectParser REALM_REF_PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser REALM_REF_PARSER = new ConstructingObjectParser<>( "realm_ref", false, (args, v) -> new RealmRef((String) args[0], (String) args[1], (String) args[2], (RealmDomain) args[3]) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/AuthenticationResult.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/AuthenticationResult.java index 5d144931a906d..30d76da35370c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/AuthenticationResult.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/AuthenticationResult.java @@ -26,7 +26,7 @@ public final class AuthenticationResult { private static final AuthenticationResult NOT_HANDLED = new AuthenticationResult<>(Status.CONTINUE, null, null, null, null); - public static String THREAD_CONTEXT_KEY = "_xpack_security_auth_result"; + public static final String THREAD_CONTEXT_KEY = "_xpack_security_auth_result"; public enum Status { /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/RealmConfig.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/RealmConfig.java index c2c64b45941cd..0e1080ba9fe69 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/RealmConfig.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/RealmConfig.java @@ -261,7 +261,7 @@ public int compareTo(RealmIdentifier other) { } } - public static ConstructingObjectParser REALM_IDENTIFIER_PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser REALM_IDENTIFIER_PARSER = new ConstructingObjectParser<>( "realm_identifier", false, (args, v) -> new RealmIdentifier((String) args[0], (String) args[1]) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/RealmDomain.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/RealmDomain.java index 573023739db11..c458a3ba3981a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/RealmDomain.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/RealmDomain.java @@ -59,7 +59,7 @@ public String toString() { } @SuppressWarnings("unchecked") - public static ConstructingObjectParser REALM_DOMAIN_PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser REALM_DOMAIN_PARSER = new ConstructingObjectParser<>( "realm_domain", false, (args, v) -> new RealmDomain((String) args[0], Set.copyOf((List) args[1])) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorsIntersection.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorsIntersection.java index 38aa1bc106e99..4d98767444f4b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorsIntersection.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptorsIntersection.java @@ -24,7 +24,7 @@ public record RoleDescriptorsIntersection(Collection> roleDescriptorsList) implements ToXContentObject, Writeable { - public static RoleDescriptorsIntersection EMPTY = new RoleDescriptorsIntersection(Collections.emptyList()); + public static final RoleDescriptorsIntersection EMPTY = new RoleDescriptorsIntersection(Collections.emptyList()); private static final RoleDescriptor.Parser ROLE_DESCRIPTOR_PARSER = RoleDescriptor.parserBuilder() .allowRestriction(true) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/SystemPrivilege.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/SystemPrivilege.java index 9233841891461..68baab4469e48 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/SystemPrivilege.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/privilege/SystemPrivilege.java @@ -20,7 +20,7 @@ public final class SystemPrivilege extends Privilege { - public static SystemPrivilege INSTANCE = new SystemPrivilege(); + public static final SystemPrivilege INSTANCE = new SystemPrivilege(); private static final Predicate ALLOWED_ACTIONS = StringMatcher.of( "internal:*", diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/Automatons.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/Automatons.java index d3790ea64ba4b..a1dfc3ce9676a 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/Automatons.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/Automatons.java @@ -76,7 +76,7 @@ public final class Automatons { static final char WILDCARD_ESCAPE = '\\'; // Escape character // for testing only -Dtests.jvm.argline="-Dtests.automaton.record.patterns=true" - public static boolean recordPatterns = System.getProperty("tests.automaton.record.patterns", "false").equals("true"); + public static final boolean recordPatterns = System.getProperty("tests.automaton.record.patterns", "false").equals("true"); private static final Map> patternsMap = new HashMap<>(); private Automatons() {} diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/NoOpLogger.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/NoOpLogger.java index af1a2726b4f55..8844fec09cf53 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/NoOpLogger.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/support/NoOpLogger.java @@ -20,7 +20,7 @@ */ public class NoOpLogger implements Logger { - public static NoOpLogger INSTANCE = new NoOpLogger(); + public static final NoOpLogger INSTANCE = new NoOpLogger(); private NoOpLogger() { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumRequest.java index 95edd3fc3bb92..1c787389602a8 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/termsenum/action/TermsEnumRequest.java @@ -33,8 +33,8 @@ public final class TermsEnumRequest extends BroadcastRequest implements ToXContentObject { public static final IndicesOptions DEFAULT_INDICES_OPTIONS = SearchRequest.DEFAULT_INDICES_OPTIONS; - public static int DEFAULT_SIZE = 10; - public static TimeValue DEFAULT_TIMEOUT = new TimeValue(1000); + public static final int DEFAULT_SIZE = 10; + public static final TimeValue DEFAULT_TIMEOUT = new TimeValue(1000); private String field; private String string = null; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformField.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformField.java index 204b81914816a..9dde79883f257 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformField.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/TransformField.java @@ -99,7 +99,7 @@ public final class TransformField { public static final String EXCLUDE_GENERATED = "exclude_generated"; // internal document id - public static String DOCUMENT_ID_FIELD = "_id"; + public static final String DOCUMENT_ID_FIELD = "_id"; private TransformField() {} } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpoint.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpoint.java index fea6299c73e62..e4d8f8790c42d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpoint.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformCheckpoint.java @@ -46,8 +46,8 @@ */ public class TransformCheckpoint implements Writeable, ToXContentObject { - public static String EMPTY_NAME = "_empty"; - public static TransformCheckpoint EMPTY = createEmpty(0); + public static final String EMPTY_NAME = "_empty"; + public static final TransformCheckpoint EMPTY = createEmpty(0); public static TransformCheckpoint createEmpty(long timestampMillis) { return new TransformCheckpoint(EMPTY_NAME, timestampMillis, -1L, Collections.emptyMap(), timestampMillis); diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStats.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStats.java index 7cf84ac3ecea8..f638f7b92cd59 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStats.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/transform/transforms/TransformIndexerStats.java @@ -24,23 +24,23 @@ public class TransformIndexerStats extends IndexerJobStats { public static final String NAME = "data_frame_indexer_transform_stats"; - public static ParseField NUM_PAGES = new ParseField("pages_processed"); - public static ParseField NUM_INPUT_DOCUMENTS = new ParseField("documents_processed"); - public static ParseField NUM_OUTPUT_DOCUMENTS = new ParseField("documents_indexed"); - public static ParseField NUM_DELETED_DOCUMENTS = new ParseField("documents_deleted"); - public static ParseField NUM_INVOCATIONS = new ParseField("trigger_count"); - public static ParseField INDEX_TIME_IN_MS = new ParseField("index_time_in_ms"); - public static ParseField SEARCH_TIME_IN_MS = new ParseField("search_time_in_ms"); - public static ParseField PROCESSING_TIME_IN_MS = new ParseField("processing_time_in_ms"); - public static ParseField DELETE_TIME_IN_MS = new ParseField("delete_time_in_ms"); - public static ParseField INDEX_TOTAL = new ParseField("index_total"); - public static ParseField SEARCH_TOTAL = new ParseField("search_total"); - public static ParseField PROCESSING_TOTAL = new ParseField("processing_total"); - public static ParseField SEARCH_FAILURES = new ParseField("search_failures"); - public static ParseField INDEX_FAILURES = new ParseField("index_failures"); - public static ParseField EXPONENTIAL_AVG_CHECKPOINT_DURATION_MS = new ParseField("exponential_avg_checkpoint_duration_ms"); - public static ParseField EXPONENTIAL_AVG_DOCUMENTS_INDEXED = new ParseField("exponential_avg_documents_indexed"); - public static ParseField EXPONENTIAL_AVG_DOCUMENTS_PROCESSED = new ParseField("exponential_avg_documents_processed"); + public static final ParseField NUM_PAGES = new ParseField("pages_processed"); + public static final ParseField NUM_INPUT_DOCUMENTS = new ParseField("documents_processed"); + public static final ParseField NUM_OUTPUT_DOCUMENTS = new ParseField("documents_indexed"); + public static final ParseField NUM_DELETED_DOCUMENTS = new ParseField("documents_deleted"); + public static final ParseField NUM_INVOCATIONS = new ParseField("trigger_count"); + public static final ParseField INDEX_TIME_IN_MS = new ParseField("index_time_in_ms"); + public static final ParseField SEARCH_TIME_IN_MS = new ParseField("search_time_in_ms"); + public static final ParseField PROCESSING_TIME_IN_MS = new ParseField("processing_time_in_ms"); + public static final ParseField DELETE_TIME_IN_MS = new ParseField("delete_time_in_ms"); + public static final ParseField INDEX_TOTAL = new ParseField("index_total"); + public static final ParseField SEARCH_TOTAL = new ParseField("search_total"); + public static final ParseField PROCESSING_TOTAL = new ParseField("processing_total"); + public static final ParseField SEARCH_FAILURES = new ParseField("search_failures"); + public static final ParseField INDEX_FAILURES = new ParseField("index_failures"); + public static final ParseField EXPONENTIAL_AVG_CHECKPOINT_DURATION_MS = new ParseField("exponential_avg_checkpoint_duration_ms"); + public static final ParseField EXPONENTIAL_AVG_DOCUMENTS_INDEXED = new ParseField("exponential_avg_documents_indexed"); + public static final ParseField EXPONENTIAL_AVG_DOCUMENTS_PROCESSED = new ParseField("exponential_avg_documents_processed"); // This changes how much "weight" past calculations have. // The shorter the window, the less "smoothing" will occur. diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/DeleteAnalyticsCollectionAction.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/DeleteAnalyticsCollectionAction.java index 0001e59aedd94..f6fd758882930 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/DeleteAnalyticsCollectionAction.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/DeleteAnalyticsCollectionAction.java @@ -34,7 +34,7 @@ private DeleteAnalyticsCollectionAction() {/* no instances */} public static class Request extends MasterNodeRequest implements ToXContentObject { private final String collectionName; - public static ParseField COLLECTION_NAME_FIELD = new ParseField("collection_name"); + public static final ParseField COLLECTION_NAME_FIELD = new ParseField("collection_name"); public Request(StreamInput in) throws IOException { super(in); diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/GetAnalyticsCollectionAction.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/GetAnalyticsCollectionAction.java index dd1e341a8d900..833fc64f03f85 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/GetAnalyticsCollectionAction.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/GetAnalyticsCollectionAction.java @@ -35,7 +35,7 @@ private GetAnalyticsCollectionAction() {/* no instances */} public static class Request extends MasterNodeReadRequest implements ToXContentObject { private final String[] names; - public static ParseField NAMES_FIELD = new ParseField("names"); + public static final ParseField NAMES_FIELD = new ParseField("names"); public Request(TimeValue masterNodeTimeout, String[] names) { super(masterNodeTimeout); diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/PostAnalyticsEventAction.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/PostAnalyticsEventAction.java index 7e5d05e9e222e..7d93c33208e5c 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/PostAnalyticsEventAction.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/action/PostAnalyticsEventAction.java @@ -311,7 +311,7 @@ public RequestBuilder clientAddress(String clientAddress) { } public static class Response extends ActionResponse implements ToXContentObject { - public static Response ACCEPTED = new Response(true); + public static final Response ACCEPTED = new Response(true); public static Response readFromStreamInput(StreamInput in) throws IOException { boolean accepted = in.readBoolean(); diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/DocumentAnalyticsEventField.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/DocumentAnalyticsEventField.java index bf73be9a5ddd7..1cab0d1911975 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/DocumentAnalyticsEventField.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/DocumentAnalyticsEventField.java @@ -20,11 +20,11 @@ public class DocumentAnalyticsEventField { - public static ParseField DOCUMENT_FIELD = new ParseField("document"); + public static final ParseField DOCUMENT_FIELD = new ParseField("document"); - public static ParseField DOCUMENT_ID_FIELD = new ParseField("id"); + public static final ParseField DOCUMENT_ID_FIELD = new ParseField("id"); - public static ParseField DOCUMENT_INDEX_FIELD = new ParseField("index"); + public static final ParseField DOCUMENT_INDEX_FIELD = new ParseField("index"); private static final ObjectParser, AnalyticsEvent.Context> PARSER = new ObjectParser<>( DOCUMENT_FIELD.getPreferredName(), diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/PageAnalyticsEventField.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/PageAnalyticsEventField.java index e450d89eead3b..b2436be319190 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/PageAnalyticsEventField.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/PageAnalyticsEventField.java @@ -17,13 +17,13 @@ import java.util.Map; public class PageAnalyticsEventField { - public static ParseField PAGE_FIELD = new ParseField("page"); + public static final ParseField PAGE_FIELD = new ParseField("page"); - public static ParseField PAGE_URL_FIELD = new ParseField("url"); + public static final ParseField PAGE_URL_FIELD = new ParseField("url"); - public static ParseField PAGE_TITLE_FIELD = new ParseField("title"); + public static final ParseField PAGE_TITLE_FIELD = new ParseField("title"); - public static ParseField PAGE_REFERRER_FIELD = new ParseField("referrer"); + public static final ParseField PAGE_REFERRER_FIELD = new ParseField("referrer"); private static final ObjectParser, AnalyticsEvent.Context> PARSER = new ObjectParser<>( PAGE_FIELD.getPreferredName(), diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/PaginationAnalyticsEventField.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/PaginationAnalyticsEventField.java index 78dc75befa924..3dca22d94ad7b 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/PaginationAnalyticsEventField.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/PaginationAnalyticsEventField.java @@ -19,11 +19,11 @@ public class PaginationAnalyticsEventField { - public static ParseField PAGINATION_FIELD = new ParseField("page"); + public static final ParseField PAGINATION_FIELD = new ParseField("page"); - public static ParseField CURRENT_PAGE_FIELD = new ParseField("current"); + public static final ParseField CURRENT_PAGE_FIELD = new ParseField("current"); - public static ParseField PAGE_SIZE_FIELD = new ParseField("size"); + public static final ParseField PAGE_SIZE_FIELD = new ParseField("size"); private static final ObjectParser, AnalyticsEvent.Context> PARSER = new ObjectParser<>( PAGINATION_FIELD.getPreferredName(), diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchAnalyticsEventField.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchAnalyticsEventField.java index 27d63f4dd0a69..438fb20dcf0bf 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchAnalyticsEventField.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchAnalyticsEventField.java @@ -21,13 +21,13 @@ import static org.elasticsearch.xpack.application.analytics.event.parser.field.SortOrderAnalyticsEventField.SORT_FIELD; public class SearchAnalyticsEventField { - public static ParseField SEARCH_FIELD = new ParseField("search"); + public static final ParseField SEARCH_FIELD = new ParseField("search"); - public static ParseField SEARCH_QUERY_FIELD = new ParseField("query"); + public static final ParseField SEARCH_QUERY_FIELD = new ParseField("query"); - public static ParseField SEARCH_APPLICATION_FIELD = new ParseField("search_application"); + public static final ParseField SEARCH_APPLICATION_FIELD = new ParseField("search_application"); - public static ParseField SEARCH_RESULTS_FIELD = new ParseField("results"); + public static final ParseField SEARCH_RESULTS_FIELD = new ParseField("results"); private static final ObjectParser, AnalyticsEvent.Context> PARSER = new ObjectParser<>( SEARCH_FIELD.getPreferredName(), diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchFiltersAnalyticsEventField.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchFiltersAnalyticsEventField.java index dc4ef6f816b9b..261a6c623a7a5 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchFiltersAnalyticsEventField.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchFiltersAnalyticsEventField.java @@ -19,7 +19,7 @@ import java.util.Map; public class SearchFiltersAnalyticsEventField { - public static ParseField SEARCH_FILTERS_FIELD = new ParseField("filters"); + public static final ParseField SEARCH_FILTERS_FIELD = new ParseField("filters"); private static final ObjectParser>, AnalyticsEvent.Context> PARSER = new ObjectParser<>( SEARCH_FILTERS_FIELD.getPreferredName(), diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchResultAnalyticsEventField.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchResultAnalyticsEventField.java index a680a151142d7..e95e777bb88ec 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchResultAnalyticsEventField.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SearchResultAnalyticsEventField.java @@ -20,9 +20,9 @@ import static org.elasticsearch.xpack.application.analytics.event.parser.field.PageAnalyticsEventField.PAGE_FIELD; public class SearchResultAnalyticsEventField { - public static ParseField SEARCH_RESULTS_TOTAL_FIELD = new ParseField("total_results"); + public static final ParseField SEARCH_RESULTS_TOTAL_FIELD = new ParseField("total_results"); - public static ParseField SEARCH_RESULT_ITEMS_FIELD = new ParseField("items"); + public static final ParseField SEARCH_RESULT_ITEMS_FIELD = new ParseField("items"); private static final ObjectParser, AnalyticsEvent.Context> PARSER = new ObjectParser<>( "search_results", diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SessionAnalyticsEventField.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SessionAnalyticsEventField.java index 406d59a7d081e..866984c62b75e 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SessionAnalyticsEventField.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SessionAnalyticsEventField.java @@ -21,9 +21,9 @@ import static org.elasticsearch.common.Strings.requireNonBlank; public class SessionAnalyticsEventField { - public static ParseField SESSION_FIELD = new ParseField("session"); + public static final ParseField SESSION_FIELD = new ParseField("session"); - public static ParseField SESSION_ID_FIELD = new ParseField("id"); + public static final ParseField SESSION_ID_FIELD = new ParseField("id"); public static final ParseField CLIENT_ADDRESS_FIELD = new ParseField("ip"); diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SortOrderAnalyticsEventField.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SortOrderAnalyticsEventField.java index 5b70bd8c91c2c..df591572a7672 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SortOrderAnalyticsEventField.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/SortOrderAnalyticsEventField.java @@ -20,11 +20,11 @@ public class SortOrderAnalyticsEventField { - public static ParseField SORT_FIELD = new ParseField("sort"); + public static final ParseField SORT_FIELD = new ParseField("sort"); - public static ParseField SORT_ORDER_NAME_FIELD = new ParseField("name"); + public static final ParseField SORT_ORDER_NAME_FIELD = new ParseField("name"); - public static ParseField SORT_ORDER_DIRECTION_FIELD = new ParseField("direction"); + public static final ParseField SORT_ORDER_DIRECTION_FIELD = new ParseField("direction"); private static final ObjectParser, AnalyticsEvent.Context> PARSER = new ObjectParser<>( SORT_FIELD.getPreferredName(), diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/UserAnalyticsEventField.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/UserAnalyticsEventField.java index dbcedde825725..186f581d4b6ff 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/UserAnalyticsEventField.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/analytics/event/parser/field/UserAnalyticsEventField.java @@ -20,9 +20,9 @@ import static org.elasticsearch.common.Strings.requireNonBlank; public class UserAnalyticsEventField { - public static ParseField USER_FIELD = new ParseField("user"); + public static final ParseField USER_FIELD = new ParseField("user"); - public static ParseField USER_ID_FIELD = new ParseField("id"); + public static final ParseField USER_ID_FIELD = new ParseField("id"); private static final ObjectParser, AnalyticsEvent.Context> PARSER = new ObjectParser<>( USER_FIELD.getPreferredName(), diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/action/DeleteSearchApplicationAction.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/action/DeleteSearchApplicationAction.java index 93ad2f46b5583..98ae7cdef770f 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/action/DeleteSearchApplicationAction.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/action/DeleteSearchApplicationAction.java @@ -35,7 +35,7 @@ private DeleteSearchApplicationAction() {/* no instances */} public static class Request extends ActionRequest implements ToXContentObject { private final String name; - public static ParseField NAME_FIELD = new ParseField("name"); + public static final ParseField NAME_FIELD = new ParseField("name"); public Request(StreamInput in) throws IOException { super(in); diff --git a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/action/PutSearchApplicationAction.java b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/action/PutSearchApplicationAction.java index 75bec0d61649f..ff829b6f53016 100644 --- a/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/action/PutSearchApplicationAction.java +++ b/x-pack/plugin/ent-search/src/main/java/org/elasticsearch/xpack/application/search/action/PutSearchApplicationAction.java @@ -101,8 +101,8 @@ public int hashCode() { return Objects.hash(searchApp, create); } - public static ParseField SEARCH_APPLICATION = new ParseField("searchApp"); - public static ParseField CREATE = new ParseField("create"); + public static final ParseField SEARCH_APPLICATION = new ParseField("searchApp"); + public static final ParseField CREATE = new ParseField("create"); @SuppressWarnings("unchecked") private static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java index 5804e11b72ff5..0b1d5005c5f89 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchRequest.java @@ -44,8 +44,8 @@ public class EqlSearchRequest extends ActionRequest implements IndicesRequest.Replaceable, ToXContent { - public static long MIN_KEEP_ALIVE = TimeValue.timeValueMinutes(1).millis(); - public static TimeValue DEFAULT_KEEP_ALIVE = TimeValue.timeValueDays(5); + public static final long MIN_KEEP_ALIVE = TimeValue.timeValueMinutes(1).millis(); + public static final TimeValue DEFAULT_KEEP_ALIVE = TimeValue.timeValueDays(5); public static final IndicesOptions DEFAULT_INDICES_OPTIONS = IndicesOptions.fromOptions(true, true, true, false); private String[] indices; diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java index a4d93b7659970..e068f652cd289 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/EqlSearchResponse.java @@ -238,7 +238,7 @@ public String toString() { // Event public static class Event implements Writeable, ToXContentObject { - public static Event MISSING_EVENT = new Event("", "", new BytesArray("{}".getBytes(StandardCharsets.UTF_8)), null, true); + public static final Event MISSING_EVENT = new Event("", "", new BytesArray("{}".getBytes(StandardCharsets.UTF_8)), null, true); private static final class Fields { static final String INDEX = GetResult._INDEX; diff --git a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/RequestDefaults.java b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/RequestDefaults.java index 58bfb9513add5..e920067def8c9 100644 --- a/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/RequestDefaults.java +++ b/x-pack/plugin/eql/src/main/java/org/elasticsearch/xpack/eql/action/RequestDefaults.java @@ -14,8 +14,8 @@ private RequestDefaults() {} public static final String FIELD_TIMESTAMP = "@timestamp"; public static final String FIELD_EVENT_CATEGORY = "event.category"; - public static int SIZE = 10; - public static int FETCH_SIZE = 1000; - public static boolean CCS_MINIMIZE_ROUNDTRIPS = true; - public static int MAX_SAMPLES_PER_KEY = 1; + public static final int SIZE = 10; + public static final int FETCH_SIZE = 1000; + public static final boolean CCS_MINIMIZE_ROUNDTRIPS = true; + public static final int MAX_SAMPLES_PER_KEY = 1; } diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockProvider.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockProvider.java index 340a5a65f0969..817079fd54cf4 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockProvider.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/amazonbedrock/AmazonBedrockProvider.java @@ -17,7 +17,7 @@ public enum AmazonBedrockProvider { META, MISTRAL; - public static String NAME = "amazon_bedrock_provider"; + public static final String NAME = "amazon_bedrock_provider"; public static AmazonBedrockProvider fromString(String name) { return valueOf(name.trim().toUpperCase(Locale.ROOT)); diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioEndpointType.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioEndpointType.java index ece63f4bbf0cd..8639ba5b3aeda 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioEndpointType.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioEndpointType.java @@ -13,7 +13,7 @@ public enum AzureAiStudioEndpointType { TOKEN, REALTIME; - public static String NAME = "azure_ai_studio_endpoint_type"; + public static final String NAME = "azure_ai_studio_endpoint_type"; public static AzureAiStudioEndpointType fromString(String name) { return valueOf(name.trim().toUpperCase(Locale.ROOT)); diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioProvider.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioProvider.java index 6b3efca0888f3..55f3f557797dd 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioProvider.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/azureaistudio/AzureAiStudioProvider.java @@ -17,7 +17,7 @@ public enum AzureAiStudioProvider { COHERE, DATABRICKS; - public static String NAME = "azure_ai_studio_provider"; + public static final String NAME = "azure_ai_studio_provider"; public static AzureAiStudioProvider fromString(String name) { return valueOf(name.trim().toUpperCase(Locale.ROOT)); diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElserMlNodeTaskSettings.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElserMlNodeTaskSettings.java index 3bcaa57827fdb..264d694703d89 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElserMlNodeTaskSettings.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElserMlNodeTaskSettings.java @@ -22,7 +22,7 @@ public class ElserMlNodeTaskSettings implements TaskSettings { public static final String NAME = "elser_mlnode_task_settings"; - public static ElserMlNodeTaskSettings DEFAULT = new ElserMlNodeTaskSettings(); + public static final ElserMlNodeTaskSettings DEFAULT = new ElserMlNodeTaskSettings(); public ElserMlNodeTaskSettings() {} diff --git a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElserModels.java b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElserModels.java index 37f528ea3a750..c1764b93bfc82 100644 --- a/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElserModels.java +++ b/x-pack/plugin/inference/src/main/java/org/elasticsearch/xpack/inference/services/elasticsearch/ElserModels.java @@ -16,7 +16,7 @@ public class ElserModels { public static final String ELSER_V2_MODEL = ".elser_model_2"; public static final String ELSER_V2_MODEL_LINUX_X86 = ".elser_model_2_linux-x86_64"; - public static Set VALID_ELSER_MODEL_IDS = Set.of( + public static final Set VALID_ELSER_MODEL_IDS = Set.of( ElserModels.ELSER_V1_MODEL, ElserModels.ELSER_V2_MODEL, ElserModels.ELSER_V2_MODEL_LINUX_X86 diff --git a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/chunking/WordBoundaryChunkerTests.java b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/chunking/WordBoundaryChunkerTests.java index b4fa5c9122258..a4228d50eae4b 100644 --- a/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/chunking/WordBoundaryChunkerTests.java +++ b/x-pack/plugin/inference/src/test/java/org/elasticsearch/xpack/inference/chunking/WordBoundaryChunkerTests.java @@ -56,7 +56,7 @@ public class WordBoundaryChunkerTests extends ESTestCase { + " خليفہ المومنين يا خليفہ المسلمين يا صحابی يا رضي الله عنه چئي۔ (ب) آنحضور ﷺ جي گھروارين کان علاوه ڪنھن کي ام المومنين " + "چئي۔ (ج) آنحضور ﷺ جي خاندان جي اھل بيت کان علاوہڍه ڪنھن کي اھل بيت چئي۔ (د) پنھنجي عبادت گاھ کي مسجد چئي۔" }; - public static int NUM_WORDS_IN_TEST_TEXT; + public static final int NUM_WORDS_IN_TEST_TEXT; static { var wordIterator = BreakIterator.getWordInstance(Locale.ROOT); wordIterator.setText(TEST_TEXT); diff --git a/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java b/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java index 6bf2917c601ac..0bdb5fc0101a5 100644 --- a/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java +++ b/x-pack/plugin/mapper-version/src/main/java/org/elasticsearch/xpack/versionfield/VersionStringFieldMapper.java @@ -403,7 +403,7 @@ public Iterator iterator() { return concat; } - public static DocValueFormat VERSION_DOCVALUE = new DocValueFormat() { + public static final DocValueFormat VERSION_DOCVALUE = new DocValueFormat() { @Override public String getWriteableName() { diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfo.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfo.java index 587e7e3815c2d..8dca78cafda47 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfo.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/modelsize/ModelSizeInfo.java @@ -30,7 +30,7 @@ public class ModelSizeInfo implements Accountable, ToXContentObject { private static final ParseField TRAINED_MODEL_SIZE = new ParseField("trained_model_size"); @SuppressWarnings("unchecked") - public static ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "model_size", false, a -> new ModelSizeInfo((EnsembleSizeInfo) a[0], (List) a[1]) diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java index 0bfc64c9b0027..72fc96683b721 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/nlp/Vocabulary.java @@ -47,7 +47,7 @@ public static ConstructingObjectParser createParser(boolean ig return parser; } - public static ConstructingObjectParser PARSER = createParser(true); + public static final ConstructingObjectParser PARSER = createParser(true); private final List vocab; private final List merges; diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/AckResult.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/AckResult.java index 06f2679c56c2d..5626270c1c6d3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/AckResult.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/AckResult.java @@ -18,7 +18,7 @@ public record AckResult(boolean acknowledged) implements ToXContentObject { public static final ParseField ACKNOWLEDGED = new ParseField("acknowledged"); - public static ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "ack", a -> new AckResult((Boolean) a[0]) ); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/ErrorResult.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/ErrorResult.java index 68fc5cc589231..d5fd64c74c54e 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/ErrorResult.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/ErrorResult.java @@ -18,7 +18,7 @@ public record ErrorResult(String error) implements ToXContentObject { public static final ParseField ERROR = new ParseField("error"); - public static ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "error", a -> new ErrorResult((String) a[0]) ); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/PyTorchResult.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/PyTorchResult.java index 11340d0bf542d..3db738e72766b 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/PyTorchResult.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/PyTorchResult.java @@ -36,7 +36,7 @@ public record PyTorchResult( private static final ParseField THREAD_SETTINGS = new ParseField("thread_settings"); private static final ParseField ACK = new ParseField("ack"); - public static ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "pytorch_result", a -> new PyTorchResult( (String) a[0], diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/ThreadSettings.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/ThreadSettings.java index 9154d33c04574..af8818d540ebd 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/ThreadSettings.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/pytorch/results/ThreadSettings.java @@ -19,7 +19,7 @@ public record ThreadSettings(int numThreadsPerAllocation, int numAllocations) im private static final ParseField NUM_ALLOCATIONS = new ParseField("num_allocations"); private static final ParseField NUM_THREADS_PER_ALLOCATION = new ParseField("num_threads_per_allocation"); - public static ConstructingObjectParser PARSER = new ConstructingObjectParser<>( + public static final ConstructingObjectParser PARSER = new ConstructingObjectParser<>( "thread_settings", a -> new ThreadSettings((int) a[0], (int) a[1]) ); diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/MlClassicTokenizer.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/MlClassicTokenizer.java index 89533255528f2..c5e3754564ee3 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/MlClassicTokenizer.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/MlClassicTokenizer.java @@ -15,7 +15,7 @@ */ public class MlClassicTokenizer extends AbstractMlTokenizer { - public static String NAME = "ml_classic"; + public static final String NAME = "ml_classic"; MlClassicTokenizer() {} diff --git a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/MlStandardTokenizer.java b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/MlStandardTokenizer.java index ebb1b646a4c54..a3fb05efb17c4 100644 --- a/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/MlStandardTokenizer.java +++ b/x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/job/categorization/MlStandardTokenizer.java @@ -18,7 +18,7 @@ */ public class MlStandardTokenizer extends AbstractMlTokenizer { - public static String NAME = "ml_standard"; + public static final String NAME = "ml_standard"; private int putBackChar = -1; diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/mr/InternalItemSetMapReduceAggregationTests.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/mr/InternalItemSetMapReduceAggregationTests.java index 85219b0e62c6c..eb05d84c2140d 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/mr/InternalItemSetMapReduceAggregationTests.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/aggs/frequentitemsets/mr/InternalItemSetMapReduceAggregationTests.java @@ -84,8 +84,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws public void close() throws IOException {} } - public static String MAP_REDUCER_NAME = "word-count-test-aggregation"; - public static String AGG_NAME = "internal-map-reduce-aggregation-test"; + public static final String MAP_REDUCER_NAME = "word-count-test-aggregation"; + public static final String AGG_NAME = "internal-map-reduce-aggregation-test"; WordCountMapReducer() { super(AGG_NAME, MAP_REDUCER_NAME); diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/XLMRobertaTestVocab.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/XLMRobertaTestVocab.java index b0cce14c59114..3e47f0bc6cd06 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/XLMRobertaTestVocab.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/nlp/tokenizers/XLMRobertaTestVocab.java @@ -41,7 +41,7 @@ public static Vocabulary loadMultiLingualTestVocab() throws IOException { } @SuppressWarnings("checkstyle:linelength") - public static String[] MULTILINUGAL_TEXTS = new String[] { + public static final String[] MULTILINUGAL_TEXTS = new String[] { "Građevne strukture Mesa Verde dokaz su akumuliranog znanja i vještina koje su se stoljećima prenosile generacijama civilizacije Anasazi. Vrhunce svojih dosega ostvarili su u 12. i 13. stoljeću, kada su sagrađene danas najpoznatije građevine na liticama. Zidali su obrađenim pješčenjakom, tvrđim kamenom oblikovanim do veličine štruce kruha. Kao žbuku između ciglā stavljali su glinu razmočenu vodom. Tim su materijalom gradili prostorije veličine do 6 četvornih metara. U potkrovljima su skladištili žitarice i druge plodine, dok su kive - ceremonijalne prostorije - gradili ispred soba, ali ukopane u zemlju, nešto poput današnjih podruma. Kiva je bila vrhunski dizajnirana prostorija okruglog oblika s prostorom za vatru zimi te s dovodom hladnog zraka za klimatizaciju ljeti. U zidane konstrukcije stavljali su i lokalno posječena stabla, što današnjim arheolozima pomaže u preciznom datiranju nastanka pojedine građevine metodom dendrokronologije. Ta stabla pridonose i teoriji o mogućem konačnom slomu ondašnjeg društva. Nakon što su, tijekom nekoliko stoljeća, šume do kraja srušene, a njihova obnova zbog sušne klime traje i po 200 godina, nije proteklo puno vremena do konačnog urušavanja civilizacije, koja se, na svojem vrhuncu osjećala nepobjedivom. 90 % sagrađenih naseobina ispod stijena ima do deset prostorija. ⅓ od ukupnog broja sagrađenih kuća ima jednu ili dvije kamene prostorije", "Histoarysk wie in acre in stik lân dat 40 roeden (oftewol 1 furlong of ⅛ myl of 660 foet) lang wie, en 4 roeden (of 66 foet) breed. Men is fan tinken dat dat likernôch de grûnmjitte wie dy't men mei in jok oksen yn ien dei beploegje koe.", "創業当初の「太平洋化学工業社」から1959年太平洋化学工業株式会社へ、1987年には太平洋化学㈱に社名を変更。 1990年以降、海外拠点を増やし本格的な国際進出を始動。 創業者がつくりあげた化粧品会社を世界企業へと成長させるべく2002年3月英文社名AMOREPACIFICに改めた。", @@ -53,7 +53,7 @@ public static Vocabulary loadMultiLingualTestVocab() throws IOException { "(2) اگر زلیخا کو ملامت کرنے والی عورتیں آپ ﷺ کی جبین انور دیکھ پاتیں تو ہاتھوں کے بجائے اپنے دل کاٹنے کو ترجیح دیتیں۔صحیح بخاری میں ہے، حضرت عطاء بن یسار ؓہُنے حضرت عبداللہ بن عمرو ؓسے سیّدِ عالمﷺ کے وہ اوصاف دریافت کئے جو توریت میں مذکور ہیں تو انہوں نے فرمایا : ’’خدا کی قسم! حضور سیدُ المرسلینﷺ کے جو اوصاف قرآنِ کریم میں آئے ہیں انہیں میں سے بعض اوصاف توریت میں مذکور ہیں۔ اس کے بعد انہوں نے پڑھنا شروع کیا: اے نبی! ہم نے تمہیں شاہد و مُبَشِّر اور نذیر اور اُمِّیُّوں کا نگہبان بنا کر بھیجا، تم میرے بندے اور میرے رسول ہو، میں نے تمہارا نام متوکل رکھا،نہ بدخلق ہو نہ سخت مزاج، نہ بازاروں میں آواز بلند کرنے والے ہو نہ برائی سے برائی کو دفع کرنے والے بلکہ خطا کاروں کو معاف کرتے ہو اور ان پر احسان فرماتے ہو، اللہ تعالیٰ تمہیں نہ اٹھائے گا جب تک کہ تمہاری برکت سے غیر مستقیم ملت کو اس طرح راست نہ فرمادے کہ لوگ صدق و یقین کے ساتھ ’’ لَآاِلٰہَ اِلَّا اللہُ مُحَمَّدٌ رَّسُوْلُ اللہِ‘‘ پکارنے لگیں اور تمہاری بدولت اندھی آنکھیں بینا اور بہرے کان شنوا (سننے والے) اور پردوں میں لپٹے ہوئے دل کشادہ ہوجائیں۔ اور کعب احبارؓسے سرکارِ رسالت ﷺکی صفات میں توریت شریف کا یہ مضمون بھی منقول ہے کہ’’ اللہ تعالیٰ نے آپ ﷺکی صفت میں فرمایا کہ’’ میں اُنہیں ہر خوبی کے قابل کروں گا، اور ہر خُلقِ کریم عطا فرماؤں گا، اطمینانِ قلب اور وقار کو اُن کا لباس بناؤں گا اور طاعات وا حسان کو ان کا شعار کروں گا۔ تقویٰ کو ان کا ضمیر، حکمت کو ان کا راز، صدق و وفا کو اُن کی طبیعت ،عفوو کرم کو اُن کی عادت ، عدل کو ان کی سیرت، اظہارِ حق کو اُن کی شریعت، ہدایت کو اُن کا امام اور اسلام کو اُن کی ملت بناؤں گا۔ احمد اُن کا نام ہے، مخلوق کو اُن کے صدقے میں گمراہی کے بعد ہدایت اور جہالت کے بعد علم و معرفت اور گمنامی کے بعد رفعت و منزلت عطا کروں گا۔ اُنہیں کی برکت سے قلت کے بعد کثرت اور فقر کے بعد دولت اور تَفَرُّقے کے بعد محبت عنایت کروں گا، اُنہیں کی بدولت مختلف قبائل، غیر مجتمع خواہشوں اور اختلاف رکھنے والے دلوں میں اُلفت پیدا کروں گا اور اُن کی اُمت کو تمام اُمتوں سے بہتر کروں گا۔ ایک اور حدیث میں توریت سے حضور سید المرسلینﷺسے یہ اوصاف منقول ہیں ’’میرے بندے احمد مختار، ان کی جائے ولادت مکہ مکرمہ اور جائے ہجرت مدینہ طیبہ ہے،اُن کی اُمت ہر حال میں اللہ تعالٰی کی کثیر حمد کرنے والی ہے۔ مُنَزَّہٌ عَنْ شَرِیْکٍ فِیْ مَحَاسِنِہٖ", "بالآخر آنحضرتﷺ کے اس عفو وکرم نے یہ معجزہ دکھایا کہ سہیل حنین کی واپسی کے وقت آپ کے ساتھ ہوگئے اورمقام جعرانہ پہنچ کر خلعتِ اسلام سے سرفراز ہوئے آنحضرت ﷺ نے ازراہ مرحمت حنین کے مالِ غنیمت میں سے سو اونٹ عطا فرمائے، گو فتح مکہ کے بعد کے مسلمانوں کا شمار مؤلفۃ القلوب میں ہے، لیکن سہیل اس زمرہ میں اس حیثیت سے ممتاز ہیں کہ اسلام کے بعد ان سے کوئی بات اسلام کے خلاف ظہور پزیر نہیں ہوئی ،حافظ ابن حجرعسقلانی لکھتے ہیں، کان محمودالا سلام من حین اسلم۔", }; - public static int[][] EXPECTED_TOKENS = new int[][] { + public static final int[][] EXPECTED_TOKENS = new int[][] { { 0, 910, diff --git a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java index fb24c1ad2b883..f280171c046d7 100644 --- a/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java +++ b/x-pack/plugin/monitoring/src/main/java/org/elasticsearch/xpack/monitoring/exporter/Exporter.java @@ -28,7 +28,7 @@ public abstract class Exporter implements AutoCloseable { - public static Setting.AffixSettingDependency TYPE_DEPENDENCY = () -> Exporter.TYPE_SETTING; + public static final Setting.AffixSettingDependency TYPE_DEPENDENCY = () -> Exporter.TYPE_SETTING; private static final Setting.AffixSetting ENABLED_SETTING = Setting.affixKeySetting( "xpack.monitoring.exporters.", diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/gen/processor/ConstantProcessor.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/gen/processor/ConstantProcessor.java index cf87d01b87a50..3d5f63db23c5d 100644 --- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/gen/processor/ConstantProcessor.java +++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/expression/gen/processor/ConstantProcessor.java @@ -19,7 +19,7 @@ public class ConstantProcessor implements Processor { - public static String NAME = "c"; + public static final String NAME = "c"; private Object constant; private final Type type; diff --git a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/IndexResolver.java b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/IndexResolver.java index 318f3888ac9b3..7a85bf4c7349b 100644 --- a/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/IndexResolver.java +++ b/x-pack/plugin/ql/src/main/java/org/elasticsearch/xpack/ql/index/IndexResolver.java @@ -1037,7 +1037,7 @@ public interface ExistingFieldInvalidCallback extends BiConsumer { + public static final ExistingFieldInvalidCallback PRESERVE_PROPERTIES = (oldField, newField) -> { var oldProps = oldField.getProperties(); if (oldProps.size() > 0) { newField.getProperties().putAll(oldProps); diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/LdapMetadataResolver.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/LdapMetadataResolver.java index 229b517be5292..43615f3eb605d 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/LdapMetadataResolver.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ldap/support/LdapMetadataResolver.java @@ -109,7 +109,7 @@ private static Attribute findAttribute(Collection attributes, String public static class LdapMetadataResult { - public static LdapMetadataResult EMPTY = new LdapMetadataResult(null, null, Map.of()); + public static final LdapMetadataResult EMPTY = new LdapMetadataResult(null, null, Map.of()); private final String fullName; private final String email; diff --git a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/integrity/RepositoryVerifyIntegrityTask.java b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/integrity/RepositoryVerifyIntegrityTask.java index eaae913fe9c6f..dd3193cd1d047 100644 --- a/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/integrity/RepositoryVerifyIntegrityTask.java +++ b/x-pack/plugin/snapshot-repo-test-kit/src/main/java/org/elasticsearch/repositories/blobstore/testkit/integrity/RepositoryVerifyIntegrityTask.java @@ -59,7 +59,7 @@ public record Status( long throttledNanos ) implements org.elasticsearch.tasks.Task.Status { - public static String NAME = "verify_repository_integrity_status"; + public static final String NAME = "verify_repository_integrity_status"; public Status(StreamInput in) throws IOException { this( diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/CartesianShapeValues.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/CartesianShapeValues.java index f9481bb8169ea..4621929e8c62c 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/CartesianShapeValues.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/CartesianShapeValues.java @@ -27,7 +27,7 @@ */ public abstract class CartesianShapeValues extends ShapeValues { - public static CartesianShapeValues EMPTY = new CartesianShapeValues() { + public static final CartesianShapeValues EMPTY = new CartesianShapeValues() { private final CartesianShapeValuesSourceType DEFAULT_VALUES_SOURCE_TYPE = CartesianShapeValuesSourceType.instance(); @Override diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/GeoShapeValues.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/GeoShapeValues.java index c5193d5412ec2..d7099c904085f 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/GeoShapeValues.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/fielddata/GeoShapeValues.java @@ -28,7 +28,7 @@ */ public abstract class GeoShapeValues extends ShapeValues { - public static GeoShapeValues EMPTY = new GeoShapeValues() { + public static final GeoShapeValues EMPTY = new GeoShapeValues() { private final GeoShapeValuesSourceType DEFAULT_VALUES_SOURCE_TYPE = GeoShapeValuesSourceType.instance(); @Override diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapper.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapper.java index 50221d838e05a..44e68c2ebea74 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapper.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/PointFieldMapper.java @@ -121,7 +121,7 @@ public FieldMapper build(MapperBuilderContext context) { } - public static TypeParser PARSER = new TypeParser((n, c) -> new Builder(n, IGNORE_MALFORMED_SETTING.get(c.getSettings()))); + public static final TypeParser PARSER = new TypeParser((n, c) -> new Builder(n, IGNORE_MALFORMED_SETTING.get(c.getSettings()))); private final Builder builder; diff --git a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapper.java b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapper.java index 2d586ac8eb86a..f1140093f2368 100644 --- a/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapper.java +++ b/x-pack/plugin/spatial/src/main/java/org/elasticsearch/xpack/spatial/index/mapper/ShapeFieldMapper.java @@ -126,7 +126,7 @@ public ShapeFieldMapper build(MapperBuilderContext context) { } } - public static TypeParser PARSER = new TypeParser( + public static final TypeParser PARSER = new TypeParser( (n, c) -> new Builder( n, c.indexVersionCreated(), diff --git a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfiguration.java b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfiguration.java index e12661122f3ac..298ee54b89e9a 100644 --- a/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfiguration.java +++ b/x-pack/plugin/sql/jdbc/src/main/java/org/elasticsearch/xpack/sql/jdbc/JdbcConfiguration.java @@ -40,7 +40,7 @@ public class JdbcConfiguration extends ConnectionConfiguration { static final String URL_PREFIX = "jdbc:es://"; static final String URL_FULL_PREFIX = "jdbc:elasticsearch://"; - public static URI DEFAULT_URI = URI.create("http://localhost:9200/"); + public static final URI DEFAULT_URI = URI.create("http://localhost:9200/"); static final String DEBUG = "debug"; static final String DEBUG_DEFAULT = "false"; diff --git a/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilder.java b/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilder.java index 3d6324bc44557..9886d3b2637d9 100644 --- a/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilder.java +++ b/x-pack/plugin/sql/sql-cli/src/main/java/org/elasticsearch/xpack/sql/cli/ConnectionBuilder.java @@ -24,8 +24,8 @@ * Connection Builder. Can interactively ask users for the password if it is not provided */ public class ConnectionBuilder { - public static String DEFAULT_CONNECTION_STRING = "http://localhost:9200/"; - public static URI DEFAULT_URI = URI.create(DEFAULT_CONNECTION_STRING); + public static final String DEFAULT_CONNECTION_STRING = "http://localhost:9200/"; + public static final URI DEFAULT_URI = URI.create(DEFAULT_CONNECTION_STRING); private CliTerminal cliTerminal; diff --git a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/grouping/Histogram.java b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/grouping/Histogram.java index 5f9cd8443d50b..092fa78f8a3e5 100644 --- a/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/grouping/Histogram.java +++ b/x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/function/grouping/Histogram.java @@ -31,9 +31,9 @@ public class Histogram extends GroupingFunction { private final Literal interval; private final ZoneId zoneId; - public static String YEAR_INTERVAL = DateHistogramInterval.YEAR.toString(); - public static String MONTH_INTERVAL = DateHistogramInterval.MONTH.toString(); - public static String DAY_INTERVAL = DateHistogramInterval.DAY.toString(); + public static final String YEAR_INTERVAL = DateHistogramInterval.YEAR.toString(); + public static final String MONTH_INTERVAL = DateHistogramInterval.MONTH.toString(); + public static final String DAY_INTERVAL = DateHistogramInterval.DAY.toString(); public Histogram(Source source, Expression field, Expression interval, ZoneId zoneId) { super(source, field, Collections.singletonList(interval)); diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/WatcherConditionScript.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/WatcherConditionScript.java index 724ba58c7e996..d1a2e1c846586 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/WatcherConditionScript.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/condition/WatcherConditionScript.java @@ -43,7 +43,7 @@ public interface Factory { WatcherConditionScript newInstance(Map params, WatchExecutionContext watcherContext); } - public static ScriptContext CONTEXT = new ScriptContext<>( + public static final ScriptContext CONTEXT = new ScriptContext<>( "watcher_condition", Factory.class, 200, diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/DataAttachment.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/DataAttachment.java index d22a608e131f9..7ce1b9ca8b60a 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/DataAttachment.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/notification/email/DataAttachment.java @@ -56,7 +56,7 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws } }; - public static DataAttachment DEFAULT = YAML; + public static final DataAttachment DEFAULT = YAML; public abstract String contentType(); diff --git a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/WatcherTransformScript.java b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/WatcherTransformScript.java index 93e3eefb4aa26..d8c079e1cb00b 100644 --- a/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/WatcherTransformScript.java +++ b/x-pack/plugin/watcher/src/main/java/org/elasticsearch/xpack/watcher/transform/script/WatcherTransformScript.java @@ -44,7 +44,7 @@ public interface Factory { WatcherTransformScript newInstance(Map params, WatchExecutionContext watcherContext, Payload payload); } - public static ScriptContext CONTEXT = new ScriptContext<>( + public static final ScriptContext CONTEXT = new ScriptContext<>( "watcher_transform", Factory.class, 200, diff --git a/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java b/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java index f3b01bb898126..f87c73273a7ac 100644 --- a/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java +++ b/x-pack/plugin/wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper/WildcardFieldMapper.java @@ -94,7 +94,7 @@ public class WildcardFieldMapper extends FieldMapper { public static final String CONTENT_TYPE = "wildcard"; - public static short MAX_CLAUSES_IN_APPROXIMATION_QUERY = 10; + public static final short MAX_CLAUSES_IN_APPROXIMATION_QUERY = 10; public static final int NGRAM_SIZE = 3; static final NamedAnalyzer WILDCARD_ANALYZER_7_10 = new NamedAnalyzer("_wildcard_7_10", AnalyzerScope.GLOBAL, new Analyzer() { @@ -252,7 +252,7 @@ public WildcardFieldMapper build(MapperBuilderContext context) { } } - public static TypeParser PARSER = new TypeParser( + public static final TypeParser PARSER = new TypeParser( (n, c) -> new Builder(n, IGNORE_ABOVE_SETTING.get(c.getSettings()), c.indexVersionCreated()) );