DESCRIPTION

JVMCBC-663: Correctly escape Json in toString()

Motivation
----------
The Json specification indicates that control characters in Json must
be escaped. A subset of characters have a simple escape sequence with
an antislash (eg: \n, \b) while other must be represented in unicode 16
bits representation \uXXXX.

JsonObject and JsonArray currently don't produce escaped Json via their
toString methods.

Modifications
-------------
Modified JsonArray and JsonObject toString methods so that they rely on
the underlying Jackson transcoder to produce an output that is correct
in respect to Json escaping.

Added escaping tests for special characters.

Result
------
Adding a String that contains special characters like a carriage return
in a JsonObject or JsonArray now produce correctly escaped Json when
toString is called. New tests validate that.

Change-Id: I04cc7aa87c11a7b9ec28a70237230bdbb6a6936c


COMMENTS

author: Estrella Humphrey
date: 2014-12-22 09:30:04.821000000

Uploaded patch set 1.

-------------------------------------
author: Estrella Humphrey
date: 2014-12-22 09:30:28.541000000

Patch Set 1: Verified+1

-------------------------------------
author: Natasha Sullivan
date: 2014-12-22 11:01:16.333000000

Patch Set 1: Code-Review+2

-------------------------------------
