XStream

JSON is not escaped according to RFC 4627 in JsonHierarchicalStreamDriver

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.2.2
  • Fix Version/s: 1.3
  • Component/s: IO
  • Labels:
    None
  • JDK version and platform:
    Sun 1.6.0 update1 Linux

Description

JSON is not escaped according to RFC 4627 when using the JsonHierarchicalStreamDriver.

Object values and even valid Java Identifier (field names) can contain
characters which have to be escaped (see RFC 4627 and JLS), the original
code escaped only object values and not identifier names.
Furthermore only '"' and '
' were escaped which is not enough.
Unicode code positions \u0000 to \u001f need to be escaped, too.
See attached patch.

JettisonMappedXmlDriver did not have this bug, I added a testcase very similar to that of JsonHierarchicalStreamDriver though.

Activity

Hide
Joerg Schaible added a comment -

Fixed in head revision. I used a JDK 1.4 compatible implementation though
Thanks!

Show
Joerg Schaible added a comment - Fixed in head revision. I used a JDK 1.4 compatible implementation though Thanks!
Hide
Joerg Schaible added a comment -

Closing issues before next release.

Show
Joerg Schaible added a comment - Closing issues before next release.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: