From 946fc49a0bfde3a5a5abc4291afb64d7c5547ea4 Mon Sep 17 00:00:00 2001 From: Naveed Khan Date: Thu, 2 Jul 2026 20:46:43 +0530 Subject: [PATCH] fix sql time and timestamp locale tests on java 20+ 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 --- .../sql/converters/SqlTimeConverterTest.java | 15 +++++++++++++-- .../converters/SqlTimestampConverterTest.java | 17 +++++++++++++---- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/test/java/org/apache/commons/beanutils2/sql/converters/SqlTimeConverterTest.java b/src/test/java/org/apache/commons/beanutils2/sql/converters/SqlTimeConverterTest.java index 95498cfcd..ca7e7854e 100644 --- a/src/test/java/org/apache/commons/beanutils2/sql/converters/SqlTimeConverterTest.java +++ b/src/test/java/org/apache/commons/beanutils2/sql/converters/SqlTimeConverterTest.java @@ -18,7 +18,9 @@ package org.apache.commons.beanutils2.sql.converters; import java.sql.Time; +import java.text.DateFormat; import java.util.Calendar; +import java.util.Date; import java.util.Locale; import org.apache.commons.beanutils2.converters.AbstractDateConverterTest; @@ -29,6 +31,15 @@ */ class SqlTimeConverterTest extends AbstractDateConverterTest