[
https://issues.apache.org/jira/browse/CALCITE-6580?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17882199#comment-17882199
]
Norman Jordan commented on CALCITE-6580:
----------------------------------------
[~julianhyde] I have updated the PR to now make use of DataContext. No longer
call "Locale.setDefault()", "Locale.getDefault()".
"ZoneId.systemDefault()" is still called, but only as a fallback when ZoneId
lookup failed. For the main code, there is a lookup of the ZoneId for "UTC"
(should always succeed). For the tests there is a lookup of the ZoneId for
"America/Chicago" (also expected to always succeed).
The tests in PostgresqlDateTimeFormatterTest have been reworked to be more
readable.
> Remove Locale.setDefault
> ------------------------
>
> Key: CALCITE-6580
> URL: https://issues.apache.org/jira/browse/CALCITE-6580
> Project: Calcite
> Issue Type: Improvement
> Reporter: Julian Hyde
> Priority: Major
> Labels: pull-request-available
>
> Remove all calls to {{Locale.setDefault}} in tests and production code.
> That function does not operate on the current thread; it affects all threads
> in the JVM. As such, it may affect other tests running at the same time, and
> affect other statements running at the same time.
> I hope, and believe, that the production code does not depend on
> {{Locale.getDefault}}. But let's make sure by removing {{setDefault}} from
> all tests.
> Add {{Locale.setDefault}} to
> [forbidden-apis|https://github.com/apache/calcite/blob/main/src/main/config/forbidden-apis/signatures.txt].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)