-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Description
From https://bugs.openjdk.org/browse/JDK-8305402
COMPAT locale provider has remained to keep the backward compatibility of JDK 8's locale data, since CLDR-based locale data became the default in JDK 9. The intention was to encourage applications to migrate to CLDR, so for future removal of the COMPAT locale provider, acknowledging the user of future removal is recommended.
To Reproduce
Steps to reproduce the behavior:
- Run tests on a plugin using JDK 21
- Observe multiple warnings:
> Task :test
Dec 09, 2023 12:30:31 PM sun.util.locale.provider.LocaleProviderAdapter <clinit>
WARNING: COMPAT locale provider will be removed in a future release
Expected behavior
No warnings.
Plugins
Error occurs when testing any plugin which inherits from OpenSearchTestBasePlugin
Host/Environment (please complete the following information):
- OS: macOS 14.1.2 (aarch64)
- JDK Version 21.0.1
Additional context
The locale is set here:
OpenSearch/buildSrc/src/main/java/org/opensearch/gradle/OpenSearchTestBasePlugin.java
Line 113 in 3c14cc1
| test.systemProperty("java.locale.providers", "SPI,COMPAT"); |
The fix is to simply replace COMPAT with CLDR. Some tests will break and will need to be fixed.
Note that the "breaking change" here was the JDK default behavior, so this only breaks our tests which explicitly set COMPAT, overriding the default JDK. SO this should be safe to backport.
CLDR is supported since JDK11: https://www.oracle.com/java/technologies/javase/jdk11-suported-locales.html