DateFormatSymbols gives the wrong translation of months/days

Viewed 163

We've recently migrated from Java 8 to 11. Upon testing our new version we discovered that when a date is spelled out (dddd, dd MMMM yyyy) the resulting months/days are in English. Our default locale is set to nl_NL. Reverting back to Java 8 fixes the problem so it is related to the upgrade. We've tried a number of things:

  • Setting default locale tot nl_NL in docker image and application
  • Setting "java.locale.providers" to "COMPAT,CLDR"
  • Upgrading libraries

When debugging our acceptatie environment, we notice that DateFormatSymbols has the wrong translation of months/weeks.

enter image description here

EDIT: The problem occurs when generating Word documents from user created templates. These templates contain mergefields, these mergefields are used to create the correct document. The dateformat is being set on the mergefield (e.g. { MERGEFIELD Merge_Date @ "dddd, MMMM d, yyyy" }). Library used for generating these documents is Aspose Word. The Aspose library is using the DateFormatSymbols for conversion.

Help would be appreciated, we've ran out of idea's.

1 Answers

I've tried posting the java issue in the answer but it got moderated because it is not an solution to the bug, which is correct. We fixed our problem by removing the flight recorder from our Docker image. As said, setting the flag causes the language providers to be loaded very early in the startup process and when only the default en_US locale is available. Link to the java bug is:

Link: Flight Recorder VM Option causes wrong initialization of Locale Providers in the JDK Bug System

Related