We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 110843f commit 0a415fbCopy full SHA for 0a415fb
server/src/main/java/org/elasticsearch/action/index/IndexRequest.java
@@ -425,8 +425,7 @@ public BytesReference source() {
425
public void setStructuredSource(ESONSource.ESONObject esonSource) {
426
this.useStructuredSource = true;
427
this.structuredSource = esonSource;
428
- try {
429
- XContentBuilder builder = XContentFactory.contentBuilder(contentType);
+ try (XContentBuilder builder = XContentFactory.contentBuilder(contentType)) {
430
ESONXContentSerializer.flattedToXContent(esonSource, builder, ToXContent.EMPTY_PARAMS);
431
source = BytesReference.bytes(builder);
432
} catch (IOException e) {
0 commit comments