fix: honor GlobalConfiguration.locale for java.util.Date string conversion #1311
All Vouch review confidence checks passed
Residual risk 0.34 = Change Risk (0.64) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.64 · 318 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.345
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.064
Real PR Conversation Timeline
1 comments
"Review active on #1311"
general
weight: 0.35
skytin1004
<!--
Thanks very much for contributing to Apache Fesod (Incubating)! Please make sure that your code changes
are covered with tests. And in case of new features or big changes
remember to adjust the documentation.
Feel free to ping committers for the review!
In case of an existing issue, reference it using one of the following:
Closed: #ISSUE
Related: #ISSUE
-->
Purpose of the pull request
Closed: #1040
java.util.Datestring conversion ignoredGlobalConfiguration.locale:DateStringConvertercalledDateUtils.format(Date, ...)/parseDate(...)without a locale, soSimpleDateFormatalways used the JVM default locale. Everyjava.timeconverter already passes the configured locale, so a POJO with both aDateand aLocalDateTimefield got localized text for only one of them. This PR makesjava.util.Datefollow the same rule. Happy to adjust if maintainers consider the old split intentional.What's changed?
DateUtils.format(Date, String, Locale)andDateUtils.parseDate(String, String, Locale)overloads. The existing signatures delegate withnull, which still resolves toLocale.getDefault(Locale.Category.FORMAT), so behavior is unchanged for all current callers.SimpleDateFormatthread-local cache by locale first, then pattern, reusing the bounded FIFO maps already used by theDateTimeFormattercache. Without this, two locales sharing a pattern would reuse the formatter built for the first locale.globalConfiguration.getLocale()fromDateStringConverterin both read and write directions.SimpleDateFormatwith the target locale, so the tests hold on JDK 8 (JRE locale data) and JDK 9+ (CLDR).No website documentation change:
GlobalConfiguration.localeis already documented as affecting date/number formatting; this fix makes that statement true forjava.util.Date.Verification
./mvnw -o clean package -pl fesod-common,fesod-shaded,fesod-sheet: BUILD SUCCESS, 1807 tests, 0 failures/errors (JDK 21).DateStringConverterTest+DateUtilsTest: 101 tests pass on JDK 21 and on JDK 8.spotless:checkandgit diff --checkare clean.Checklist