Skip to content

StringBuilder and StringBuffer values are unquoted #104

Open
@GoogleCodeExporter

Description

@GoogleCodeExporter
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 pft...@gmail.com on 5 Feb 2015 at 11:21

Attachments:

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions