-
Bug
-
Resolution: Fixed
-
P4
-
21
-
b22
-
generic
-
generic
-
Verified
ADDITIONAL SYSTEM INFORMATION :
Generic, at least Windows and macOS
A DESCRIPTION OF THE PROBLEM :
21.0.5 changed the locale fallback mechanism to no longer respect user.region in https://github.com/corretto/corretto-21/commit/a3cd6d6b916f7d8c03cd4b59324a6da11df467eb. The change should have only affected that properties can't be changed at runtime, but it breaks the existing user.region fallback logic.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Running with -Duser.region=DE makes this test pass on 21.0.4, but fail on 21.0.5:
Depending on your setup, you can run with -Duser.region=US and use "." as a separator in the test instead.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
0,50000
ACTUAL -
0.50000
---------- BEGIN SOURCE ----------
import static org.assertj.core.api.Assertions.*;
import org.junit.jupiter.api.Test;
class LocaleTest {
@Test
void test() {
assertThat(String.format("%.5f", 0.5f)).isEqualTo("0,50000");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Adding -Duser.country.format=DE fixes this issue, but not sure whether other properties need to be set.
FREQUENCY : always
Generic, at least Windows and macOS
A DESCRIPTION OF THE PROBLEM :
21.0.5 changed the locale fallback mechanism to no longer respect user.region in https://github.com/corretto/corretto-21/commit/a3cd6d6b916f7d8c03cd4b59324a6da11df467eb. The change should have only affected that properties can't be changed at runtime, but it breaks the existing user.region fallback logic.
STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Running with -Duser.region=DE makes this test pass on 21.0.4, but fail on 21.0.5:
Depending on your setup, you can run with -Duser.region=US and use "." as a separator in the test instead.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
0,50000
ACTUAL -
0.50000
---------- BEGIN SOURCE ----------
import static org.assertj.core.api.Assertions.*;
import org.junit.jupiter.api.Test;
class LocaleTest {
@Test
void test() {
assertThat(String.format("%.5f", 0.5f)).isEqualTo("0,50000");
}
}
---------- END SOURCE ----------
CUSTOMER SUBMITTED WORKAROUND :
Adding -Duser.country.format=DE fixes this issue, but not sure whether other properties need to be set.
FREQUENCY : always
- relates to
-
JDK-8321206 Make Locale related system properties `StaticProperty`
-
- Resolved
-
- links to
-
Commit(master) openjdk/jdk/e64f0798
-
Review(master) openjdk/jdk/21645