diff --git a/core/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java b/core/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java index 5274773b994..4976ec928b4 100644 --- a/core/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java +++ b/core/src/main/java/org/elasticsearch/common/xcontent/XContentBuilder.java @@ -886,6 +886,7 @@ public final class XContentBuilder implements BytesStream, Releasable { generator.writeNull(); return; } + assert false == value instanceof TimeValue : "Use timeValueField instead"; Class type = value.getClass(); Writer writer = MAP.get(type); if (writer != null) {