FlightRecorderOptions reset date format

Erik Gahlin erik.gahlin at oracle.com
Wed Mar 25 15:35:39 UTC 2020


Hi Benjamin, 

I was able to reproduce the issue. Not sure why this happens.

Thanks for sharing the reproducer. I will look into it and file a bug.

Erik


> On 25 Mar 2020, at 16:08, Benjamin Brandl <bbrandl.atoss at gmail.com> wrote:
> 
> Hi all,
> 
> running java 14 with VM-argument -XX:FlightRecorderOptions will reset
> the date format to en.
> 
> 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.
> 
> Best regards
> Ben



More information about the hotspot-jfr-dev mailing list