Repository navigation
[2.x] Preserve count and length limits beyond int range - #1342
Conversation
|
Verified at |
Review notesThe main logic looks correct: the compare-operator rewrites are right, and Correctness
Cleanup
Tests
CHANGELOG: the entry's spacing differs from its neighbours, and it doesn't mention the argument-type change. |
Follow-up on the review notesThe review fixes are now on this branch (0d4801d, with head 42becb5 being an empty commit that refreshed the PR). I read the fix against my earlier notes and the findings are addressed. I did not re-run the tests myself. Fresh Java 8, 11, 17 and 21 CI jobs are queued, so CI is not yet verified on this head.
Remaining notes, non-blocking: |
Fixes #1334. Corresponding master PR: #1341.
Valid count limits such as
{"minItems":2147483648}currently wrap to different values. Preserve exact limits across all eight count and length keywords so this schema instead reports a minItems validation error with the original limit. Large maxima accept small instances, and min/maxContains remain ineffective without contains.Use a package-private count-limit representation with int comparisons for ordinary limits and a range marker for larger values. Keep large values as decimals without expanding exponents to integers; format large message arguments as strings to avoid exponent-sized MessageFormat expansion. Preserve ordinary Integer annotations, matching-index annotations, Unicode code-point length, and the protected MinPropertiesValidator.min field as a saturated int view. No reader changes are included.
Add 99 regression cases covering Draft 2019-09 and 2020-12, ordinary boundaries, limits above Integer.MAX_VALUE and Long.MAX_VALUE, integral decimal/exponent forms, applicability, annotations, and a 1e1000000000 limit. Update CHANGELOG.
Validation:
mvn -B -ntp -Dtest=Issue1334Test,Issue1292Test test: 117 passed on JDK 8.mvn -B -ntp clean verify: 9,083 tests, 15 skipped, no failures or errors, independently on JDK 8 and JDK 17.Remote CI is pending.