Skip to content

Clarify date-time fallback docs and simplify parsing (#1337) - #1338

Merged
stevehu merged 2 commits into
masterfrom
fix/1337-date-time-follow-ups
Oct 21, 2026
Merged

stevehu merged 2 commits into
masterfrom
fix/1337-date-time-follow-ups

Conversation

@stevehu

@stevehu stevehu commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Correct the time changelog entry: missing seconds were already rejected. Describe the RFC 3339 fallback in README and document its space-separator and leap-second-table differences from Ethlo.

Share UTC minute normalization between time and date-time validation, make seconds mandatory in the formatter, and reuse the parsed date for leap-second checks. Add regression coverage for the space-separator difference, fixed-width fields, extreme-offset leap seconds, and accepted/rejected leap seconds through schema validation with Ethlo absent.

Initial implementation validation: mvn -B verify passed on JDK 17, 21, and 25: 9,105 tests per run, zero failures/errors, 30 skipped. Focused format tests passed (103 cases). Refreshed GitNexus change scan: LOW risk, seven changed files.

Review follow-up: document Ethlo's rejection of -00:00, offsets beyond ±18:00, and fractions longer than nine digits, and restore the leap-second accuracy caveat. Add five date-range boundary cases, including a written year 0000 that normalizes to UTC year -1. The final format suite passes 108 tests with zero failures/errors/skips on JDK 25. Full-suite results above apply to the initial implementation; the docs-and-tests follow-up was checked with the focused suite. GitNexus follow-up scan: LOW risk, three changed files.

Refs #1337. Companion PR for 2.x: #1339.

@stevehu

stevehu commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

I found no bug in #1338 or #1339, and both are safe to merge. I reported 5 low-severity findings, fewer than the 7-finding target, because I didn't want to invent more.

  • Same code on both branches: The two PRs change the same lines, and the three format source files are byte-identical.
  • Behavior unchanged: I fuzzed time and date-time with about 900K distinct inputs each. The new code gave exactly the same results as current master (which has Validate the date-time format without Ethlo with the time format rules (#1316) #1335 merged), and it matched my independent RFC 3339 reference with 0 mismatches. JDK 8 gave the same results as JDK 25.
  • Tests: The format tests on the 2.x branch pass on JDK 8 (103 run, 0 failures). I didn't re-run the full suite. The PR descriptions report full verify runs on JDK 8 (2.x), 11, 17, 21 and 25.
  • Issue Follow-ups to the date-time fallback (#1335, #1336): CHANGELOG, README and cleanup #1337 coverage: The CHANGELOG fix, the README rewrite, the space-separator note, the shared UTC normalization, the mandatory-seconds formatter and the single date parse are all in, and they are correct.

Findings:

  • Worth fixing: The README and CHANGELOG now name two differences from Ethlo, the space separator and the leap-second table. They don't say that Ethlo also rejects -00:00, offsets past ±18:00 and fractions over 9 digits, which the fallback accepts. The edit also dropped the old caveat that excluding Ethlo means less accurate validation.
  • Minor:
    • A new test pins Ethlo's behavior, so a dependency bump could break it.
    • Two substring allocations per call remain.
    • 24 * 60 is repeated across two files.
    • A leap second at 0000-01-01T00:59:60+01:00 shifts the UTC date into year -1, and no test covers either end of the date range.

@stevehu

stevehu commented Oct 21, 2026

Copy link
Copy Markdown
Contributor Author

I checked the pushed diffs of #1338 and #1339. I did not re-run the tests or check CI, so I'm relying on your 108-test result on JDK 25 and Java 8.

Fixed:

  • Ethlo differences: The README now says the fallback accepts -00:00, offsets beyond ±18:00 and fractions longer than nine digits, which Ethlo rejects. The space-separator note stays.
  • Accuracy caveat: The old "accurate validation" wording is replaced by "less accurate leap-second validation".
  • Year-boundary tests: Both ends of the range are now covered: 0000-01-01T00:59:60+00:59, 0000-01-01T00:59:60+01:00, 9999-12-31T23:59:60-00:01 and 9999-12-31T23:59:60Z.

Skipped:

  • Test pinning Ethlo behavior: ethloAcceptsSpaceSeparatorButFallbackRequiresT is still in the PRs. If an itu bump changes that behavior, the test fails in an unrelated PR. I'd keep it, since it documents a stated difference.
  • Substring allocations and 24 * 60: Production code is unchanged, so both remain. They were optional.

@stevehu
stevehu merged commit d0005e6 into master Oct 21, 2026
4 checks passed
@stevehu
stevehu deleted the fix/1337-date-time-follow-ups branch October 23, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant