Uploaded image for project: 'Java Mission Control'
  1. Java Mission Control
  2. JMC-7416

Using FlightRecorderOptions corrupts LocaleProviderAdapter and DateFormatSymbols

    XMLWordPrintable

    Details

      Description

      ADDITIONAL SYSTEM INFORMATION :
      Problem can be reproduced using OpenJDK and AdoptOpenJDK 11 (subversion 11 or 12). OS and hardware plays no role as far as we detected.

      A DESCRIPTION OF THE PROBLEM :
      When using the -XX:FlightRecorderOptions JVM option in combination with a -Duser.language other than the default the language setting does not have the expected effect leading to malformed weekdays and months output (among other undesired behavior).

      REGRESSION : Last worked in version 8u301

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Run the executable test case code in two situations:
      1. java -ea -Duser.language=nl FRO11Bug
      2. java -ea -Duser.language=nl -XX:FlightRecorderOptions=stackdepth=256 FRO11Bug

      The bottom situation "introduces" the bug.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      dinsdag 28 september 2021

      ACTUAL -
      Tue 28 Sep 2021 + AssertionError

      ---------- BEGIN SOURCE ----------
      import java.text.SimpleDateFormat;
      import java.util.Date;

      public class JFR11Bug {

      public static void main(String[] args)

      { String pattern = "EEEEEE dd MMMM yyyy"; SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern); String date = simpleDateFormat.format(new Date()); System.out.println(date); assert(date.contains("dinsdag")); }

      }

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Revert to Java8 or upgrade to Java16+. Potentially use different JRE/JDK distributions/versions than the above mentioned.

      FREQUENCY : always

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: