On Mon, 17 Aug 2026 21:49:53 GMT, Naoto Sato <[email protected]> wrote:

>> This PR implements [JEP 540: Simple JSON API 
>> (Incubator)](https://openjdk.org/jeps/540).
>> 
>> It adds the `jdk.incubator.json` module which provides APIs for reading and 
>> writing JSON documents as specified by [RFC 
>> 8259](https://datatracker.ietf.org/doc/html/rfc8259). This is an incubating 
>> API.
>> 
>> API documentation: 
>> https://cr.openjdk.org/~naoto/json/javadoc/api/jdk.incubator.json/module-summary.html
>> Co-authored-by: Justin Lu 
>> ([@justin-curtis-lu](https://github.com/justin-curtis-lu))
>> 
>> ---------
>> - [x] I confirm that I make this contribution in accordance with the 
>> [OpenJDK Interim AI Policy](https://openjdk.org/legal/ai).
>
> Naoto Sato has updated the pull request with a new target base due to a merge 
> or a rebase. The pull request now contains 741 commits:
> 
>  - Merge remote-tracking branch 'jdk-sandbox/json' into 
> JDK-8381976-Implementation-for-Simple-JSON-API
>  - Clarifications for behavior of JsonString.of
>  - Make Utils.toPath iterative
>  - consolidated append('\\')
>  - in.clone()
>  - Reflecting comments
>  - Tests for non-sealed sub-interfaces
>  - Clean up duplicate member name message on parsing
>  - Ensure that JS created from factory do not produce faulty paths
>  - Minor Javadoc cleanup as pointed out in review
>  - ... and 731 more: https://git.openjdk.org/jdk/compare/f5a59340...5f7263b9

Chars don’t need `"` to be escaped:

src/jdk.incubator.json/share/classes/jdk/incubator/json/Json.java line 157:

> 155:             map.forEach((name, val) -> {
> 156:                 s.append(indent.repeat(depth + 1))
> 157:                     .append('\"')

Suggestion:

                    .append('"')

src/jdk.incubator.json/share/classes/jdk/incubator/json/impl/JsonObjectImpl.java
 line 94:

> 92:         for (var kv: map.entrySet()) {
> 93:             // Escape the key (which is stored as unescaped) to conform 
> to JSON syntax
> 94:             s.append('\"').append(Utils.escape(kv.getKey())).append("\":")

Suggestion:

            s.append('"').append(Utils.escape(kv.getKey())).append("":")

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

PR Review: https://git.openjdk.org/jdk/pull/32282#pullrequestreview-4956419857
PR Review Comment: https://git.openjdk.org/jdk/pull/32282#discussion_r3800386727
PR Review Comment: https://git.openjdk.org/jdk/pull/32282#discussion_r3800389750

Reply via email to