From 847938a88e7893dc5bfe3e5037b49169fe797932 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Mon, 12 Sep 2011 22:44:55 +0300 Subject: [PATCH] XContentBuilder.field : StackOverflowError with Integer[] parameters, closes #1324. --- .../common/xcontent/XContentBuilder.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java b/modules/elasticsearch/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java index 7e585255e17..d46f7760faa 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java @@ -513,6 +513,7 @@ public final class XContentBuilder { return this; } + public XContentBuilder field(XContentBuilderString name, String... value) throws IOException { startArray(name); for (String o : value) { @@ -522,6 +523,24 @@ public final class XContentBuilder { return this; } + public XContentBuilder field(String name, Object... value) throws IOException { + startArray(name); + for (Object o : value) { + value(o); + } + endArray(); + return this; + } + + public XContentBuilder field(XContentBuilderString name, Object... value) throws IOException { + startArray(name); + for (Object o : value) { + value(o); + } + endArray(); + return this; + } + public XContentBuilder field(String name, int... value) throws IOException { startArray(name); for (Object o : value) {