You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Java] Fix JSON escaping of string characters, delimeters, etc.
Previously, there were several problems:
- (delimeters) single `char` values were output with single quotes, but this is not
valid JSON.
- (escaping) escaping was not implemented as per the specification in
Section 7 of RFC 8259. For example, special-cased control codes, e.g.,
`\b` were encoded as `\\` followed by `\b` rather than `\\` followed by
`b`. Also, the non-special-cased control characters were not encoded
using JSON's mechanism for doing so, e.g., `\u0020`.
- (numbers) Section 6 of the specification says "Numeric values that
cannot be represented in the grammar below (such as Infinity and NaN)
are not permitted." However, these were encoded as expressions of
numbers with multiple terms, e.g., `-1/0` for positive infinity. While
these are quite logical encodings of such "numbers", it is not valid
JSON. Therefore, I have kept the expressions, but enclosed them within
quotes.
Also, in this commit:
- Replaced custom compilation logic with Agrona's CompilerUtil. Note
that `CompilerUtil#compileOnDisk` is broken. I attempted to use it to
see if I could see classes in IntelliJ rather than just stack frames,
but it fails with an NPE.
0 commit comments