-
Notifications
You must be signed in to change notification settings - Fork 25.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove deprecated createParser methods #28697
Conversation
This removes the final instances of the callers of `XContent.createParser` and `XContentHelper.createParser` that did not pass in the `DeprecationHandler`. It also removes the now-unused deprecated methods and fully removes any mention of Log4j or LoggingDeprecationHandler from the XContent code. Relates to elastic#28504
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Nice clean up!
@Deprecated | ||
default XContentParser createParser(NamedXContentRegistry xContentRegistry, Reader reader) throws IOException { | ||
return createParser(xContentRegistry, LoggingDeprecationHandler.INSTANCE, reader); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
@@ -316,7 +316,7 @@ public void writeRawField(String name, InputStream content, XContentType content | |||
if (mayWriteRawData(contentType) == false) { | |||
// EMPTY is safe here because we never call namedObject when writing raw data | |||
try (XContentParser parser = XContentFactory.xContent(contentType) | |||
.createParser(NamedXContentRegistry.EMPTY, LoggingDeprecationHandler.INSTANCE, content)) { | |||
.createParser(NamedXContentRegistry.EMPTY, DeprecationHandler.THROW_UNSUPPORTED_OPERATION, content)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an explanation why it's ok to throw an exception here might be helpful for future us.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I'll add a comment, good idea
* Remove deprecated createParser methods This removes the final instances of the callers of `XContent.createParser` and `XContentHelper.createParser` that did not pass in the `DeprecationHandler`. It also removes the now-unused deprecated methods and fully removes any mention of Log4j or LoggingDeprecationHandler from the XContent code. Relates to #28504 * Add comments in JsonXContentGenerator
This removes the final instances of the callers of
XContent.createParser
andXContentHelper.createParser
that did not pass in theDeprecationHandler
. Italso removes the now-unused deprecated methods and fully removes any mention of
Log4j or LoggingDeprecationHandler from the XContent code.
Relates to #28504