Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8244508

JFR: FlightRecorderOptions reset date format

XMLWordPrintable

    • jfr
    • b23

        "Consider following class:

        import java.text.DateFormat;
        import java.util.Calendar;
        import java.util.GregorianCalendar;
         
        public class Main
        {
            public static void main( String[] args )
            {
                GregorianCalendar date = new GregorianCalendar( 2020, Calendar.JANUARY,1 );
                DateFormat formatter = DateFormat.getDateTimeInstance();
         
                String expected = "01.01.2020, 00:00:00";
                String formatted = formatter.format( date.getTime() );
         
                System.out.println(String.format( "expected: %s%nactual: %s", expected, formatted ) );
          }
        }

        When running this class java 14 and with VM arguments `-
        Duser.country=DE -Duser.language=de -XX:StartFlightRecording`, `date`
        will be formatted to `01.01.2020, 00:00:00`.

        When running this class with java 14 and VM arguments `-
        Duser.country=DE -Duser.language=de -XX:StartFlightRecording
        -XX:FlightRecorderOptions=stackdepth=128`, `date` will be formatted to
        `2020 Jan 1 00:00:00`.

        I'd expect that in both cases, the formatted date is identical.

        This scenario works as expected with latest java 11."
        https://mail.openjdk.java.net/pipermail/hotspot-jfr-dev/2020-March/001313.html

              egahlin Erik Gahlin
              egahlin Erik Gahlin
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: