|
@@ -40,10 +40,20 @@ public class XContentHelper {
|
|
|
|
|
|
/**
|
|
|
* Creates a parser based on the bytes provided
|
|
|
- * @deprecated use {@link #createParser(NamedXContentRegistry, DeprecationHandler, BytesReference, XContentType)} to avoid content type auto-detection
|
|
|
+ * @deprecated this is a temporary shim and will be removed shortly
|
|
|
*/
|
|
|
@Deprecated
|
|
|
public static XContentParser createParser(NamedXContentRegistry xContentRegistry, BytesReference bytes) throws IOException {
|
|
|
+ return createParser(xContentRegistry, LoggingDeprecationHandler.INSTANCE, bytes);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Creates a parser based on the bytes provided
|
|
|
+ * @deprecated use {@link #createParser(NamedXContentRegistry, DeprecationHandler, BytesReference, XContentType)} to avoid content type auto-detection
|
|
|
+ */
|
|
|
+ @Deprecated
|
|
|
+ public static XContentParser createParser(NamedXContentRegistry xContentRegistry, DeprecationHandler deprecationHandler,
|
|
|
+ BytesReference bytes) throws IOException {
|
|
|
Compressor compressor = CompressorFactory.compressor(bytes);
|
|
|
if (compressor != null) {
|
|
|
InputStream compressedInput = compressor.streamInput(bytes.streamInput());
|
|
@@ -51,7 +61,7 @@ public class XContentHelper {
|
|
|
compressedInput = new BufferedInputStream(compressedInput);
|
|
|
}
|
|
|
final XContentType contentType = XContentFactory.xContentType(compressedInput);
|
|
|
- return XContentFactory.xContent(contentType).createParser(xContentRegistry, LoggingDeprecationHandler.INSTANCE, compressedInput);
|
|
|
+ return XContentFactory.xContent(contentType).createParser(xContentRegistry, deprecationHandler, compressedInput);
|
|
|
} else {
|
|
|
return XContentFactory.xContent(bytes).createParser(xContentRegistry, bytes.streamInput());
|
|
|
}
|