Skip to content

Commit 1b868f5

Browse files
committed
Issue #145 mechanical package move jdk.sandbox to jdk.incubator
Mirror the upstream move of the JSON API from the jdk-sandbox into the jdk.incubator.json module as a pure token swap, no API changes: - git mv of jdk/sandbox source and test trees to jdk/incubator in json-java21 and json-compatibility-suite (34 files, history preserved) - global sed jdk.sandbox -> jdk.incubator and jdk/sandbox -> jdk/incubator across java, md, html, yml, py, pom and properties files in all modules - sync-process docs in json-java21/AGENTS.md and .github/copilot-instructions.md now name the new packages; api-tracker still maps jdk.incubator.java.util.json to the upstream raw path jdk/incubator/json Verify: mvn -B clean verify -DskipITs=false -> BUILD SUCCESS, 1355 tests, 0 failures, 0 errors, 0 skipped (matches the CI test-count assertion).
1 parent b1b928c commit 1b868f5

88 files changed

Lines changed: 273 additions & 273 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/copilot-instructions.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ return switch (jsonValue) {
8181
```
8282

8383
### Project Architecture
84-
- Core package: `jdk.sandbox.java.util.json`
85-
- Internal implementation: `jdk.sandbox.internal.util.json`
84+
- Core package: `jdk.incubator.java.util.json`
85+
- Internal implementation: `jdk.incubator.internal.util.json`
8686
- JSON Schema validator in separate module
8787
- Use appropriate logging configuration per module
8888

‎AGENTS.md‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ See `README.md` for user-facing commands. When running locally as an agent, use
151151
- `json-java21-api-tracker`: API evolution tracking utilities.
152152
- `json-compatibility-suite`: JSON Test Suite compatibility validation.
153153
- `json-java21-jtd`: JSON Type Definition (JTD) validator based on RFC 8927.
154-
- `json-java21-jsonpath`: JsonPath query engine over `jdk.sandbox.java.util.json` values.
154+
- `json-java21-jsonpath`: JsonPath query engine over `jdk.incubator.java.util.json` values.
155155

156156
Only when you are asked to work on a specific module, start by reading that module's `README.md`, then its `AGENTS.md`.
157157

158158
These modules are treated as separate subsystems; do not read their docs unless you are actively working on them. They are not interlinked and each depends only on the core `json-java21` API.
159159

160160
### Core Components
161161

162-
#### Public API (`jdk.sandbox.java.util.json`)
162+
#### Public API (`jdk.incubator.java.util.json`)
163163
- `Json`: Static utilities for parsing, formatting, and conversion.
164164
- `JsonValue`: Sealed root interface for all JSON types.
165165
- `JsonObject`: JSON objects (key-value pairs).
@@ -169,14 +169,14 @@ These modules are treated as separate subsystems; do not read their docs unless
169169
- `JsonBoolean`: JSON booleans.
170170
- `JsonNull`: JSON null.
171171

172-
IMPORTANT: This API **MUST NOT** deviate from the upstream jdk.sandbox repo which is will track.
172+
IMPORTANT: This API **MUST NOT** deviate from the upstream jdk.incubator repo which is will track.
173173

174-
#### Internal Implementation (`jdk.sandbox.internal.util.json`)
174+
#### Internal Implementation (`jdk.incubator.internal.util.json`)
175175
- `JsonParser`: Recursive descent JSON parser.
176176
- `Json*Impl`: Immutable implementations of `Json*` types.
177177
- `Utils`: Internal utilities and factory methods.
178178

179-
IMPORTANT: Bugs in upstream-derived core logic MUST be fixed upstream. Do not patch `jdk.sandbox.*` sources in this repo unless the user explicitly agrees (for example, to carry a temporary local backport while the upstream fix is in progress).
179+
IMPORTANT: Bugs in upstream-derived core logic MUST be fixed upstream. Do not patch `jdk.incubator.*` sources in this repo unless the user explicitly agrees (for example, to carry a temporary local backport while the upstream fix is in progress).
180180

181181
Only bugs in local, non-upstream code (for example, backporting shims/polyfills or other modules in this repo) should be fixed here using normal TDD.
182182

@@ -480,7 +480,7 @@ flowchart LR
480480
python3 - <<'PY'
481481
import os, sys, re
482482
src = 'updates/2025-09-04/upstream/jdk.internal.util.json'
483-
dst = 'json-java21/src/main/java/jdk/sandbox/internal/util/json'
483+
dst = 'json-java21/src/main/java/jdk/incubator/internal/util/json'
484484
def xform(text):
485485
# old old python3 stuff here
486486
print('OK')

‎README.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This repo is organized into the following modules:
1717
| `json-java21-jtd` | JTD (RFC 8927) stack-machine interpreter — ideal for infrequent config parsing and one-time validation | 21+ |
1818
| `json-java21-jtd-codegen` | Bytecode code generator for JTD schemas — ahead-of-time compiled validators for repeated hot-path validation | 24+ (auto-skipped on JDK 21) |
1919
| `jdt2jar` | CLI + distroless container to pre-compile JTD schemas into standalone validator JARs (eliminates JDK 24+ runtime requirement) | 24+ (auto-skipped on JDK 21) |
20-
| `json-java21-jsonpath` | JsonPath query engine over `jdk.sandbox.java.util.json` values (Goessner-style: filters, slices, recursive descent, unions) | 21+ |
20+
| `json-java21-jsonpath` | JsonPath query engine over `jdk.incubator.java.util.json` values (Goessner-style: filters, slices, recursive descent, unions) | 21+ |
2121
| `json-compatibility-suite` | JSON Test Suite conformance reporter (tests against [nst/JSONTestSuite](https://github.com/nst/JSONTestSuite)) | 21+ |
2222
| `json-java21-api-tracker` | Daily upstream API drift detector — fetches OpenJDK sandbox sources, compares public API signatures, reports differences | 25+ |
2323

@@ -31,7 +31,7 @@ To try the examples from this README, build the project and run the standalone e
3131

3232
```bash
3333
./mvnw package
34-
java -cp ./json-java21/target/test-classes/:./json-java21/target/classes/ jdk.sandbox.java.util.json.examples.ReadmeExamples
34+
java -cp ./json-java21/target/test-classes/:./json-java21/target/classes/ jdk.incubator.java.util.json.examples.ReadmeExamples
3535
```
3636

3737
## API Overview
@@ -307,7 +307,7 @@ The JSON compatibitlity tests in this repo suggest 99% conformance with a leadin
307307

308308
### CI: Upstream API Tracking
309309

310-
The `daily-api-tracker.yml` workflow runs daily at 02:00 UTC: it fetches the upstream `jdk.incubator.json` sources from the [jdk-sandbox `json` branch](https://github.com/openjdk/jdk-sandbox/tree/json) HEAD and compares public API signatures against the local `jdk.sandbox.java.util.json` classes. When they differ it creates a fingerprint-deduplicated "API drift detected" issue; reports are uploaded as workflow artifacts (`target/api-tracker/`) with 90-day retention. The check can also be run locally:
310+
The `daily-api-tracker.yml` workflow runs daily at 02:00 UTC: it fetches the upstream `jdk.incubator.json` sources from the [jdk-sandbox `json` branch](https://github.com/openjdk/jdk-sandbox/tree/json) HEAD and compares public API signatures against the local `jdk.incubator.java.util.json` classes. When they differ it creates a fingerprint-deduplicated "API drift detected" issue; reports are uploaded as workflow artifacts (`target/api-tracker/`) with 90-day retention. The check can also be run locally:
311311

312312
```bash
313313
$(command -v mvnd || command -v mvn || command -v ./mvnw) -pl json-java21-api-tracker exec:java \
@@ -361,7 +361,7 @@ Per **RFC 8927 (JSON Typedef)**, the empty schema `{}` is the **empty form** and
361361
362362
```java
363363
import json.java21.jtd.Jtd;
364-
import jdk.sandbox.java.util.json.*;
364+
import jdk.incubator.java.util.json.*;
365365

366366
JsonValue schema = Json.parse("{\"properties\":{\"name\":{\"type\":\"string\"}}}");
367367
JsonValue data = Json.parse("{\"name\":\"Alice\"}");
@@ -400,7 +400,7 @@ This repo also includes a JsonPath query engine (module `json-java21-jsonpath`),
400400
https://goessner.net/articles/JsonPath/
401401

402402
```java
403-
import jdk.sandbox.java.util.json.*;
403+
import jdk.incubator.java.util.json.*;
404404
import json.java21.jsonpath.JsonPath;
405405
import json.java21.jsonpath.JsonPathStreams;
406406

‎index.html‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ <h3>Maven</h3>
179179
</code></pre>
180180

181181
<h3>Parse and access</h3>
182-
<pre><code>import jdk.sandbox.java.util.json.*;
182+
<pre><code>import jdk.incubator.java.util.json.*;
183183

184184
JsonObject obj = (JsonObject) Json.parse("{\"name\":\"Alice\",\"age\":30}");
185185

@@ -199,7 +199,7 @@ <h2>What’s Included</h2>
199199
</div>
200200

201201
<h2>Record Mapping (explicit, typed)</h2>
202-
<pre><code>import jdk.sandbox.java.util.json.*;
202+
<pre><code>import jdk.incubator.java.util.json.*;
203203
import java.util.*;
204204

205205
record User(String name, String email, boolean active) {}
@@ -224,7 +224,7 @@ <h2>Record Mapping (explicit, typed)</h2>
224224
<h2>Run the README Examples</h2>
225225
<pre><code>mvn package
226226
java -cp ./json-java21/target/java.util.json-*.jar:./json-java21/target/test-classes \
227-
jdk.sandbox.java.util.json.examples.ReadmeExamples</code></pre>
227+
jdk.incubator.java.util.json.examples.ReadmeExamples</code></pre>
228228
<p class="meta">Replace <code>*</code> with the actual version number from the JAR filename.</p>
229229

230230
<h2>JSON Test Suite Compatibility</h2>
@@ -237,7 +237,7 @@ <h2>JSON Test Suite Compatibility</h2>
237237
<h2>JSON Type Definition (JTD) Validator</h2>
238238
<p class="meta">This repo includes an incubating JTD validator (RFC 8927) in module <code>json-java21-jtd</code>. Per RFC 8927, the empty schema <code>{}</code> accepts all JSON instances.</p>
239239
<pre><code>import json.java21.jtd.Jtd;
240-
import jdk.sandbox.java.util.json.*;
240+
import jdk.incubator.java.util.json.*;
241241

242242
JsonValue schema = Json.parse("""
243243
{

‎jdt2jar/src/main/java/json/java21/jdt2jar/Jdt2Jar.java‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package json.java21.jdt2jar;
22

3-
import jdk.sandbox.java.util.json.Json;
3+
import jdk.incubator.java.util.json.Json;
44
import json.java21.jtd.codegen.JtdCodegen;
55

66
import java.io.ByteArrayOutputStream;
@@ -158,8 +158,8 @@ private static void copyJarEntries(JarOutputStream out, Set<String> written, Pat
158158
}
159159

160160
private static boolean shouldCopyRuntime(String path) {
161-
return (path.startsWith("jdk/sandbox/java/util/json/")
162-
|| path.startsWith("jdk/sandbox/internal/util/json/")
161+
return (path.startsWith("jdk/incubator/java/util/json/")
162+
|| path.startsWith("jdk/incubator/internal/util/json/")
163163
|| path.startsWith("json/java21/jtd/"))
164164
&& !path.startsWith("json/java21/jtd/codegen/")
165165
|| path.startsWith("json/java21/jtd/codegen/JtdValidator.class")
@@ -202,7 +202,7 @@ private static void writeSourceFile(Path sourcePath, Options options) throws IOE
202202
final var source = """
203203
package %s;
204204
205-
import jdk.sandbox.java.util.json.JsonValue;
205+
import jdk.incubator.java.util.json.JsonValue;
206206
import json.java21.jtd.JtdValidationResult;
207207
import json.java21.jdt2jar.runtime.ValidatorMain;
208208

‎jdt2jar/src/main/java/json/java21/jdt2jar/runtime/ValidatorMain.java‎

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package json.java21.jdt2jar.runtime;
22

3-
import jdk.sandbox.java.util.json.Json;
4-
import jdk.sandbox.java.util.json.JsonObject;
5-
import jdk.sandbox.java.util.json.JsonParseException;
6-
import jdk.sandbox.java.util.json.JsonString;
7-
import jdk.sandbox.java.util.json.JsonValue;
3+
import jdk.incubator.java.util.json.Json;
4+
import jdk.incubator.java.util.json.JsonObject;
5+
import jdk.incubator.java.util.json.JsonParseException;
6+
import jdk.incubator.java.util.json.JsonString;
7+
import jdk.incubator.java.util.json.JsonValue;
88
import json.java21.jtd.JtdValidationResult;
99

1010
import java.io.IOException;
@@ -120,8 +120,8 @@ private static String readResourceString(String name) throws IOException {
120120

121121
private static JsonObject toJson(JtdValidationResult result) {
122122
return JsonObject.of(java.util.Map.of(
123-
"valid", jdk.sandbox.java.util.json.JsonBoolean.of(result.isValid()),
124-
"errors", jdk.sandbox.java.util.json.JsonArray.of(result.errors().stream()
123+
"valid", jdk.incubator.java.util.json.JsonBoolean.of(result.isValid()),
124+
"errors", jdk.incubator.java.util.json.JsonArray.of(result.errors().stream()
125125
.map(error -> JsonObject.of(java.util.Map.of(
126126
"instancePath", JsonString.of(error.instancePath()),
127127
"schemaPath", JsonString.of(error.schemaPath()))))

‎json-compatibility-suite/pom.xml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<artifactId>exec-maven-plugin</artifactId>
7474
<version>3.4.1</version>
7575
<configuration>
76-
<mainClass>jdk.sandbox.compatibility.JsonCompatibilitySummary</mainClass>
76+
<mainClass>jdk.incubator.compatibility.JsonCompatibilitySummary</mainClass>
7777
<includePluginDependencies>false</includePluginDependencies>
7878
</configuration>
7979
</plugin>

json-compatibility-suite/src/main/java/jdk/sandbox/compatibility/JsonCompatibilitySummary.java renamed to json-compatibility-suite/src/main/java/jdk/incubator/compatibility/JsonCompatibilitySummary.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package jdk.sandbox.compatibility;
1+
package jdk.incubator.compatibility;
22

3-
import jdk.sandbox.java.util.json.Json;
4-
import jdk.sandbox.java.util.json.JsonArray;
5-
import jdk.sandbox.java.util.json.JsonObject;
6-
import jdk.sandbox.java.util.json.JsonString;
7-
import jdk.sandbox.java.util.json.JsonNumber;
8-
import jdk.sandbox.java.util.json.JsonParseException;
3+
import jdk.incubator.java.util.json.Json;
4+
import jdk.incubator.java.util.json.JsonArray;
5+
import jdk.incubator.java.util.json.JsonObject;
6+
import jdk.incubator.java.util.json.JsonString;
7+
import jdk.incubator.java.util.json.JsonNumber;
8+
import jdk.incubator.java.util.json.JsonParseException;
99

1010
import java.nio.charset.MalformedInputException;
1111
import java.nio.charset.StandardCharsets;

json-compatibility-suite/src/main/java/jdk/sandbox/compatibility/RobustCharDecoder.java renamed to json-compatibility-suite/src/main/java/jdk/incubator/compatibility/RobustCharDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package jdk.sandbox.compatibility;
1+
package jdk.incubator.compatibility;
22

33
import java.nio.ByteBuffer;
44
import java.nio.CharBuffer;

json-compatibility-suite/src/test/java/jdk/sandbox/compatibility/DownloadVerificationTest.java renamed to json-compatibility-suite/src/test/java/jdk/incubator/compatibility/DownloadVerificationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package jdk.sandbox.compatibility;
1+
package jdk.incubator.compatibility;
22

33
import org.junit.jupiter.api.Test;
44
import java.nio.file.Files;

0 commit comments

Comments
 (0)