From 793c6005ee863b5f28a146a804ad810ade76adb9 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Tue, 19 Apr 2016 23:29:28 +0200 Subject: [PATCH] Revert "fix toString" This reverts commit 935ccb13043e1064d512bc3a45ea12e7749f083a. --- .../elasticsearch/action/bulk/BulkItemResponse.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java b/core/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java index 7114c95713c..1062b397af5 100644 --- a/core/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java +++ b/core/src/main/java/org/elasticsearch/action/bulk/BulkItemResponse.java @@ -33,7 +33,6 @@ import org.elasticsearch.common.io.stream.Writeable; import org.elasticsearch.common.xcontent.StatusToXContent; import org.elasticsearch.common.xcontent.ToXContent; import org.elasticsearch.common.xcontent.XContentBuilder; -import org.elasticsearch.common.xcontent.json.JsonXContent; import org.elasticsearch.rest.RestStatus; import java.io.IOException; @@ -178,15 +177,7 @@ public class BulkItemResponse implements Streamable, StatusToXContent { @Override public String toString() { - // Can't use: Strings.toString(this) - // because missing start and end object - try { - XContentBuilder builder = JsonXContent.contentBuilder().startObject(); - toXContent(builder, ToXContent.EMPTY_PARAMS); - return builder.endObject().string(); - } catch (IOException e) { - throw new AssertionError("Cannot happen", e); - } + return Strings.toString(this); } }