Skip to content

Commit

Permalink
Remove use of SPI for JDK 23+
Browse files Browse the repository at this point in the history
  • Loading branch information
thecoop committed Sep 19, 2024
1 parent 014bc7a commit 9be8f5e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ if (providers.systemProperty('idea.active').getOrNull() == 'true') {
vmParameters = [
'-ea',
'-Djava.security.manager=allow',
'-Djava.locale.providers=SPI,CLDR',
'-Djava.locale.providers=CLDR',
'-Des.nativelibs.path="' + testLibraryPath + '"',
// TODO: only open these for mockito when it is modularized
'--add-opens=java.base/java.security.cert=ALL-UNNAMED',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void execute(Task t) {
mkdirs(test.getWorkingDir().toPath().resolve("temp").toFile());

// TODO remove once jvm.options are added to test system properties
test.systemProperty("java.locale.providers", "SPI,CLDR");
test.systemProperty("java.locale.providers", "CLDR");
}
});
test.getJvmArgumentProviders().add(nonInputProperties);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ static List<String> systemJvmOptions(Settings nodeSettings, final Map<String, St
@UpdateForV9 // only use CLDR in v9+
private static String getLocaleProviders() {
/*
* Specify SPI to load IsoCalendarDataProvider (see #48209), specifying the first day of week as Monday.
* When on pre-23, use COMPAT instead to maintain existing date formats as much as we can.
* When on JDK 23+, use the default CLDR locale database, as COMPAT was removed in JDK 23.
* When on pre-23, use COMPAT instead to maintain existing date formats as much as we can,
* and specify SPI to load IsoCalendarDataProvider (see #48209), specifying the first day of week as Monday.
* When on JDK 23+, use the default CLDR locale database for everything, as COMPAT was removed in JDK 23.
*/
return Runtime.version().feature() >= 23 ? "SPI,CLDR" : "SPI,COMPAT";
return Runtime.version().feature() >= 23 ? "CLDR" : "SPI,COMPAT";
}

/*
Expand Down

0 comments on commit 9be8f5e

Please sign in to comment.