Un-deprecate NamedXContentRegistry.Entry constructor that takes a context (#23986)

We deprecated this method in the past because we thought it was a temporary thing that could go away over time. We radically trimmed down the usages of a context while parsing when we got rid of the ParseFieldMatcher, but the usages that are left are legit and we will hardly get rid of them. Also, working on aggs parsing we will need a context to carry around the aggregation name that gets parsed through XContentParser#namedObject .
This commit is contained in:
Luca Cavanna 2017-04-10 12:28:56 +02:00 committed by GitHub
parent b73f87b0ea
commit 9db8a266e6
1 changed files with 1 additions and 2 deletions

View File

@ -69,9 +69,8 @@ public class NamedXContentRegistry {
} }
/** /**
* Creates a new entry which can be stored by the registry. * Creates a new entry which can be stored by the registry.
* @deprecated prefer {@link Entry#Entry(Class, ParseField, CheckedFunction)}. Contexts will be removed when possible * Prefer {@link Entry#Entry(Class, ParseField, CheckedFunction)} unless you need a context to carry around while parsing.
*/ */
@Deprecated
public <T> Entry(Class<T> categoryClass, ParseField name, ContextParser<Object, ? extends T> parser) { public <T> Entry(Class<T> categoryClass, ParseField name, ContextParser<Object, ? extends T> parser) {
this.categoryClass = Objects.requireNonNull(categoryClass); this.categoryClass = Objects.requireNonNull(categoryClass);
this.name = Objects.requireNonNull(name); this.name = Objects.requireNonNull(name);