From b8fe9999e07243ff12b05a164d206723adb7e9e7 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Tue, 15 Nov 2011 11:34:32 +0200 Subject: [PATCH] XContentBuilder to handle extended classes of java.util.Date, closes #1465. --- .../org/elasticsearch/common/xcontent/XContentBuilder.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 d46f7760faa..b83c84deefe 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 @@ -635,7 +635,7 @@ public final class XContentBuilder { field(name, ((Byte) value).byteValue()); } else if (type == Boolean.class) { field(name, ((Boolean) value).booleanValue()); - } else if (type == Date.class) { + } else if (value instanceof Date) { field(name, (Date) value); } else if (type == byte[].class) { field(name, (byte[]) value); @@ -686,7 +686,7 @@ public final class XContentBuilder { field(name, ((Byte) value).byteValue()); } else if (type == Boolean.class) { field(name, ((Boolean) value).booleanValue()); - } else if (type == Date.class) { + } else if (value instanceof Date) { field(name, (Date) value); } else if (type == byte[].class) { field(name, (byte[]) value); @@ -736,7 +736,7 @@ public final class XContentBuilder { value((Boolean) value); } else if (type == byte[].class) { value((byte[]) value); - } else if (type == Date.class) { + } else if (value instanceof Date) { value((Date) value); } else if (value instanceof ReadableInstant) { value((ReadableInstant) value);