XStream
  1. XStream
  2. XSTR-411

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.

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Stefan Fleiter
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: