On Tue, 18 Aug 2026 18:02:05 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 incrementally with four additional 
> commits since the last revision:
> 
>  - Merge remote-tracking branch 'jdk-sandbox/json' into 
> JDK-8381976-Implementation-for-Simple-JSON-API
>  - Use \u instead of 0x for code point prefix
>  - Get rid of StringBuilder.insert(0, ... in path building
>  - Reflects reviews

src/jdk.incubator.json/share/classes/jdk/incubator/json/JsonBoolean.java line 
42:

> 40:  * @since 28
> 41:  */
> 42: public non-sealed interface JsonBoolean extends JsonValue {

What is the rationale for leaving these interfaces `non-sealed`? While this 
allows anyone to implement `JsonValue` classes, it expands the API commitment 
significantly.

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

> 64:         Objects.requireNonNull(name);
> 65:         return switch (theMembers.get(name)) {
> 66:             case JsonValue jv -> jv;

An enhanced switch with pattern matching is convenient and easy to read but 
adds to startup time. Did we do this trade-off analysis?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/32282#discussion_r3813671236
PR Review Comment: https://git.openjdk.org/jdk/pull/32282#discussion_r3813699953

Reply via email to