julianhyde commented on code in PR #3653:
URL: https://github.com/apache/calcite/pull/3653#discussion_r1769261396
##########
core/src/main/java/org/apache/calcite/util/format/FormatElementEnum.java:
##########
@@ -436,8 +469,15 @@ static Work get() {
return castNonNull(THREAD_WORK.get());
}
- final Calendar calendar =
- Calendar.getInstance(DateTimeUtils.DEFAULT_ZONE, Locale.ROOT);
+ final Calendar calendar = new Calendar.Builder()
Review Comment:
That bug refers to `Locale.setDefault`, which is a global change (affects
the whole JVM).
This change seems harmless, because the behavior is deterministic, and does
not depend on the locale of the user.
According to <a
href="https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/Calendar.Builder.html#setLocale(java.util.Locale)">setLocale<a>
the locale will override the locale of the format element, which is a slight
change in behavior, and if it causes a bug we can revisit.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]