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!