meego / json-simple

Automatically exported from code.google.com/p/json-simple
Apache License 2.0
0 stars 0 forks source link

Maybe use CharSequence instead String in toJSONString? #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In toJSONString:

{{{
...
if(value instanceof String)
...
}}}

maybe use CharSequence:

{{{
...
if(value instanceof CharSequence)
...
}}}

Reason: GString( groovy strings), StringBuilder converted as toString()
without ""

Original issue reported on code.google.com by gkra...@gmail.com on 15 Nov 2009 at 2:15

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks for the suggestion. But we made a commitment to support JDK from version 
1.2
so we are very reluctant to use the CharSequence from 1.4... You can either 
make a
slight wrapping over GString or convert it to String (via Object.toString()) 
before
putting it to a Map/List.

Thanks.

Original comment by fangyid...@gmail.com on 30 Nov 2009 at 4:21