Skip to content

Commit

Permalink
Do not use log4j deprecation handler
Browse files Browse the repository at this point in the history
  • Loading branch information
dimitris-athanasiou committed Aug 28, 2018
1 parent 87aa557 commit 39fff7c
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import org.elasticsearch.common.Strings;
import org.elasticsearch.common.xcontent.ContextParser;
import org.elasticsearch.common.xcontent.LoggingDeprecationHandler;
import org.elasticsearch.common.xcontent.DeprecationHandler;
import org.elasticsearch.common.xcontent.NamedXContentRegistry;
import org.elasticsearch.common.xcontent.ToXContentObject;
import org.elasticsearch.common.xcontent.XContentBuilder;
Expand Down Expand Up @@ -50,7 +50,7 @@ public static ContextParser<Void, RuleScope> parser() {
Map<String, ?> value = (Map<String, ?>) entry.getValue();
builder.map(value);
try (XContentParser scopeParser = XContentFactory.xContent(builder.contentType()).createParser(
NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, Strings.toString(builder))) {
NamedXContentRegistry.EMPTY, DEPRECATION_HANDLER, Strings.toString(builder))) {
scope.put(entry.getKey(), FilterRef.PARSER.parse(scopeParser, null));
}
}
Expand All @@ -59,6 +59,15 @@ public static ContextParser<Void, RuleScope> parser() {
};
}

private static final DeprecationHandler DEPRECATION_HANDLER = new DeprecationHandler() {

@Override
public void usedDeprecatedName(String usedName, String modernName) {}

@Override
public void usedDeprecatedField(String usedName, String replacedWith) {}
};

private final Map<String, FilterRef> scope;

public RuleScope() {
Expand Down

0 comments on commit 39fff7c

Please sign in to comment.