My favorites | Sign in
Project Logo
Project hosting will be READ-ONLY Wednesday at 8am PST due to brief network maintenance.
             
New issue | Search
for
| Advanced search | Search tips
Issue 52: Add 'Appendable' as a destination for Gson
4 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  inder123
Closed:  Nov 2008
Type-Enhancement
Priority-Medium


Sign in to add a comment
 
Reported by complexmath, Oct 01, 2008
Currently, Gson can generate a String or write to a Writer.  This can result in unnecessary temporary 
String objects when the user wants to embed Gson in a larger response.  Both StringBuilder and 
Writer share a common interface however: Appendable.  Since it is unlikely that the flush and close 
methods are called on Writer while serializing, consider either adding Appendable as a destination 
or replacing Writable with Appendable as the stream output type.
Comment 1 by damiancarrillo, Oct 06, 2008
Note that java.lang.Appendable first appeared in Java 1.5
Comment 2 by joel.leitch, Oct 13, 2008
(No comment was entered for this change.)
Labels: -Type-Defect Type-Enhancement
Comment 3 by inder123, Nov 26, 2008
Fixed in r315

Note that this breaks backwards binary compatibility while preserving backwards
source compatibility. This is so because we changed the toJson() method signatures
instead of adding new methods. However, since Appendable is a super class of Writer,
a simple recompilation of code should be sufficient. Since this bug fix will go in a
major release, this is acceptable.
Status: Fixed
Comment 4 by inder123, Nov 26, 2008
(No comment was entered for this change.)
Owner: inder123
Sign in to add a comment

Hosted by Google Code