Start switching to non-deprecated ParseField.match method#28487
Start switching to non-deprecated ParseField.match method#28487dakrone wants to merge 1 commit intoelastic:masterfrom
Conversation
This commit switches all the modules and server test code to use the non-deprecated `ParseField.match` method, passing in the logging deprecation handler. Relates to elastic#28449
|
This moved everything except for the |
nik9000
left a comment
There was a problem hiding this comment.
I think you should use the deprecation handler in the parser. That way we can decide how to handle deprecations at parser construction time. Which is the time when you know who sent you the request and you can reason about how to tell them about the deprecation. The way you have it now you will always use the LoggingDeprecationHandler in these locations regardless of how the parser was built which seems wrong.
| protected boolean token(String aggregationName, String currentFieldName, XContentParser.Token token, XContentParser parser, | ||
| Map<ParseField, Object> otherOptions) throws IOException { | ||
| if (MULTIVALUE_MODE_FIELD.match(currentFieldName)) { | ||
| if (MULTIVALUE_MODE_FIELD.match(currentFieldName, LoggingDeprecationHandler.INSTANCE)) { |
There was a problem hiding this comment.
I believe this should be
+ if (MULTIVALUE_MODE_FIELD.match(currentFieldName, parser.getDeprecationHandler())) {
Makes sense, I will re-open this with those since the history doesn't really make sense |
This commit switches all the modules and server test code to use the
non-deprecated
ParseField.matchmethod, passing in the logging deprecationhandler.
Relates to #28449