Skip to content

fix: reject invalid calendar date strings - #1167

Open
Aias00 wants to merge 1 commit into
apache:mainfrom
Aias00:fix/strict-invalid-dates-1157
Open

Aias00 wants to merge 1 commit into
apache:mainfrom
Aias00:fix/strict-invalid-dates-1157

Conversation

@Aias00

@Aias00 Aias00 commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Purpose of the pull request

Closed: #1157

Default date conversion silently normalized invalid calendar strings instead of reporting malformed input.

What's changed?

  • Disable lenient parsing for cached SimpleDateFormat instances.
  • Build java.time formatters with strict resolver semantics and a default CE era so existing yyyy patterns remain valid on Java 8.
  • Add DateUtils and converter tests for invalid month-end/leap-day values and valid controls.

Verification:

DateUtilsTest, DateStringConverterTest, LocalDateStringConverterTest
Tests run: 88, Failures: 0, Errors: 0, Skipped: 0
spotless:check: passed

Checklist

  • I have read the Contributor Guide.
  • I have written the necessary doc or comment.
  • I have added the necessary unit tests and all cases have passed.

Signed-off-by: liuhy <liuhongyu@apache.org>

This branch has not been deployed

No deployments
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.

[Bug] Default date converters silently normalize invalid calendar dates

1 participant