Re: [google-gson:2665]: Should JsonWriter be closed?

Skip to first unread message

Jake Wharton

Aug 13, 2018, 12:31:01 AM8/13/18
No. That instance is shared. Feel free to send a PR and update the Javadoc of that method to indicate this.

On Fri, Aug 10, 2018, 12:23 PM <> wrote:
When implementing the TypeAdapter#write(JsonWriter out, T value) (currently using Gson version 2.8.4), does the implementation need to close the JsonWriter?  I realize that the objects need to be opened and closed, etc, but I am not seeing any guidance in the documentation as to whether or not the implementations are expected to do this.

Examples do not showing doing this.  I ran into this consideration when trying to nest TypeAdapters.

You received this message because you are subscribed to the Google Groups "google-gson" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

Aug 13, 2018, 11:33:35 AM8/13/18
to google-gson
Great, thank you for the quick response!
Reply all
Reply to author
0 new messages