Lowercase static final DeprecationLogger instance names (#34887)

After discussing on the team's FixItFriday, we concluded that
static final instance variables that are mutable should be lowercased.

Historically, DeprecationLogger was uppercased more frequently than lowercased.
This commit is contained in:
Tal Levy 2018-10-25 21:12:19 -07:00 committed by GitHub
parent 3cde1356c1
commit e1fdd00420
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
37 changed files with 101 additions and 100 deletions

View File

@ -19,6 +19,7 @@
package org.elasticsearch.analysis.common; package org.elasticsearch.analysis.common;
import org.apache.logging.log4j.LogManager;
import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.CharArraySet; import org.apache.lucene.analysis.CharArraySet;
import org.apache.lucene.analysis.LowerCaseFilter; import org.apache.lucene.analysis.LowerCaseFilter;
@ -115,7 +116,6 @@ import org.elasticsearch.client.Client;
import org.elasticsearch.cluster.service.ClusterService; import org.elasticsearch.cluster.service.ClusterService;
import org.elasticsearch.common.io.stream.NamedWriteableRegistry; import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.env.Environment; import org.elasticsearch.env.Environment;
@ -151,7 +151,7 @@ import static org.elasticsearch.plugins.AnalysisPlugin.requiresAnalysisSettings;
public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, ScriptPlugin { public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, ScriptPlugin {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(CommonAnalysisPlugin.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(CommonAnalysisPlugin.class));
private final SetOnce<ScriptService> scriptService = new SetOnce<>(); private final SetOnce<ScriptService> scriptService = new SetOnce<>();
@ -376,7 +376,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
filters.add(PreConfiguredCharFilter.singleton("html_strip", false, HTMLStripCharFilter::new)); filters.add(PreConfiguredCharFilter.singleton("html_strip", false, HTMLStripCharFilter::new));
filters.add(PreConfiguredCharFilter.singletonWithVersion("htmlStrip", false, (reader, version) -> { filters.add(PreConfiguredCharFilter.singletonWithVersion("htmlStrip", false, (reader, version) -> {
if (version.onOrAfter(org.elasticsearch.Version.V_6_3_0)) { if (version.onOrAfter(org.elasticsearch.Version.V_6_3_0)) {
DEPRECATION_LOGGER.deprecatedAndMaybeLog("htmlStrip_deprecation", deprecationLogger.deprecatedAndMaybeLog("htmlStrip_deprecation",
"The [htmpStrip] char filter name is deprecated and will be removed in a future version. " "The [htmpStrip] char filter name is deprecated and will be removed in a future version. "
+ "Please change the filter name to [html_strip] instead."); + "Please change the filter name to [html_strip] instead.");
} }
@ -414,7 +414,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
new EdgeNGramTokenFilter(input, 1))); new EdgeNGramTokenFilter(input, 1)));
filters.add(PreConfiguredTokenFilter.singletonWithVersion("edgeNGram", false, (reader, version) -> { filters.add(PreConfiguredTokenFilter.singletonWithVersion("edgeNGram", false, (reader, version) -> {
if (version.onOrAfter(org.elasticsearch.Version.V_6_4_0)) { if (version.onOrAfter(org.elasticsearch.Version.V_6_4_0)) {
DEPRECATION_LOGGER.deprecatedAndMaybeLog("edgeNGram_deprecation", deprecationLogger.deprecatedAndMaybeLog("edgeNGram_deprecation",
"The [edgeNGram] token filter name is deprecated and will be removed in a future version. " "The [edgeNGram] token filter name is deprecated and will be removed in a future version. "
+ "Please change the filter name to [edge_ngram] instead."); + "Please change the filter name to [edge_ngram] instead.");
} }
@ -438,7 +438,7 @@ public class CommonAnalysisPlugin extends Plugin implements AnalysisPlugin, Scri
filters.add(PreConfiguredTokenFilter.singleton("ngram", false, reader -> new NGramTokenFilter(reader, 1, 2, false))); filters.add(PreConfiguredTokenFilter.singleton("ngram", false, reader -> new NGramTokenFilter(reader, 1, 2, false)));
filters.add(PreConfiguredTokenFilter.singletonWithVersion("nGram", false, (reader, version) -> { filters.add(PreConfiguredTokenFilter.singletonWithVersion("nGram", false, (reader, version) -> {
if (version.onOrAfter(org.elasticsearch.Version.V_6_4_0)) { if (version.onOrAfter(org.elasticsearch.Version.V_6_4_0)) {
DEPRECATION_LOGGER.deprecatedAndMaybeLog("nGram_deprecation", deprecationLogger.deprecatedAndMaybeLog("nGram_deprecation",
"The [nGram] token filter name is deprecated and will be removed in a future version. " "The [nGram] token filter name is deprecated and will be removed in a future version. "
+ "Please change the filter name to [ngram] instead."); + "Please change the filter name to [ngram] instead.");
} }

View File

@ -19,16 +19,16 @@
package org.elasticsearch.analysis.common; package org.elasticsearch.analysis.common;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.Version; import org.elasticsearch.Version;
import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.env.Environment; import org.elasticsearch.env.Environment;
import org.elasticsearch.index.IndexSettings; import org.elasticsearch.index.IndexSettings;
public class LegacyDelimitedPayloadTokenFilterFactory extends DelimitedPayloadTokenFilterFactory { public class LegacyDelimitedPayloadTokenFilterFactory extends DelimitedPayloadTokenFilterFactory {
private static final DeprecationLogger DEPRECATION_LOGGER = private static final DeprecationLogger deprecationLogger =
new DeprecationLogger(Loggers.getLogger(LegacyDelimitedPayloadTokenFilterFactory.class)); new DeprecationLogger(LogManager.getLogger(LegacyDelimitedPayloadTokenFilterFactory.class));
LegacyDelimitedPayloadTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) { LegacyDelimitedPayloadTokenFilterFactory(IndexSettings indexSettings, Environment env, String name, Settings settings) {
super(indexSettings, env, name, settings); super(indexSettings, env, name, settings);
@ -37,7 +37,7 @@ public class LegacyDelimitedPayloadTokenFilterFactory extends DelimitedPayloadTo
"[delimited_payload_filter] is not supported for new indices, use [delimited_payload] instead"); "[delimited_payload_filter] is not supported for new indices, use [delimited_payload] instead");
} }
if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_6_2_0)) { if (indexSettings.getIndexVersionCreated().onOrAfter(Version.V_6_2_0)) {
DEPRECATION_LOGGER.deprecated("Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]"); deprecationLogger.deprecated("Deprecated [delimited_payload_filter] used, replaced by [delimited_payload]");
} }
} }
} }

View File

@ -19,6 +19,7 @@
package org.elasticsearch.percolator; package org.elasticsearch.percolator;
import org.apache.logging.log4j.LogManager;
import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.Analyzer;
import org.apache.lucene.analysis.DelegatingAnalyzerWrapper; import org.apache.lucene.analysis.DelegatingAnalyzerWrapper;
import org.apache.lucene.index.BinaryDocValues; import org.apache.lucene.index.BinaryDocValues;
@ -54,7 +55,6 @@ import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
import org.elasticsearch.common.xcontent.NamedXContentRegistry; import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.XContent; import org.elasticsearch.common.xcontent.XContent;
@ -95,7 +95,7 @@ import static org.elasticsearch.percolator.PercolatorFieldMapper.parseQuery;
public class PercolateQueryBuilder extends AbstractQueryBuilder<PercolateQueryBuilder> { public class PercolateQueryBuilder extends AbstractQueryBuilder<PercolateQueryBuilder> {
public static final String NAME = "percolate"; public static final String NAME = "percolate";
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(ParseField.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ParseField.class));
static final ParseField DOCUMENT_FIELD = new ParseField("document"); static final ParseField DOCUMENT_FIELD = new ParseField("document");
static final ParseField DOCUMENTS_FIELD = new ParseField("documents"); static final ParseField DOCUMENTS_FIELD = new ParseField("documents");
@ -577,7 +577,7 @@ public class PercolateQueryBuilder extends AbstractQueryBuilder<PercolateQueryBu
final MapperService mapperService = context.getMapperService(); final MapperService mapperService = context.getMapperService();
String type = mapperService.documentMapper().type(); String type = mapperService.documentMapper().type();
if (documentType != null) { if (documentType != null) {
DEPRECATION_LOGGER.deprecated("[document_type] parameter has been deprecated because types have been deprecated"); deprecationLogger.deprecated("[document_type] parameter has been deprecated because types have been deprecated");
if (documentType.equals(type) == false) { if (documentType.equals(type) == false) {
throw new IllegalArgumentException("specified document_type [" + documentType + throw new IllegalArgumentException("specified document_type [" + documentType +
"] is not equal to the actual type [" + type + "]"); "] is not equal to the actual type [" + type + "]");

View File

@ -77,7 +77,7 @@ final class Ec2ClientSettings {
private static final Logger logger = Loggers.getLogger(Ec2ClientSettings.class); private static final Logger logger = Loggers.getLogger(Ec2ClientSettings.class);
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(logger); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(logger);
/** Credentials to authenticate with ec2. */ /** Credentials to authenticate with ec2. */
final AWSCredentials credentials; final AWSCredentials credentials;
@ -135,11 +135,11 @@ final class Ec2ClientSettings {
return null; return null;
} else { } else {
if (key.length() == 0) { if (key.length() == 0) {
DEPRECATION_LOGGER.deprecated("Setting [{}] is set but [{}] is not, which will be unsupported in future", deprecationLogger.deprecated("Setting [{}] is set but [{}] is not, which will be unsupported in future",
SECRET_KEY_SETTING.getKey(), ACCESS_KEY_SETTING.getKey()); SECRET_KEY_SETTING.getKey(), ACCESS_KEY_SETTING.getKey());
} }
if (secret.length() == 0) { if (secret.length() == 0) {
DEPRECATION_LOGGER.deprecated("Setting [{}] is set but [{}] is not, which will be unsupported in future", deprecationLogger.deprecated("Setting [{}] is set but [{}] is not, which will be unsupported in future",
ACCESS_KEY_SETTING.getKey(), SECRET_KEY_SETTING.getKey()); ACCESS_KEY_SETTING.getKey(), SECRET_KEY_SETTING.getKey());
} }

View File

@ -19,12 +19,12 @@
package org.elasticsearch.http; package org.elasticsearch.http;
import org.apache.logging.log4j.LogManager;
import org.apache.lucene.search.Query; import org.apache.lucene.search.Query;
import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.lucene.search.Queries; import org.elasticsearch.common.lucene.search.Queries;
import org.elasticsearch.common.xcontent.XContentBuilder; import org.elasticsearch.common.xcontent.XContentBuilder;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
@ -41,7 +41,8 @@ import java.io.IOException;
public class TestDeprecatedQueryBuilder extends AbstractQueryBuilder<TestDeprecatedQueryBuilder> { public class TestDeprecatedQueryBuilder extends AbstractQueryBuilder<TestDeprecatedQueryBuilder> {
public static final String NAME = "deprecated_match_all"; public static final String NAME = "deprecated_match_all";
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(TestDeprecatedQueryBuilder.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(TestDeprecatedQueryBuilder.class));
public TestDeprecatedQueryBuilder() { public TestDeprecatedQueryBuilder() {
// nothing to do // nothing to do
@ -79,7 +80,7 @@ public class TestDeprecatedQueryBuilder extends AbstractQueryBuilder<TestDepreca
@Override @Override
protected Query doToQuery(QueryShardContext context) throws IOException { protected Query doToQuery(QueryShardContext context) throws IOException {
DEPRECATION_LOGGER.deprecated("[{}] query is deprecated, but used on [{}] index", NAME, context.index().getName()); deprecationLogger.deprecated("[{}] query is deprecated, but used on [{}] index", NAME, context.index().getName());
return Queries.newMatchAllQuery(); return Queries.newMatchAllQuery();
} }

View File

@ -69,7 +69,7 @@ import static org.elasticsearch.common.settings.Settings.writeSettingsToStream;
*/ */
public class PutIndexTemplateRequest extends MasterNodeRequest<PutIndexTemplateRequest> implements IndicesRequest, ToXContent { public class PutIndexTemplateRequest extends MasterNodeRequest<PutIndexTemplateRequest> implements IndicesRequest, ToXContent {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(PutIndexTemplateRequest.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(PutIndexTemplateRequest.class));
private String name; private String name;
@ -313,7 +313,7 @@ public class PutIndexTemplateRequest extends MasterNodeRequest<PutIndexTemplateR
if (name.equals("template")) { if (name.equals("template")) {
// This is needed to allow for bwc (beats, logstash) with pre-5.0 templates (#21009) // This is needed to allow for bwc (beats, logstash) with pre-5.0 templates (#21009)
if(entry.getValue() instanceof String) { if(entry.getValue() instanceof String) {
DEPRECATION_LOGGER.deprecated("Deprecated field [template] used, replaced by [index_patterns]"); deprecationLogger.deprecated("Deprecated field [template] used, replaced by [index_patterns]");
patterns(Collections.singletonList((String) entry.getValue())); patterns(Collections.singletonList((String) entry.getValue()));
} }
} else if (name.equals("index_patterns")) { } else if (name.equals("index_patterns")) {

View File

@ -53,7 +53,7 @@ import java.util.Set;
public class IndexTemplateMetaData extends AbstractDiffable<IndexTemplateMetaData> { public class IndexTemplateMetaData extends AbstractDiffable<IndexTemplateMetaData> {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(IndexTemplateMetaData.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(IndexTemplateMetaData.class));
private final String name; private final String name;
@ -451,7 +451,7 @@ public class IndexTemplateMetaData extends AbstractDiffable<IndexTemplateMetaDat
} else if (token.isValue()) { } else if (token.isValue()) {
// Prior to 5.1.0, elasticsearch only supported a single index pattern called `template` (#21009) // Prior to 5.1.0, elasticsearch only supported a single index pattern called `template` (#21009)
if("template".equals(currentFieldName)) { if("template".equals(currentFieldName)) {
DEPRECATION_LOGGER.deprecated("Deprecated field [template] used, replaced by [index_patterns]"); deprecationLogger.deprecated("Deprecated field [template] used, replaced by [index_patterns]");
builder.patterns(Collections.singletonList(parser.text())); builder.patterns(Collections.singletonList(parser.text()));
} else if ("order".equals(currentFieldName)) { } else if ("order".equals(currentFieldName)) {
builder.order(parser.intValue()); builder.order(parser.intValue());

View File

@ -41,7 +41,7 @@ public class DateUtils {
return DateTimeZone.forID(zoneId.getId()); return DateTimeZone.forID(zoneId.getId());
} }
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(DateFormatters.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(DateFormatters.class));
// pkg private for tests // pkg private for tests
static final Map<String, String> DEPRECATED_SHORT_TIMEZONES; static final Map<String, String> DEPRECATED_SHORT_TIMEZONES;
static { static {
@ -61,7 +61,7 @@ public class DateUtils {
String deprecatedId = DEPRECATED_SHORT_TIMEZONES.get(timeZone.getID()); String deprecatedId = DEPRECATED_SHORT_TIMEZONES.get(timeZone.getID());
if (deprecatedId != null) { if (deprecatedId != null) {
DEPRECATION_LOGGER.deprecatedAndMaybeLog("timezone", deprecationLogger.deprecatedAndMaybeLog("timezone",
"Use of short timezone id " + timeZone.getID() + " is deprecated. Use " + deprecatedId + " instead"); "Use of short timezone id " + timeZone.getID() + " is deprecated. Use " + deprecatedId + " instead");
return ZoneId.of(deprecatedId); return ZoneId.of(deprecatedId);
} }

View File

@ -36,7 +36,7 @@ import java.util.Objects;
public class ByteSizeValue implements Writeable, Comparable<ByteSizeValue>, ToXContentFragment { public class ByteSizeValue implements Writeable, Comparable<ByteSizeValue>, ToXContentFragment {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(ByteSizeValue.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ByteSizeValue.class));
public static final ByteSizeValue ZERO = new ByteSizeValue(0, ByteSizeUnit.BYTES); public static final ByteSizeValue ZERO = new ByteSizeValue(0, ByteSizeUnit.BYTES);
@ -237,7 +237,7 @@ public class ByteSizeValue implements Writeable, Comparable<ByteSizeValue>, ToXC
} catch (final NumberFormatException e) { } catch (final NumberFormatException e) {
try { try {
final double doubleValue = Double.parseDouble(s); final double doubleValue = Double.parseDouble(s);
DEPRECATION_LOGGER.deprecated( deprecationLogger.deprecated(
"Fractional bytes values are deprecated. Use non-fractional bytes values instead: [{}] found for setting [{}]", "Fractional bytes values are deprecated. Use non-fractional bytes values instead: [{}] found for setting [{}]",
initialInput, settingName); initialInput, settingName);
return new ByteSizeValue((long) (doubleValue * unit.toBytes(1))); return new ByteSizeValue((long) (doubleValue * unit.toBytes(1)));

View File

@ -42,7 +42,7 @@ public class LoggingDeprecationHandler implements DeprecationHandler {
* Changing that will require some research to make super duper * Changing that will require some research to make super duper
* sure it is safe. * sure it is safe.
*/ */
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(ParseField.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ParseField.class));
private LoggingDeprecationHandler() { private LoggingDeprecationHandler() {
// Singleton // Singleton
@ -50,11 +50,11 @@ public class LoggingDeprecationHandler implements DeprecationHandler {
@Override @Override
public void usedDeprecatedName(String usedName, String modernName) { public void usedDeprecatedName(String usedName, String modernName) {
DEPRECATION_LOGGER.deprecated("Deprecated field [{}] used, expected [{}] instead", usedName, modernName); deprecationLogger.deprecated("Deprecated field [{}] used, expected [{}] instead", usedName, modernName);
} }
@Override @Override
public void usedDeprecatedField(String usedName, String replacedWith) { public void usedDeprecatedField(String usedName, String replacedWith) {
DEPRECATION_LOGGER.deprecated("Deprecated field [{}] used, replaced by [{}]", usedName, replacedWith); deprecationLogger.deprecated("Deprecated field [{}] used, replaced by [{}]", usedName, replacedWith);
} }
} }

View File

@ -37,7 +37,7 @@ import static org.elasticsearch.common.Booleans.parseBoolean;
public class HttpInfo implements Writeable, ToXContentFragment { public class HttpInfo implements Writeable, ToXContentFragment {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(HttpInfo.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(HttpInfo.class));
/** Whether to add hostname to publish host field when serializing. */ /** Whether to add hostname to publish host field when serializing. */
private static final boolean CNAME_IN_PUBLISH_HOST = private static final boolean CNAME_IN_PUBLISH_HOST =
@ -86,7 +86,7 @@ public class HttpInfo implements Writeable, ToXContentFragment {
if (cnameInPublishHost) { if (cnameInPublishHost) {
publishAddressString = hostString + '/' + publishAddress.toString(); publishAddressString = hostString + '/' + publishAddress.toString();
} else { } else {
DEPRECATION_LOGGER.deprecated( deprecationLogger.deprecated(
"[http.publish_host] was printed as [ip:port] instead of [hostname/ip:port]. " "[http.publish_host] was printed as [ip:port] instead of [hostname/ip:port]. "
+ "This format is deprecated and will change to [hostname/ip:port] in a future version. " + "This format is deprecated and will change to [hostname/ip:port] in a future version. "
+ "Use -Des.http.cname_in_publish_address=true to enforce non-deprecated formatting." + "Use -Des.http.cname_in_publish_address=true to enforce non-deprecated formatting."

View File

@ -36,7 +36,7 @@ import java.util.TreeMap;
public class DynamicTemplate implements ToXContentObject { public class DynamicTemplate implements ToXContentObject {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(DynamicTemplate.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(DynamicTemplate.class));
public enum MatchType { public enum MatchType {
SIMPLE { SIMPLE {
@ -208,7 +208,7 @@ public class DynamicTemplate implements ToXContentObject {
if (indexVersionCreated.onOrAfter(Version.V_6_0_0_alpha1)) { if (indexVersionCreated.onOrAfter(Version.V_6_0_0_alpha1)) {
throw e; throw e;
} else { } else {
DEPRECATION_LOGGER.deprecated("match_mapping_type [" + matchMappingType + "] is invalid and will be ignored: " deprecationLogger.deprecated("match_mapping_type [" + matchMappingType + "] is invalid and will be ignored: "
+ e.getMessage()); + e.getMessage());
// this template is on an unknown type so it will never match anything // this template is on an unknown type so it will never match anything
// null indicates that the template should be ignored // null indicates that the template should be ignored

View File

@ -48,7 +48,7 @@ import java.util.Objects;
*/ */
public class FieldNamesFieldMapper extends MetadataFieldMapper { public class FieldNamesFieldMapper extends MetadataFieldMapper {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger( private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(FieldNamesFieldMapper.class)); LogManager.getLogger(FieldNamesFieldMapper.class));
public static final String NAME = "_field_names"; public static final String NAME = "_field_names";
@ -184,7 +184,7 @@ public class FieldNamesFieldMapper extends MetadataFieldMapper {
if (isEnabled() == false) { if (isEnabled() == false) {
throw new IllegalStateException("Cannot run [exists] queries if the [_field_names] field is disabled"); throw new IllegalStateException("Cannot run [exists] queries if the [_field_names] field is disabled");
} }
DEPRECATION_LOGGER.deprecated( deprecationLogger.deprecated(
"terms query on the _field_names field is deprecated and will be removed, use exists query instead"); "terms query on the _field_names field is deprecated and will be removed, use exists query instead");
return super.termQuery(value, context); return super.termQuery(value, context);
} }

View File

@ -117,7 +117,7 @@ public class MapperService extends AbstractIndexComponent implements Closeable {
"_size", "_timestamp", "_ttl", IgnoredFieldMapper.NAME "_size", "_timestamp", "_ttl", IgnoredFieldMapper.NAME
); );
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(MapperService.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(MapperService.class));
private final IndexAnalyzers indexAnalyzers; private final IndexAnalyzers indexAnalyzers;
@ -408,7 +408,7 @@ public class MapperService extends AbstractIndexComponent implements Closeable {
throw new IllegalArgumentException("The [default] mapping cannot be updated on index [" + index().getName() + throw new IllegalArgumentException("The [default] mapping cannot be updated on index [" + index().getName() +
"]: defaults mappings are not useful anymore now that indices can have at most one type."); "]: defaults mappings are not useful anymore now that indices can have at most one type.");
} else if (reason == MergeReason.MAPPING_UPDATE) { // only log in case of explicit mapping updates } else if (reason == MergeReason.MAPPING_UPDATE) { // only log in case of explicit mapping updates
DEPRECATION_LOGGER.deprecated("[_default_] mapping is deprecated since it is not useful anymore now that indexes " + deprecationLogger.deprecated("[_default_] mapping is deprecated since it is not useful anymore now that indexes " +
"cannot have more than one type"); "cannot have more than one type");
} }
assert defaultMapper.type().equals(DEFAULT_MAPPING); assert defaultMapper.type().equals(DEFAULT_MAPPING);

View File

@ -92,7 +92,7 @@ public class TypeFieldMapper extends MetadataFieldMapper {
static final class TypeFieldType extends StringFieldType { static final class TypeFieldType extends StringFieldType {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(TypeFieldType.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(TypeFieldType.class));
TypeFieldType() { TypeFieldType() {
} }
@ -160,7 +160,7 @@ public class TypeFieldMapper extends MetadataFieldMapper {
@Override @Override
public Query rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, QueryShardContext context) { public Query rangeQuery(Object lowerTerm, Object upperTerm, boolean includeLower, boolean includeUpper, QueryShardContext context) {
DEPRECATION_LOGGER.deprecatedAndMaybeLog("range_single_type", deprecationLogger.deprecatedAndMaybeLog("range_single_type",
"Running [range] query on [_type] field for an index with a single type. As types are deprecated, this functionality will be removed in future releases."); "Running [range] query on [_type] field for an index with a single type. As types are deprecated, this functionality will be removed in future releases.");
Query result = new MatchAllDocsQuery(); Query result = new MatchAllDocsQuery();
String type = context.getMapperService().documentMapper().type(); String type = context.getMapperService().documentMapper().type();

View File

@ -40,7 +40,7 @@ public class TypeQueryBuilder extends AbstractQueryBuilder<TypeQueryBuilder> {
public static final String NAME = "type"; public static final String NAME = "type";
private static final ParseField VALUE_FIELD = new ParseField("value"); private static final ParseField VALUE_FIELD = new ParseField("value");
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(TypeQueryBuilder.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(TypeQueryBuilder.class));
private final String type; private final String type;
@ -127,7 +127,7 @@ public class TypeQueryBuilder extends AbstractQueryBuilder<TypeQueryBuilder> {
@Override @Override
protected Query doToQuery(QueryShardContext context) throws IOException { protected Query doToQuery(QueryShardContext context) throws IOException {
DEPRECATION_LOGGER.deprecated("The [type] query is deprecated, filter on a field instead."); deprecationLogger.deprecated("The [type] query is deprecated, filter on a field instead.");
//LUCENE 4 UPGRADE document mapper should use bytesref as well? //LUCENE 4 UPGRADE document mapper should use bytesref as well?
DocumentMapper documentMapper = context.getMapperService().documentMapper(type); DocumentMapper documentMapper = context.getMapperService().documentMapper(type);
if (documentMapper == null) { if (documentMapper == null) {

View File

@ -40,7 +40,7 @@ import java.util.Objects;
*/ */
public class RandomScoreFunctionBuilder extends ScoreFunctionBuilder<RandomScoreFunctionBuilder> { public class RandomScoreFunctionBuilder extends ScoreFunctionBuilder<RandomScoreFunctionBuilder> {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger( private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RandomScoreFunctionBuilder.class)); LogManager.getLogger(RandomScoreFunctionBuilder.class));
public static final String NAME = "random_score"; public static final String NAME = "random_score";
@ -168,7 +168,7 @@ public class RandomScoreFunctionBuilder extends ScoreFunctionBuilder<RandomScore
if (field != null) { if (field != null) {
fieldType = context.getMapperService().fullName(field); fieldType = context.getMapperService().fullName(field);
} else { } else {
DEPRECATION_LOGGER.deprecated( deprecationLogger.deprecated(
"As of version 7.0 Elasticsearch will require that a [field] parameter is provided when a [seed] is set"); "As of version 7.0 Elasticsearch will require that a [field] parameter is provided when a [seed] is set");
fieldType = context.getMapperService().fullName(IdFieldMapper.NAME); fieldType = context.getMapperService().fullName(IdFieldMapper.NAME);
} }

View File

@ -67,7 +67,7 @@ final class SimilarityProviders {
private SimilarityProviders() {} // no instantiation private SimilarityProviders() {} // no instantiation
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(SimilarityProviders.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(SimilarityProviders.class));
static final String DISCOUNT_OVERLAPS = "discount_overlaps"; static final String DISCOUNT_OVERLAPS = "discount_overlaps";
private static final Map<String, BasicModel> BASIC_MODELS; private static final Map<String, BasicModel> BASIC_MODELS;
@ -143,7 +143,7 @@ final class SimilarityProviders {
throw new IllegalArgumentException("Basic model [" + basicModel + "] isn't supported anymore, " + throw new IllegalArgumentException("Basic model [" + basicModel + "] isn't supported anymore, " +
"please use another model."); "please use another model.");
} else { } else {
DEPRECATION_LOGGER.deprecated("Basic model [" + basicModel + deprecationLogger.deprecated("Basic model [" + basicModel +
"] isn't supported anymore and has arbitrarily been replaced with [" + replacement + "]."); "] isn't supported anymore and has arbitrarily been replaced with [" + replacement + "].");
model = BASIC_MODELS.get(replacement); model = BASIC_MODELS.get(replacement);
assert model != null; assert model != null;
@ -174,7 +174,7 @@ final class SimilarityProviders {
throw new IllegalArgumentException("After effect [" + afterEffect + throw new IllegalArgumentException("After effect [" + afterEffect +
"] isn't supported anymore, please use another effect."); "] isn't supported anymore, please use another effect.");
} else { } else {
DEPRECATION_LOGGER.deprecated("After effect [" + afterEffect + deprecationLogger.deprecated("After effect [" + afterEffect +
"] isn't supported anymore and has arbitrarily been replaced with [" + replacement + "]."); "] isn't supported anymore and has arbitrarily been replaced with [" + replacement + "].");
effect = AFTER_EFFECTS.get(replacement); effect = AFTER_EFFECTS.get(replacement);
assert effect != null; assert effect != null;
@ -264,7 +264,7 @@ final class SimilarityProviders {
if (version.onOrAfter(Version.V_7_0_0_alpha1)) { if (version.onOrAfter(Version.V_7_0_0_alpha1)) {
throw new IllegalArgumentException("Unknown settings for similarity of type [" + type + "]: " + unknownSettings); throw new IllegalArgumentException("Unknown settings for similarity of type [" + type + "]: " + unknownSettings);
} else { } else {
DEPRECATION_LOGGER.deprecated("Unknown settings for similarity of type [" + type + "]: " + unknownSettings); deprecationLogger.deprecated("Unknown settings for similarity of type [" + type + "]: " + unknownSettings);
} }
} }
} }

View File

@ -51,7 +51,7 @@ import java.util.function.Supplier;
public final class SimilarityService extends AbstractIndexComponent { public final class SimilarityService extends AbstractIndexComponent {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(SimilarityService.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(SimilarityService.class));
public static final String DEFAULT_SIMILARITY = "BM25"; public static final String DEFAULT_SIMILARITY = "BM25";
private static final String CLASSIC_SIMILARITY = "classic"; private static final String CLASSIC_SIMILARITY = "classic";
private static final Map<String, Function<Version, Supplier<Similarity>>> DEFAULTS; private static final Map<String, Function<Version, Supplier<Similarity>>> DEFAULTS;
@ -67,7 +67,7 @@ public final class SimilarityService extends AbstractIndexComponent {
} else { } else {
final ClassicSimilarity similarity = SimilarityProviders.createClassicSimilarity(Settings.EMPTY, version); final ClassicSimilarity similarity = SimilarityProviders.createClassicSimilarity(Settings.EMPTY, version);
return () -> { return () -> {
DEPRECATION_LOGGER.deprecated("The [classic] similarity is now deprecated in favour of BM25, which is generally " deprecationLogger.deprecated("The [classic] similarity is now deprecated in favour of BM25, which is generally "
+ "accepted as a better alternative. Use the [BM25] similarity or build a custom [scripted] similarity " + "accepted as a better alternative. Use the [BM25] similarity or build a custom [scripted] similarity "
+ "instead."); + "instead.");
return similarity; return similarity;
@ -90,7 +90,7 @@ public final class SimilarityService extends AbstractIndexComponent {
throw new IllegalArgumentException("The [classic] similarity may not be used anymore. Please use the [BM25] " throw new IllegalArgumentException("The [classic] similarity may not be used anymore. Please use the [BM25] "
+ "similarity or build a custom [scripted] similarity instead."); + "similarity or build a custom [scripted] similarity instead.");
} else { } else {
DEPRECATION_LOGGER.deprecated("The [classic] similarity is now deprecated in favour of BM25, which is generally " deprecationLogger.deprecated("The [classic] similarity is now deprecated in favour of BM25, which is generally "
+ "accepted as a better alternative. Use the [BM25] similarity or build a custom [scripted] similarity " + "accepted as a better alternative. Use the [BM25] similarity or build a custom [scripted] similarity "
+ "instead."); + "instead.");
return SimilarityProviders.createClassicSimilarity(settings, version); return SimilarityProviders.createClassicSimilarity(settings, version);
@ -154,7 +154,7 @@ public final class SimilarityService extends AbstractIndexComponent {
defaultSimilarity = (providers.get("default") != null) ? providers.get("default").get() defaultSimilarity = (providers.get("default") != null) ? providers.get("default").get()
: providers.get(SimilarityService.DEFAULT_SIMILARITY).get(); : providers.get(SimilarityService.DEFAULT_SIMILARITY).get();
if (providers.get("base") != null) { if (providers.get("base") != null) {
DEPRECATION_LOGGER.deprecated("The [base] similarity is ignored since query normalization and coords have been removed"); deprecationLogger.deprecated("The [base] similarity is ignored since query normalization and coords have been removed");
} }
} }
@ -270,7 +270,7 @@ public final class SimilarityService extends AbstractIndexComponent {
if (indexCreatedVersion.onOrAfter(Version.V_7_0_0_alpha1)) { if (indexCreatedVersion.onOrAfter(Version.V_7_0_0_alpha1)) {
throw new IllegalArgumentException(message); throw new IllegalArgumentException(message);
} else if (indexCreatedVersion.onOrAfter(Version.V_6_5_0)) { } else if (indexCreatedVersion.onOrAfter(Version.V_6_5_0)) {
DEPRECATION_LOGGER.deprecated(message); deprecationLogger.deprecated(message);
} }
} }

View File

@ -71,7 +71,7 @@ public final class AnalysisModule {
private static final IndexSettings NA_INDEX_SETTINGS; private static final IndexSettings NA_INDEX_SETTINGS;
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(AnalysisModule.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(AnalysisModule.class));
private final HunspellService hunspellService; private final HunspellService hunspellService;
private final AnalysisRegistry analysisRegistry; private final AnalysisRegistry analysisRegistry;
@ -125,7 +125,7 @@ public final class AnalysisModule {
@Override @Override
public TokenFilterFactory get(IndexSettings indexSettings, Environment environment, String name, Settings settings) { public TokenFilterFactory get(IndexSettings indexSettings, Environment environment, String name, Settings settings) {
if (indexSettings.getIndexVersionCreated().before(Version.V_7_0_0_alpha1)) { if (indexSettings.getIndexVersionCreated().before(Version.V_7_0_0_alpha1)) {
DEPRECATION_LOGGER.deprecatedAndMaybeLog("standard_deprecation", deprecationLogger.deprecatedAndMaybeLog("standard_deprecation",
"The [standard] token filter name is deprecated and will be removed in a future version."); "The [standard] token filter name is deprecated and will be removed in a future version.");
} else { } else {
throw new IllegalArgumentException("The [standard] token filter has been removed."); throw new IllegalArgumentException("The [standard] token filter has been removed.");
@ -183,7 +183,7 @@ public final class AnalysisModule {
preConfiguredTokenFilters.register( "standard", preConfiguredTokenFilters.register( "standard",
PreConfiguredTokenFilter.singletonWithVersion("standard", true, (reader, version) -> { PreConfiguredTokenFilter.singletonWithVersion("standard", true, (reader, version) -> {
if (version.before(Version.V_7_0_0_alpha1)) { if (version.before(Version.V_7_0_0_alpha1)) {
DEPRECATION_LOGGER.deprecatedAndMaybeLog("standard_deprecation", deprecationLogger.deprecatedAndMaybeLog("standard_deprecation",
"The [standard] token filter is deprecated and will be removed in a future version."); "The [standard] token filter is deprecated and will be removed in a future version.");
} else { } else {
throw new IllegalArgumentException("The [standard] token filter has been removed."); throw new IllegalArgumentException("The [standard] token filter has been removed.");

View File

@ -36,7 +36,7 @@ import java.util.Collections;
public class RestPutIndexTemplateAction extends BaseRestHandler { public class RestPutIndexTemplateAction extends BaseRestHandler {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger( private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(RestPutIndexTemplateAction.class)); LogManager.getLogger(RestPutIndexTemplateAction.class));
public RestPutIndexTemplateAction(Settings settings, RestController controller) { public RestPutIndexTemplateAction(Settings settings, RestController controller) {
@ -54,7 +54,7 @@ public class RestPutIndexTemplateAction extends BaseRestHandler {
public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException {
PutIndexTemplateRequest putRequest = new PutIndexTemplateRequest(request.param("name")); PutIndexTemplateRequest putRequest = new PutIndexTemplateRequest(request.param("name"));
if (request.hasParam("template")) { if (request.hasParam("template")) {
DEPRECATION_LOGGER.deprecated("Deprecated parameter[template] used, replaced by [index_patterns]"); deprecationLogger.deprecated("Deprecated parameter[template] used, replaced by [index_patterns]");
putRequest.patterns(Collections.singletonList(request.param("template"))); putRequest.patterns(Collections.singletonList(request.param("template")));
} else { } else {
putRequest.patterns(Arrays.asList(request.paramAsStringArray("index_patterns", Strings.EMPTY_ARRAY))); putRequest.patterns(Arrays.asList(request.paramAsStringArray("index_patterns", Strings.EMPTY_ARRAY)));

View File

@ -57,7 +57,7 @@ public class RestSearchAction extends BaseRestHandler {
public static final String TYPED_KEYS_PARAM = "typed_keys"; public static final String TYPED_KEYS_PARAM = "typed_keys";
private static final Set<String> RESPONSE_PARAMS = Collections.singleton(TYPED_KEYS_PARAM); private static final Set<String> RESPONSE_PARAMS = Collections.singleton(TYPED_KEYS_PARAM);
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(RestSearchAction.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(RestSearchAction.class));
public RestSearchAction(Settings settings, RestController controller) { public RestSearchAction(Settings settings, RestController controller) {
super(settings); super(settings);
@ -157,7 +157,7 @@ public class RestSearchAction extends BaseRestHandler {
throw new IllegalArgumentException("You may only use the [include_type_name=false] option with the search API with the " + throw new IllegalArgumentException("You may only use the [include_type_name=false] option with the search API with the " +
"[{index}/_search] endpoint."); "[{index}/_search] endpoint.");
} }
DEPRECATION_LOGGER.deprecated("The {index}/{type}/_search endpoint is deprecated, use {index}/_search instead"); deprecationLogger.deprecated("The {index}/{type}/_search endpoint is deprecated, use {index}/_search instead");
} }
searchRequest.types(Strings.splitStringByCommaToArray(types)); searchRequest.types(Strings.splitStringByCommaToArray(types));
searchRequest.routing(request.param("routing")); searchRequest.routing(request.param("routing"));

View File

@ -47,13 +47,13 @@ import java.util.Locale;
* A wrapper around ZonedDateTime that exposes joda methods for backcompat. * A wrapper around ZonedDateTime that exposes joda methods for backcompat.
*/ */
public class JodaCompatibleZonedDateTime { public class JodaCompatibleZonedDateTime {
private static final DeprecationLogger DEPRECATION_LOGGER = private static final DeprecationLogger deprecationLogger =
new DeprecationLogger(LogManager.getLogger(JodaCompatibleZonedDateTime.class)); new DeprecationLogger(LogManager.getLogger(JodaCompatibleZonedDateTime.class));
private static void logDeprecated(String key, String message, Object... params) { private static void logDeprecated(String key, String message, Object... params) {
// NOTE: we don't check SpecialPermission because this will be called (indirectly) from scripts // NOTE: we don't check SpecialPermission because this will be called (indirectly) from scripts
AccessController.doPrivileged((PrivilegedAction<Void>) () -> { AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
DEPRECATION_LOGGER.deprecatedAndMaybeLog(key, message, params); deprecationLogger.deprecatedAndMaybeLog(key, message, params);
return null; return null;
}); });
} }

View File

@ -28,7 +28,7 @@ import java.util.Set;
public final class ParameterMap implements Map<String, Object> { public final class ParameterMap implements Map<String, Object> {
private static final DeprecationLogger DEPRECATION_LOGGER = private static final DeprecationLogger deprecationLogger =
new DeprecationLogger(LogManager.getLogger(ParameterMap.class)); new DeprecationLogger(LogManager.getLogger(ParameterMap.class));
private final Map<String, Object> params; private final Map<String, Object> params;
@ -64,7 +64,7 @@ public final class ParameterMap implements Map<String, Object> {
public Object get(final Object key) { public Object get(final Object key) {
String deprecationMessage = deprecations.get(key); String deprecationMessage = deprecations.get(key);
if (deprecationMessage != null) { if (deprecationMessage != null) {
DEPRECATION_LOGGER.deprecated(deprecationMessage); deprecationLogger.deprecated(deprecationMessage);
} }
return params.get(key); return params.get(key);
} }

View File

@ -51,7 +51,7 @@ public final class ScriptMetaData implements MetaData.Custom, Writeable, ToXCont
/** /**
* Standard deprecation logger for used to deprecate allowance of empty templates. * Standard deprecation logger for used to deprecate allowance of empty templates.
*/ */
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(ScriptMetaData.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ScriptMetaData.class));
/** /**
* A builder used to modify the currently stored scripts data held within * A builder used to modify the currently stored scripts data held within
@ -219,9 +219,9 @@ public final class ScriptMetaData implements MetaData.Custom, Writeable, ToXCont
if (source.getSource().isEmpty()) { if (source.getSource().isEmpty()) {
if (source.getLang().equals(Script.DEFAULT_TEMPLATE_LANG)) { if (source.getLang().equals(Script.DEFAULT_TEMPLATE_LANG)) {
DEPRECATION_LOGGER.deprecated("empty templates should no longer be used"); deprecationLogger.deprecated("empty templates should no longer be used");
} else { } else {
DEPRECATION_LOGGER.deprecated("empty scripts should no longer be used"); deprecationLogger.deprecated("empty scripts should no longer be used");
} }
} }
} }

View File

@ -59,7 +59,7 @@ public class StoredScriptSource extends AbstractDiffable<StoredScriptSource> imp
/** /**
* Standard deprecation logger for used to deprecate allowance of empty templates. * Standard deprecation logger for used to deprecate allowance of empty templates.
*/ */
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(StoredScriptSource.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(StoredScriptSource.class));
/** /**
* Standard {@link ParseField} for outer level of stored script source. * Standard {@link ParseField} for outer level of stored script source.
@ -145,9 +145,9 @@ public class StoredScriptSource extends AbstractDiffable<StoredScriptSource> imp
if (source == null) { if (source == null) {
if (ignoreEmpty || Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { if (ignoreEmpty || Script.DEFAULT_TEMPLATE_LANG.equals(lang)) {
if (Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { if (Script.DEFAULT_TEMPLATE_LANG.equals(lang)) {
DEPRECATION_LOGGER.deprecated("empty templates should no longer be used"); deprecationLogger.deprecated("empty templates should no longer be used");
} else { } else {
DEPRECATION_LOGGER.deprecated("empty scripts should no longer be used"); deprecationLogger.deprecated("empty scripts should no longer be used");
} }
} else { } else {
throw new IllegalArgumentException("must specify source for stored script"); throw new IllegalArgumentException("must specify source for stored script");
@ -155,9 +155,9 @@ public class StoredScriptSource extends AbstractDiffable<StoredScriptSource> imp
} else if (source.isEmpty()) { } else if (source.isEmpty()) {
if (ignoreEmpty || Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { if (ignoreEmpty || Script.DEFAULT_TEMPLATE_LANG.equals(lang)) {
if (Script.DEFAULT_TEMPLATE_LANG.equals(lang)) { if (Script.DEFAULT_TEMPLATE_LANG.equals(lang)) {
DEPRECATION_LOGGER.deprecated("empty templates should no longer be used"); deprecationLogger.deprecated("empty templates should no longer be used");
} else { } else {
DEPRECATION_LOGGER.deprecated("empty scripts should no longer be used"); deprecationLogger.deprecated("empty scripts should no longer be used");
} }
} else { } else {
throw new IllegalArgumentException("source cannot be empty"); throw new IllegalArgumentException("source cannot be empty");
@ -257,7 +257,7 @@ public class StoredScriptSource extends AbstractDiffable<StoredScriptSource> imp
token = parser.nextToken(); token = parser.nextToken();
if (token == Token.END_OBJECT) { if (token == Token.END_OBJECT) {
DEPRECATION_LOGGER.deprecated("empty templates should no longer be used"); deprecationLogger.deprecated("empty templates should no longer be used");
return new StoredScriptSource(Script.DEFAULT_TEMPLATE_LANG, "", Collections.emptyMap()); return new StoredScriptSource(Script.DEFAULT_TEMPLATE_LANG, "", Collections.emptyMap());
} }

View File

@ -527,7 +527,7 @@ public class InternalOrder extends BucketOrder {
*/ */
public static class Parser { public static class Parser {
private static final DeprecationLogger DEPRECATION_LOGGER = private static final DeprecationLogger deprecationLogger =
new DeprecationLogger(LogManager.getLogger(Parser.class)); new DeprecationLogger(LogManager.getLogger(Parser.class));
/** /**
@ -565,7 +565,7 @@ public class InternalOrder extends BucketOrder {
} }
// _term and _time order deprecated in 6.0; replaced by _key // _term and _time order deprecated in 6.0; replaced by _key
if ("_term".equals(orderKey) || "_time".equals(orderKey)) { if ("_term".equals(orderKey) || "_time".equals(orderKey)) {
DEPRECATION_LOGGER.deprecated("Deprecated aggregation order key [{}] used, replaced by [_key]", orderKey); deprecationLogger.deprecated("Deprecated aggregation order key [{}] used, replaced by [_key]", orderKey);
} }
switch (orderKey) { switch (orderKey) {
case "_term": case "_term":

View File

@ -60,7 +60,7 @@ import java.util.Map;
public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, SignificantTermsAggregatorFactory> public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, SignificantTermsAggregatorFactory>
implements Releasable { implements Releasable {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger( private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(SignificantTermsAggregatorFactory.class)); LogManager.getLogger(SignificantTermsAggregatorFactory.class));
private final IncludeExclude includeExclude; private final IncludeExclude includeExclude;
@ -202,7 +202,7 @@ public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFac
if (valuesSource instanceof ValuesSource.Bytes) { if (valuesSource instanceof ValuesSource.Bytes) {
ExecutionMode execution = null; ExecutionMode execution = null;
if (executionHint != null) { if (executionHint != null) {
execution = ExecutionMode.fromString(executionHint, DEPRECATION_LOGGER); execution = ExecutionMode.fromString(executionHint, deprecationLogger);
} }
if (valuesSource instanceof ValuesSource.Bytes.WithOrdinals == false) { if (valuesSource instanceof ValuesSource.Bytes.WithOrdinals == false) {
execution = ExecutionMode.MAP; execution = ExecutionMode.MAP;

View File

@ -47,7 +47,7 @@ import java.util.List;
import java.util.Map; import java.util.Map;
public class TermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, TermsAggregatorFactory> { public class TermsAggregatorFactory extends ValuesSourceAggregatorFactory<ValuesSource, TermsAggregatorFactory> {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(TermsAggregatorFactory.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(TermsAggregatorFactory.class));
static Boolean REMAP_GLOBAL_ORDS, COLLECT_SEGMENT_ORDS; static Boolean REMAP_GLOBAL_ORDS, COLLECT_SEGMENT_ORDS;
@ -128,7 +128,7 @@ public class TermsAggregatorFactory extends ValuesSourceAggregatorFactory<Values
if (valuesSource instanceof ValuesSource.Bytes) { if (valuesSource instanceof ValuesSource.Bytes) {
ExecutionMode execution = null; ExecutionMode execution = null;
if (executionHint != null) { if (executionHint != null) {
execution = ExecutionMode.fromString(executionHint, DEPRECATION_LOGGER); execution = ExecutionMode.fromString(executionHint, deprecationLogger);
} }
// In some cases, using ordinals is just not supported: override it // In some cases, using ordinals is just not supported: override it
if (valuesSource instanceof ValuesSource.Bytes.WithOrdinals == false) { if (valuesSource instanceof ValuesSource.Bytes.WithOrdinals == false) {

View File

@ -77,7 +77,7 @@ import static org.elasticsearch.index.query.AbstractQueryBuilder.parseInnerQuery
* @see org.elasticsearch.action.search.SearchRequest#source(SearchSourceBuilder) * @see org.elasticsearch.action.search.SearchRequest#source(SearchSourceBuilder)
*/ */
public final class SearchSourceBuilder implements Writeable, ToXContentObject, Rewriteable<SearchSourceBuilder> { public final class SearchSourceBuilder implements Writeable, ToXContentObject, Rewriteable<SearchSourceBuilder> {
private static final DeprecationLogger DEPRECATION_LOGGER = private static final DeprecationLogger deprecationLogger =
new DeprecationLogger(LogManager.getLogger(SearchSourceBuilder.class)); new DeprecationLogger(LogManager.getLogger(SearchSourceBuilder.class));
public static final ParseField FROM_FIELD = new ParseField("from"); public static final ParseField FROM_FIELD = new ParseField("from");
@ -1052,7 +1052,7 @@ public final class SearchSourceBuilder implements Writeable, ToXContentObject, R
scriptFields.add(new ScriptField(parser)); scriptFields.add(new ScriptField(parser));
} }
} else if (INDICES_BOOST_FIELD.match(currentFieldName, parser.getDeprecationHandler())) { } else if (INDICES_BOOST_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
DEPRECATION_LOGGER.deprecated( deprecationLogger.deprecated(
"Object format in indices_boost is deprecated, please use array format instead"); "Object format in indices_boost is deprecated, please use array format instead");
while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) { while ((token = parser.nextToken()) != XContentParser.Token.END_OBJECT) {
if (token == XContentParser.Token.FIELD_NAME) { if (token == XContentParser.Token.FIELD_NAME) {

View File

@ -55,7 +55,7 @@ import java.util.stream.Collectors;
*/ */
public final class DocValueFieldsFetchSubPhase implements FetchSubPhase { public final class DocValueFieldsFetchSubPhase implements FetchSubPhase {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger( private static final DeprecationLogger deprecationLogger = new DeprecationLogger(
LogManager.getLogger(DocValueFieldsFetchSubPhase.class)); LogManager.getLogger(DocValueFieldsFetchSubPhase.class));
@Override @Override
@ -82,7 +82,7 @@ public final class DocValueFieldsFetchSubPhase implements FetchSubPhase {
List<String> noFormatFields = context.docValueFieldsContext().fields().stream().filter(f -> f.format == null).map(f -> f.field) List<String> noFormatFields = context.docValueFieldsContext().fields().stream().filter(f -> f.format == null).map(f -> f.field)
.collect(Collectors.toList()); .collect(Collectors.toList());
if (noFormatFields.isEmpty() == false) { if (noFormatFields.isEmpty() == false) {
DEPRECATION_LOGGER.deprecated("There are doc-value fields which are not using a format. The output will " deprecationLogger.deprecated("There are doc-value fields which are not using a format. The output will "
+ "change in 7.0 when doc value fields get formatted based on mappings by default. It is recommended to pass " + "change in 7.0 when doc value fields get formatted based on mappings by default. It is recommended to pass "
+ "[format={}] with a doc value field in order to opt in for the future behaviour and ease the migration to " + "[format={}] with a doc value field in order to opt in for the future behaviour and ease the migration to "
+ "7.0: {}", DocValueFieldsContext.USE_DEFAULT_FORMAT, noFormatFields); + "7.0: {}", DocValueFieldsContext.USE_DEFAULT_FORMAT, noFormatFields);

View File

@ -50,7 +50,7 @@ import static org.elasticsearch.search.sort.NestedSortBuilder.NESTED_FIELD;
* A sort builder to sort based on a document field. * A sort builder to sort based on a document field.
*/ */
public class FieldSortBuilder extends SortBuilder<FieldSortBuilder> { public class FieldSortBuilder extends SortBuilder<FieldSortBuilder> {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(FieldSortBuilder.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(FieldSortBuilder.class));
public static final String NAME = "field_sort"; public static final String NAME = "field_sort";
public static final ParseField MISSING = new ParseField("missing"); public static final ParseField MISSING = new ParseField("missing");
@ -402,14 +402,14 @@ public class FieldSortBuilder extends SortBuilder<FieldSortBuilder> {
static { static {
PARSER.declareField(FieldSortBuilder::missing, p -> p.objectText(), MISSING, ValueType.VALUE); PARSER.declareField(FieldSortBuilder::missing, p -> p.objectText(), MISSING, ValueType.VALUE);
PARSER.declareString((fieldSortBuilder, nestedPath) -> { PARSER.declareString((fieldSortBuilder, nestedPath) -> {
DEPRECATION_LOGGER.deprecated("[nested_path] has been deprecated in favor of the [nested] parameter"); deprecationLogger.deprecated("[nested_path] has been deprecated in favor of the [nested] parameter");
fieldSortBuilder.setNestedPath(nestedPath); fieldSortBuilder.setNestedPath(nestedPath);
}, NESTED_PATH_FIELD); }, NESTED_PATH_FIELD);
PARSER.declareString(FieldSortBuilder::unmappedType , UNMAPPED_TYPE); PARSER.declareString(FieldSortBuilder::unmappedType , UNMAPPED_TYPE);
PARSER.declareString((b, v) -> b.order(SortOrder.fromString(v)) , ORDER_FIELD); PARSER.declareString((b, v) -> b.order(SortOrder.fromString(v)) , ORDER_FIELD);
PARSER.declareString((b, v) -> b.sortMode(SortMode.fromString(v)), SORT_MODE); PARSER.declareString((b, v) -> b.sortMode(SortMode.fromString(v)), SORT_MODE);
PARSER.declareObject(FieldSortBuilder::setNestedFilter, (p, c) -> { PARSER.declareObject(FieldSortBuilder::setNestedFilter, (p, c) -> {
DEPRECATION_LOGGER.deprecated("[nested_filter] has been deprecated in favour for the [nested] parameter"); deprecationLogger.deprecated("[nested_filter] has been deprecated in favour for the [nested] parameter");
return SortBuilder.parseNestedFilter(p); return SortBuilder.parseNestedFilter(p);
}, NESTED_FILTER_FIELD); }, NESTED_FILTER_FIELD);
PARSER.declareObject(FieldSortBuilder::setNestedSort, (p, c) -> NestedSortBuilder.fromXContent(p), NESTED_FIELD); PARSER.declareObject(FieldSortBuilder::setNestedSort, (p, c) -> NestedSortBuilder.fromXContent(p), NESTED_FIELD);

View File

@ -72,7 +72,7 @@ import static org.elasticsearch.search.sort.NestedSortBuilder.NESTED_FIELD;
* A geo distance based sorting on a geo point like field. * A geo distance based sorting on a geo point like field.
*/ */
public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder> { public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder> {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(GeoDistanceSortBuilder.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(GeoDistanceSortBuilder.class));
public static final String NAME = "_geo_distance"; public static final String NAME = "_geo_distance";
public static final String ALTERNATIVE_NAME = "_geoDistance"; public static final String ALTERNATIVE_NAME = "_geoDistance";
@ -502,7 +502,7 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
fieldName = currentName; fieldName = currentName;
} else if (token == XContentParser.Token.START_OBJECT) { } else if (token == XContentParser.Token.START_OBJECT) {
if (NESTED_FILTER_FIELD.match(currentName, parser.getDeprecationHandler())) { if (NESTED_FILTER_FIELD.match(currentName, parser.getDeprecationHandler())) {
DEPRECATION_LOGGER.deprecated("[nested_filter] has been deprecated in favour of the [nested] parameter"); deprecationLogger.deprecated("[nested_filter] has been deprecated in favour of the [nested] parameter");
nestedFilter = parseInnerQueryBuilder(parser); nestedFilter = parseInnerQueryBuilder(parser);
} else if (NESTED_FIELD.match(currentName, parser.getDeprecationHandler())) { } else if (NESTED_FIELD.match(currentName, parser.getDeprecationHandler())) {
nestedSort = NestedSortBuilder.fromXContent(parser); nestedSort = NestedSortBuilder.fromXContent(parser);
@ -532,7 +532,7 @@ public class GeoDistanceSortBuilder extends SortBuilder<GeoDistanceSortBuilder>
} else if (SORTMODE_FIELD.match(currentName, parser.getDeprecationHandler())) { } else if (SORTMODE_FIELD.match(currentName, parser.getDeprecationHandler())) {
sortMode = SortMode.fromString(parser.text()); sortMode = SortMode.fromString(parser.text());
} else if (NESTED_PATH_FIELD.match(currentName, parser.getDeprecationHandler())) { } else if (NESTED_PATH_FIELD.match(currentName, parser.getDeprecationHandler())) {
DEPRECATION_LOGGER.deprecated("[nested_path] has been deprecated in favour of the [nested] parameter"); deprecationLogger.deprecated("[nested_path] has been deprecated in favour of the [nested] parameter");
nestedPath = parser.text(); nestedPath = parser.text();
} else if (IGNORE_UNMAPPED.match(currentName, parser.getDeprecationHandler())) { } else if (IGNORE_UNMAPPED.match(currentName, parser.getDeprecationHandler())) {
ignoreUnmapped = parser.booleanValue(); ignoreUnmapped = parser.booleanValue();

View File

@ -66,7 +66,7 @@ import static org.elasticsearch.search.sort.NestedSortBuilder.NESTED_FIELD;
* Script sort builder allows to sort based on a custom script expression. * Script sort builder allows to sort based on a custom script expression.
*/ */
public class ScriptSortBuilder extends SortBuilder<ScriptSortBuilder> { public class ScriptSortBuilder extends SortBuilder<ScriptSortBuilder> {
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(ScriptSortBuilder.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(ScriptSortBuilder.class));
public static final String NAME = "_script"; public static final String NAME = "_script";
public static final ParseField TYPE_FIELD = new ParseField("type"); public static final ParseField TYPE_FIELD = new ParseField("type");
@ -279,11 +279,11 @@ public class ScriptSortBuilder extends SortBuilder<ScriptSortBuilder> {
PARSER.declareString((b, v) -> b.order(SortOrder.fromString(v)), ORDER_FIELD); PARSER.declareString((b, v) -> b.order(SortOrder.fromString(v)), ORDER_FIELD);
PARSER.declareString((b, v) -> b.sortMode(SortMode.fromString(v)), SORTMODE_FIELD); PARSER.declareString((b, v) -> b.sortMode(SortMode.fromString(v)), SORTMODE_FIELD);
PARSER.declareString((fieldSortBuilder, nestedPath) -> { PARSER.declareString((fieldSortBuilder, nestedPath) -> {
DEPRECATION_LOGGER.deprecated("[nested_path] has been deprecated in favor of the [nested] parameter"); deprecationLogger.deprecated("[nested_path] has been deprecated in favor of the [nested] parameter");
fieldSortBuilder.setNestedPath(nestedPath); fieldSortBuilder.setNestedPath(nestedPath);
}, NESTED_PATH_FIELD); }, NESTED_PATH_FIELD);
PARSER.declareObject(ScriptSortBuilder::setNestedFilter, (p, c) -> { PARSER.declareObject(ScriptSortBuilder::setNestedFilter, (p, c) -> {
DEPRECATION_LOGGER.deprecated("[nested_filter] has been deprecated in favour for the [nested] parameter"); deprecationLogger.deprecated("[nested_filter] has been deprecated in favour for the [nested] parameter");
return SortBuilder.parseNestedFilter(p); return SortBuilder.parseNestedFilter(p);
}, NESTED_FILTER_FIELD); }, NESTED_FILTER_FIELD);
PARSER.declareObject(ScriptSortBuilder::setNestedSort, (p, c) -> NestedSortBuilder.fromXContent(p), NESTED_FIELD); PARSER.declareObject(ScriptSortBuilder::setNestedSort, (p, c) -> NestedSortBuilder.fromXContent(p), NESTED_FIELD);

View File

@ -75,7 +75,7 @@ public class GeoContextMapping extends ContextMapping<GeoQueryContext> {
static final String CONTEXT_PRECISION = "precision"; static final String CONTEXT_PRECISION = "precision";
static final String CONTEXT_NEIGHBOURS = "neighbours"; static final String CONTEXT_NEIGHBOURS = "neighbours";
private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(LogManager.getLogger(GeoContextMapping.class)); private static final DeprecationLogger deprecationLogger = new DeprecationLogger(LogManager.getLogger(GeoContextMapping.class));
private final int precision; private final int precision;
private final String fieldName; private final String fieldName;
@ -293,7 +293,7 @@ public class GeoContextMapping extends ContextMapping<GeoQueryContext> {
MappedFieldType mappedFieldType = fieldResolver.apply(fieldName); MappedFieldType mappedFieldType = fieldResolver.apply(fieldName);
if (mappedFieldType == null) { if (mappedFieldType == null) {
if (indexVersionCreated.before(Version.V_7_0_0_alpha1)) { if (indexVersionCreated.before(Version.V_7_0_0_alpha1)) {
DEPRECATION_LOGGER.deprecatedAndMaybeLog("geo_context_mapping", deprecationLogger.deprecatedAndMaybeLog("geo_context_mapping",
"field [{}] referenced in context [{}] is not defined in the mapping", fieldName, name); "field [{}] referenced in context [{}] is not defined in the mapping", fieldName, name);
} else { } else {
throw new ElasticsearchParseException( throw new ElasticsearchParseException(
@ -301,7 +301,7 @@ public class GeoContextMapping extends ContextMapping<GeoQueryContext> {
} }
} else if (GeoPointFieldMapper.CONTENT_TYPE.equals(mappedFieldType.typeName()) == false) { } else if (GeoPointFieldMapper.CONTENT_TYPE.equals(mappedFieldType.typeName()) == false) {
if (indexVersionCreated.before(Version.V_7_0_0_alpha1)) { if (indexVersionCreated.before(Version.V_7_0_0_alpha1)) {
DEPRECATION_LOGGER.deprecatedAndMaybeLog("geo_context_mapping", deprecationLogger.deprecatedAndMaybeLog("geo_context_mapping",
"field [{}] referenced in context [{}] must be mapped to geo_point, found [{}]", "field [{}] referenced in context [{}] must be mapped to geo_point, found [{}]",
fieldName, name, mappedFieldType.typeName()); fieldName, name, mappedFieldType.typeName());
} else { } else {

View File

@ -5,6 +5,7 @@
*/ */
package org.elasticsearch.xpack.ml.job; package org.elasticsearch.xpack.ml.job;
import org.apache.logging.log4j.LogManager;
import org.elasticsearch.ResourceNotFoundException; import org.elasticsearch.ResourceNotFoundException;
import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.ActionListener;
import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.action.index.IndexResponse;
@ -19,7 +20,6 @@ import org.elasticsearch.common.CheckedConsumer;
import org.elasticsearch.common.Strings; import org.elasticsearch.common.Strings;
import org.elasticsearch.common.component.AbstractComponent; import org.elasticsearch.common.component.AbstractComponent;
import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.logging.DeprecationLogger;
import org.elasticsearch.common.logging.Loggers;
import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeUnit;
import org.elasticsearch.common.unit.ByteSizeValue; import org.elasticsearch.common.unit.ByteSizeValue;
@ -80,8 +80,8 @@ import java.util.stream.Collectors;
*/ */
public class JobManager extends AbstractComponent { public class JobManager extends AbstractComponent {
private static final DeprecationLogger DEPRECATION_LOGGER = private static final DeprecationLogger deprecationLogger =
new DeprecationLogger(Loggers.getLogger(JobManager.class)); new DeprecationLogger(LogManager.getLogger(JobManager.class));
private final Environment environment; private final Environment environment;
private final JobResultsProvider jobResultsProvider; private final JobResultsProvider jobResultsProvider;
@ -194,7 +194,7 @@ public class JobManager extends AbstractComponent {
Job job = request.getJobBuilder().build(new Date()); Job job = request.getJobBuilder().build(new Date());
if (job.getDataDescription() != null && job.getDataDescription().getFormat() == DataDescription.DataFormat.DELIMITED) { if (job.getDataDescription() != null && job.getDataDescription().getFormat() == DataDescription.DataFormat.DELIMITED) {
DEPRECATION_LOGGER.deprecated("Creating jobs with delimited data format is deprecated. Please use xcontent instead."); deprecationLogger.deprecated("Creating jobs with delimited data format is deprecated. Please use xcontent instead.");
} }
// pre-flight check, not necessarily required, but avoids figuring this out while on the CS update thread // pre-flight check, not necessarily required, but avoids figuring this out while on the CS update thread

View File

@ -22,7 +22,7 @@ import java.util.StringJoiner;
public final class DomainSplitFunction { public final class DomainSplitFunction {
private static final DeprecationLogger DEPRECATION_LOGGER = private static final DeprecationLogger deprecationLogger =
new DeprecationLogger(LogManager.getLogger(DomainSplitFunction.class)); new DeprecationLogger(LogManager.getLogger(DomainSplitFunction.class));
private static final int MAX_DOMAIN_PART_LENGTH = 63; private static final int MAX_DOMAIN_PART_LENGTH = 63;
@ -163,7 +163,7 @@ public final class DomainSplitFunction {
public static List<String> domainSplit(String host, Map<String, Object> params) { public static List<String> domainSplit(String host, Map<String, Object> params) {
// NOTE: we don't check SpecialPermission because this will be called (indirectly) from scripts // NOTE: we don't check SpecialPermission because this will be called (indirectly) from scripts
AccessController.doPrivileged((PrivilegedAction<Void>) () -> { AccessController.doPrivileged((PrivilegedAction<Void>) () -> {
DEPRECATION_LOGGER.deprecatedAndMaybeLog("domainSplit", deprecationLogger.deprecatedAndMaybeLog("domainSplit",
"Method [domainSplit] taking params is deprecated. Remove the params argument."); "Method [domainSplit] taking params is deprecated. Remove the params argument.");
return null; return null;
}); });