[ 
https://issues.apache.org/jira/browse/OAK-2389?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14291517#comment-14291517
 ] 

Thomas Mueller commented on OAK-2389:
-------------------------------------

>  Can we please document what encode() is for? It's not for JSON, as far as 
> can tell.

JsopBuilder.encode is documented ("Convert a string to a quoted Json literal 
using the correct escape sequences..."). It is for JSON, see usages of that 
method. I'm not sure if you mean another encode?

> I don't see "case" in the source

JsopBuilder.escape, line 289.

> I prefer the constants as they generate both more readable and more compact 
> output

I think the current "switch / case" actually generated more readable output 
than the array of substitution strings. But it is debatable, I understand.

> a test case that checks for round-tripping of broken surrogate pairs

OK, I will try that.

> potentially a fix for the encode() method

That's fixed now. It should be possible to write a test, I will try.

> does our standard build cover the persistent cache?

Not yet, I think. I opened OAK-2444 for that.

> if we did a test on the JCR level, do we have a way to disable a memory cache 
> (which might make problems in the persisted value invisible?)

Sorry I don't understand. Do you mean it prevents "real" tests for the 
persistent cache? Yes that's true. Probably testing with a small in-memory 
cache would help there.



> issues with JsopBuilder.encode and .escape
> ------------------------------------------
>
>                 Key: OAK-2389
>                 URL: https://issues.apache.org/jira/browse/OAK-2389
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>            Reporter: Julian Reschke
>         Attachments: OAK-2389-b.diff, OAK-2389.diff
>
>
> 1) escape() escapes many characters that do not need to be escaped (>127)
> 2) encode() does not encode many control characters that would need to be 
> escaped when read through a JSON parser.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to