XContentBuilder to handle extended classes of java.util.Date, closes #1465.

This commit is contained in:
Shay Banon 2011-11-15 11:34:32 +02:00
parent abaf4b5196
commit b8fe9999e0
1 changed files with 3 additions and 3 deletions

View File

@ -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);