You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When converting a StringBuilder or StringBuffer object to JSON the values are
not treated as strings and and not quoted in the resulting JSON string.
assertEquals("\"v\"", JSONValue.toJSONString(new StringBuilder("v")));
assertEquals("\"v\"", JSONValue.toJSONString(new StringBuffer("v")));
This can be easily fixed by treating StringBuilder and StringBuffer values as
strings.
See attached diff for the fix.
Original issue reported on code.google.com by [email protected] on 5 Feb 2015 at 11:21
Actually realised there is a more general fix that would take care of other
objects that need to be converted to strings (see attached diff
string_builder_diff_2.txt). This would mean any object not dealt with
explicitly would always be treated as a string value.
Original issue reported on code.google.com by
[email protected]
on 5 Feb 2015 at 11:21Attachments:
The text was updated successfully, but these errors were encountered: