forked from microsoft/openjdk-jdk11u
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
8244508: JFR: FlightRecorderOptions reset date format
Reviewed-by: clanger Backport-of: f3519016c7766934d0aa3014b1a0593d91a0556c
- Loading branch information
1 parent
10ddd51
commit 7814102
Showing
5 changed files
with
80 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package jdk.jfr.startupargs; | ||
|
||
import java.io.IOException; | ||
import java.text.DateFormat; | ||
import java.util.Calendar; | ||
import java.util.GregorianCalendar; | ||
|
||
import jdk.test.lib.process.OutputAnalyzer; | ||
import jdk.test.lib.process.ProcessTools; | ||
|
||
/** | ||
* @test | ||
* @summary Checks that locale is respected when using -XX:FlightRecorderOptions | ||
* See JDK-8244508 | ||
* @key jfr | ||
* @requires vm.hasJFR | ||
* @modules jdk.jfr | ||
* @library /test/lib | ||
* @run main jdk.jfr.startupargs.TestOptionsWithLocale | ||
*/ | ||
public class TestOptionsWithLocale { | ||
|
||
public static class PrintDate { | ||
public static void main(String... args) { | ||
GregorianCalendar date = new GregorianCalendar(2020, Calendar.JANUARY, 1); | ||
DateFormat formatter = DateFormat.getDateTimeInstance(); | ||
System.out.println(formatter.format(date.getTime())); | ||
} | ||
} | ||
|
||
public static void main(String... args) throws IOException { | ||
ProcessBuilder pb = ProcessTools.createTestJvm( | ||
"-Duser.country=DE", | ||
"-Duser.language=de", | ||
"-XX:FlightRecorderOptions:stackdepth=128", | ||
PrintDate.class.getName()); | ||
OutputAnalyzer output = new OutputAnalyzer(pb.start()); | ||
output.shouldContain("01.01.2020, 00:00:00"); | ||
} | ||
} |