After calling JsonTreeWriter.name(null), calling JsonTreeWriter.vule() will cause JsonTreeWriter.put(): IllegalStateException because of internal calling JsonTreeWriter.put(). So why not check if the param of name() is null? The check is done in super class！
The text was updated successfully, but these errors were encountered:
I think it is appropriate behavior that throw NullPointerException when name(null). Because It can help client discover problem early. It has done in super class. But it‘s poor that JsonTreeWriter.name() didn't do it when JsonTreeWriter.name() override it in super class.
(Note: your reply has the response in code ticks, while the code is in normal text formatting - it's switched around for some reason)
I'll look more at the relevant areas of the code and most likely make a pull request; I agree that it makes sense for the behavior here to be consistent with the superclass unless there is a demonstrable use case in which the inconsistent behavior is necessary.