diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonMapper.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonMapper.java index 4d660916519..83293b8853b 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonMapper.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonMapper.java @@ -33,6 +33,8 @@ import java.io.IOException; @ThreadSafe public interface JsonMapper extends ToJson { + public static final JsonMapper[] EMPTY_ARRAY = new JsonMapper[0]; + @NotThreadSafe public static class BuilderContext { private final JsonPath jsonPath; diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonObjectMapper.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonObjectMapper.java index f0bf7a00e0d..e839d9e0820 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonObjectMapper.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/mapper/json/JsonObjectMapper.java @@ -411,7 +411,7 @@ public class JsonObjectMapper implements JsonMapper, JsonIncludeInAllMapper { } @Override public void toJson(JsonBuilder builder, Params params) throws IOException { - toJson(builder, params, null); + toJson(builder, params, JsonMapper.EMPTY_ARRAY); } public void toJson(JsonBuilder builder, Params params, JsonMapper... additionalMappers) throws IOException {