Skip to content

Commit c3fdf4e

Browse files
committed
Issue #145 remove dead code and stale docs from backport
- Delete unannotated dead TestJsonLiteral.conversionTest() (upstream-faithful; assertions already covered by live booleanOfTest()) - Wire ReadmeExamples into ReadmeExamplesTest so the README.md and index.html promise of a runnable examples class is test-enforced (exp_tests 1675 -> 1676) - ApiTracker: delete unreachable NOT_IMPLEMENTED/PARSE_NOT_IMPLEMENTED status path (nothing produces that status) and fix discoverLocalJsonClasses javadoc to match the actual packages list - ApiTrackerRunner: delete parsed-but-ignored binary|source mode and sourcepath args; both workflows invoke with only the log level argument - LazyConstant: drop stale comment referencing the removed StableValue polyfill - Remove 15 unused imports across jtd, jtd-codegen, jsonpath and compatibility suite sources - Delete 8 stray pom.xml.versionsBackup files (untracked; .gitignore already covers the pattern) Verify: mvnd clean verify green; surefire totals tests=1676 failures=0 errors=0 skipped=0.
1 parent 2155903 commit c3fdf4e

17 files changed

Lines changed: 68 additions & 44 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
for k in totals: totals[k]+=int(r.get(k,'0'))
4040
except Exception:
4141
pass
42-
exp_tests=1675
42+
exp_tests=1676
4343
exp_skipped=0
4444
if totals['tests']!=exp_tests or totals['skipped']!=exp_skipped:
4545
print(f"Unexpected test totals: {totals} != expected tests={exp_tests}, skipped={exp_skipped}")

‎json-compatibility-suite/src/test/java/jdk/incubator/compatibility/DownloadVerificationTest.java‎

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

33
import org.junit.jupiter.api.Test;
4-
import java.nio.file.Files;
54
import java.nio.file.Path;
65
import java.nio.file.Paths;
76
import static org.assertj.core.api.Assertions.assertThat;

‎json-java21-api-tracker/src/main/java/io/github/simbo1905/tracker/ApiTracker.java‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ static String fetchFromUrl(String url) {
9797
}
9898

9999
/// Discovers all classes in the local JSON API packages
100-
/// @return sorted set of classes from jdk.incubator.java.util.json and jdk.incubator.internal.util.json
100+
/// @return sorted set of classes from jdk.incubator.java.util.json
101101
static Set<Class<?>> discoverLocalJsonClasses() {
102102
LOGGER.info("Starting class discovery for JSON API packages");
103103
final var classes = new TreeSet<Class<?>>(Comparator.comparing(Class::getName));
@@ -610,15 +610,6 @@ static JsonObject compareApis(JsonObject local, JsonObject upstream) {
610610
return JsonObject.of(diffMap);
611611
}
612612

613-
// Check if status is NOT_IMPLEMENTED (from parsing)
614-
if (upstream.asMap().containsKey("status")) {
615-
final var status = ((JsonString) upstream.asMap().get("status")).asString();
616-
if ("NOT_IMPLEMENTED".equals(status)) {
617-
diffMap.put("status", JsonString.of("PARSE_NOT_IMPLEMENTED"));
618-
return JsonObject.of(diffMap);
619-
}
620-
}
621-
622613
// Perform detailed comparison
623614
final var differences = new ArrayList<JsonValue>();
624615
var hasChanges = false;

‎json-java21-api-tracker/src/main/java/io/github/simbo1905/tracker/ApiTrackerRunner.java‎

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,22 @@
1111

1212
/// Command-line runner for the API Tracker
1313
///
14-
/// Usage: java io.github.simbo1905.tracker.ApiTrackerRunner [loglevel] [mode] [sourcepath]
14+
/// Usage: java io.github.simbo1905.tracker.ApiTrackerRunner [loglevel]
1515
///
1616
/// Arguments:
1717
/// - loglevel: SEVERE, WARNING, INFO, FINE, FINER, FINEST (default: INFO)
18-
/// - mode: binary|source (default: binary)
19-
/// - binary: Compare binary reflection (local) vs source parsing (remote)
20-
/// - source: Compare source parsing (local) vs source parsing (remote) for accurate parameter names
21-
/// - sourcepath: Path to local source files (required for source mode)
2218
@SuppressWarnings("JavadocReference")
2319
public class ApiTrackerRunner {
2420

2521
public static void main(String[] args) {
2622
// Parse command line arguments
2723
final var logLevel = args.length > 0 ? Level.parse(args[0].toUpperCase()) : Level.INFO;
28-
final var mode = args.length > 1 ? args[1].toLowerCase() : "binary";
29-
final var sourcePath = args.length > 2 ? args[2] : null;
3024

3125
configureLogging(logLevel);
3226

3327
System.out.println("=== JSON API Tracker ===");
3428
System.out.println("Comparing local jdk.incubator.java.util.json with upstream jdk.incubator.json");
3529
System.out.println("Log level: " + logLevel);
36-
System.out.println("Mode: " + mode);
37-
if (sourcePath != null) {
38-
System.out.println("Local source path: " + sourcePath);
39-
}
4030
System.out.println();
4131

4232
try {

‎json-java21-jsonpath/src/test/java/json/java21/jsonpath/JsonPathParserTest.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
package json.java21.jsonpath;
22

3-
import jdk.incubator.java.util.json.Json;
4-
import jdk.incubator.java.util.json.JsonValue;
53
import org.junit.jupiter.api.Test;
64
import org.junit.jupiter.params.ParameterizedTest;
75
import org.junit.jupiter.params.provider.ValueSource;

‎json-java21-jtd-codegen/src/main/java/json/java21/jtd/codegen/EmitDiscriminator.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.lang.classfile.CodeBuilder;
44
import java.lang.classfile.TypeKind;
5-
import java.lang.constant.ConstantDescs;
65

76
import json.java21.jtd.JtdSchema;
87

‎json-java21-jtd-codegen/src/main/java/json/java21/jtd/codegen/EmitNode.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.lang.classfile.CodeBuilder;
44
import java.lang.classfile.TypeKind;
5-
import java.lang.constant.ConstantDescs;
65
import java.util.logging.Logger;
76

87
import json.java21.jtd.JtdSchema;

‎json-java21-jtd-codegen/src/main/java/json/java21/jtd/codegen/EmitType.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import java.lang.classfile.CodeBuilder;
44
import java.lang.classfile.TypeKind;
5-
import java.lang.constant.ConstantDescs;
65

76
import static json.java21.jtd.codegen.Descriptors.*;
87

‎json-java21-jtd-codegen/src/main/java/json/java21/jtd/codegen/JtdCodegen.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import java.lang.classfile.*;
44
import java.lang.classfile.attribute.SourceFileAttribute;
55
import java.lang.constant.ClassDesc;
6-
import java.lang.constant.ConstantDescs;
7-
import java.lang.constant.MethodTypeDesc;
86
import java.lang.invoke.MethodHandles;
97
import java.util.concurrent.atomic.AtomicLong;
108
import java.util.logging.Logger;

‎json-java21-jtd/src/test/java/json/java21/jtd/JtdSpecConformanceTest.java‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import java.io.IOException;
1313
import java.nio.charset.StandardCharsets;
1414
import java.util.Comparator;
15-
import java.util.List;
1615
import java.util.stream.Stream;
1716

1817
import static org.assertj.core.api.Assertions.assertThat;

0 commit comments

Comments
 (0)