|
| 1 | +# API Tracker Report - December 2, 2025 |
| 2 | + |
| 3 | +## Summary |
| 4 | + |
| 5 | +The API tracker was successfully run against the upstream OpenJDK sandbox JSON API (branch: `json`). |
| 6 | + |
| 7 | +**Status:** SIGNIFICANT API CHANGES DETECTED |
| 8 | + |
| 9 | +- **Total Classes:** 11 |
| 10 | +- **Matching Classes:** 4 (36%) |
| 11 | +- **Different API:** 7 (64%) |
| 12 | +- **Missing Upstream:** 0 |
| 13 | + |
| 14 | +## Key Findings |
| 15 | + |
| 16 | +The upstream has undergone substantial API evolution with **breaking changes** across multiple core classes. |
| 17 | + |
| 18 | +### 1. Json Class - Method Renaming (Breaking Change) |
| 19 | + |
| 20 | +The main API entry point has renamed its conversion methods: |
| 21 | + |
| 22 | +| Local (Current) | Upstream (New) | Impact | |
| 23 | +|-------------------|-----------------|--------------| |
| 24 | +| `fromUntyped()` | `toJson()` | Breaking | |
| 25 | +| `toUntyped()` | `fromJson()` | Breaking | |
| 26 | + |
| 27 | +**Migration Impact:** All code using these methods will need updates. |
| 28 | + |
| 29 | +### 2. JsonArray - API Expansion |
| 30 | + |
| 31 | +| Change Type | Method | Impact | |
| 32 | +|-------------|-------------|--------------| |
| 33 | +| Removed | `values()` | Breaking | |
| 34 | +| Added | `elements()`| Replacement | |
| 35 | +| Added | `array()` | New feature | |
| 36 | + |
| 37 | +### 3. JsonBoolean - Accessor Renamed |
| 38 | + |
| 39 | +| Local (Current) | Upstream (New) | Impact | |
| 40 | +|-----------------|----------------|----------| |
| 41 | +| `value()` | `bool()` | Breaking | |
| 42 | + |
| 43 | +### 4. JsonNumber - Major Refactoring |
| 44 | + |
| 45 | +Significant changes to number handling: |
| 46 | + |
| 47 | +**Removed Methods:** |
| 48 | +- `toNumber()` |
| 49 | +- `toBigDecimal()` |
| 50 | + |
| 51 | +**Added Methods:** |
| 52 | +- `number()` - returns JsonNumber itself |
| 53 | +- `toLong()` - direct long conversion |
| 54 | +- `toDouble()` - direct double conversion |
| 55 | + |
| 56 | +**Changed Methods:** |
| 57 | +- `of(BigDecimal)` → `of(long)` - Parameter type changed |
| 58 | + |
| 59 | +**Impact:** High - Affects all numeric value handling code. |
| 60 | + |
| 61 | +### 5. JsonObject - API Addition |
| 62 | + |
| 63 | +| Change Type | Method | Impact | |
| 64 | +|-------------|------------|-------------| |
| 65 | +| Added | `object()` | Non-breaking| |
| 66 | + |
| 67 | +### 6. JsonParseException - Error Reporting Changes |
| 68 | + |
| 69 | +| Local (Current) | Upstream (New) | Impact | |
| 70 | +|-------------------|----------------------|----------| |
| 71 | +| `getErrorRow()` | `getErrorLine()` | Breaking | |
| 72 | +| `getErrorColumn()`| `getErrorPosition()` | Breaking | |
| 73 | + |
| 74 | +### 7. JsonString - Accessor Renamed |
| 75 | + |
| 76 | +| Local (Current) | Upstream (New) | Impact | |
| 77 | +|-----------------|----------------|----------| |
| 78 | +| `value()` | `string()` | Breaking | |
| 79 | + |
| 80 | +## Unchanged Classes |
| 81 | + |
| 82 | +The following classes have no API changes: |
| 83 | +- `JsonAssertionException` |
| 84 | +- `JsonNull` |
| 85 | +- `JsonValue` |
| 86 | +- `package-info` |
| 87 | + |
| 88 | +## Impact Assessment |
| 89 | + |
| 90 | +### Breaking Changes Count: 7 classes affected |
| 91 | + |
| 92 | +1. **High Impact:** Json, JsonNumber |
| 93 | +2. **Medium Impact:** JsonArray, JsonParseException |
| 94 | +3. **Low Impact:** JsonBoolean, JsonString, JsonObject |
| 95 | + |
| 96 | +### Naming Conventions |
| 97 | + |
| 98 | +The upstream appears to be moving toward: |
| 99 | +- Shorter, more direct method names (`bool()` vs `value()`) |
| 100 | +- More specific type conversion methods (`toLong()`, `toDouble()`) |
| 101 | +- Better semantic naming (`fromJson/toJson` vs `fromUntyped/toUntyped`) |
| 102 | +- Consistent terminology (`line/position` vs `row/column`) |
| 103 | + |
| 104 | +## Recommendations |
| 105 | + |
| 106 | +1. **Do Not Update Immediately:** These are breaking changes requiring a major version bump |
| 107 | +2. **Create Migration Guide:** Document all API changes for users |
| 108 | +3. **Consider Deprecation Path:** Add deprecated methods pointing to new equivalents |
| 109 | +4. **Update Documentation:** Warn users about unstable upstream API |
| 110 | +5. **Monitor Upstream:** Check for stabilization signals before syncing |
| 111 | + |
| 112 | +## Technical Details |
| 113 | + |
| 114 | +- **Timestamp:** 2025-12-02T15:21:49.231451636Z |
| 115 | +- **Local Package:** jdk.sandbox.java.util.json |
| 116 | +- **Upstream Package:** java.util.json |
| 117 | +- **Upstream Source:** https://github.com/openjdk/jdk-sandbox/tree/json |
| 118 | +- **Runtime Java Version:** 21.0.9 |
| 119 | +- **Comparison Duration:** 1.377 seconds |
| 120 | + |
| 121 | +## Next Steps |
| 122 | + |
| 123 | +1. ✅ Document the upstream changes (this file) |
| 124 | +2. ⏳ Wait for upstream API stabilization |
| 125 | +3. ⏳ Create tracking issue for future sync |
| 126 | +4. ⏳ Plan migration strategy when upstream stabilizes |
| 127 | +5. ⏳ Consider maintaining compatibility shims |
| 128 | + |
| 129 | +## Conclusion |
| 130 | + |
| 131 | +The upstream OpenJDK sandbox JSON API is actively evolving with significant breaking changes. This backport should remain on the current API until upstream shows signs of stabilization. Users should be aware that this is an experimental API subject to change. |
0 commit comments