Fix sql time and timestamp locale tests on java 20+#410
Merged
Conversation
The US SHORT time format switched the AM/PM separator to a narrow no-break space (U+202F) in CLDR (JDK 20+), so the locale converter parses that separator while the tests hard-coded a regular space. Derive the separator from the JVM's own format so the tests pass on both old and new JDKs. Signed-off-by: Naveed Khan <dxbnaveed.k@gmail.com>
7 tasks
garydgregory
added a commit
that referenced
this pull request
Jul 2, 2026
Refactor the copy-pasta from the PR.
Member
|
Hello @rootvector2 Merged 🚀 Please port to the TY! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the request on #406 to fix the SQL test failures on Java 25 and up.
SqlTimeConverterTest.testLocaleandSqlTimestampConverterTest.testLocalefail on JDK 20+ because CLDR changed the US SHORT time format to use a narrow no-break space (U+202F) before the AM/PM marker instead of a regular space. The locale converter parses using the JVM's ownDateFormat, so it expects U+202F, while the tests hard-coded a regular space in both the input string and the pattern that computes the expected value (andtoCalendarparses non-lenient). The non-SQL date test only uses a date pattern, which is why it wasn't affected.Rather than hard-code either separator, the tests now derive it from the running JVM's SHORT time format, so they pass on both older JDKs (regular space) and JDK 20+ (U+202F).
Verified failing before and passing after on OpenJDK 26; full suite still green on JDK 21.
mvn; that'smvnon the command line by itself.