You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "David Bosschaert (JIRA)" <ji...@apache.org> on 2017/02/24 12:12:44 UTC
[jira] [Resolved] (FELIX-5555) JSONParser is not handling escape
char properly
[ https://issues.apache.org/jira/browse/FELIX-5555?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
David Bosschaert resolved FELIX-5555.
-------------------------------------
Resolution: Fixed
Should be fixed in https://svn.apache.org/viewvc?view=revision&revision=1784269
I added a few additional tests as well.
> JSONParser is not handling escape char properly
> -----------------------------------------------
>
> Key: FELIX-5555
> URL: https://issues.apache.org/jira/browse/FELIX-5555
> Project: Felix
> Issue Type: Bug
> Components: Utils
> Affects Versions: utils-1.9.0
> Reporter: Chetan Mehrotra
> Assignee: David Bosschaert
> Fix For: utils-1.9.2
>
>
> {{JSONWriter}} currently adds an escape char for '/'. So "foo=/bar" is rendered as
> {noformat}
> {"foo":"\/bar"}
> {noformat}
> When such a json is read via {{JSONParser}} then the '\' is not removed
> Following test fails
> {code}
> @Test
> public void escapeChar() throws Exception{
> StringWriter sw = new StringWriter();
> JSONWriter js = new JSONWriter(sw);
> js.object().key("foo").value("/bar").endObject().flush();
>
> JSONParser jp = new JSONParser(sw.toString());
> assertEquals("/bar", jp.getParsed().get("foo"));
> }
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)