FlightRecorderOptions reset date format
Benjamin Brandl
bbrandl.atoss at gmail.com
Wed Mar 25 15:08:24 UTC 2020
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