Don't allow XContentBuilder#writeValue(TimeValue)
We have specific support for writing `TimeValue`s in the form of `XContentBuilder#timeValueField`. Writing a `TimeValue` using `XContentBuilder#writeValue` is a bug waiting to happen.
This commit is contained in:
parent
dcaed58f90
commit
7f70c00dad
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue