diff options
author | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-10-08 07:23:44 +0200 |
---|---|---|
committer | Alexander Kriegisch <Alexander@Kriegisch.name> | 2021-10-08 07:23:44 +0200 |
commit | 4ebacb393999f12ed80baf96c376b09226a46779 (patch) | |
tree | f07da11c64465da044d6879f28de2f250f434d78 /tests/features198 | |
parent | f7b7843748366c7310b165b2c3fc088b2c65d245 (diff) | |
download | aspectj-4ebacb393999f12ed80baf96c376b09226a46779.tar.gz aspectj-4ebacb393999f12ed80baf96c376b09226a46779.zip |
Fix Java17PreviewFeaturesTests (locale-specific floating-point output)
The test worked on my local workstation with German locale, but not on
GitHub with English locale.
Signed-off-by: Alexander Kriegisch <Alexander@Kriegisch.name>
Diffstat (limited to 'tests/features198')
-rw-r--r-- | tests/features198/java17/SwitchPatternAspect.aj | 3 | ||||
-rw-r--r-- | tests/features198/java17/SwitchPatternOK.java | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/tests/features198/java17/SwitchPatternAspect.aj b/tests/features198/java17/SwitchPatternAspect.aj index 5a3eeeb30..bf19b8468 100644 --- a/tests/features198/java17/SwitchPatternAspect.aj +++ b/tests/features198/java17/SwitchPatternAspect.aj @@ -1,4 +1,5 @@ import java.util.List; +import java.util.Locale; aspect SwitchPatternAspect { Object around(Object o) : execution(* doSomethingWithObject(*)) && args(o) { @@ -6,7 +7,7 @@ aspect SwitchPatternAspect { case null -> "null"; case Integer i -> String.format("int %d", i); case Long l -> String.format("long %d", l); - case Double d -> String.format("double %f", d); + case Double d -> String.format(Locale.ENGLISH, "double %f", d); case String s -> String.format("String %s", s); default -> o.toString(); }); diff --git a/tests/features198/java17/SwitchPatternOK.java b/tests/features198/java17/SwitchPatternOK.java index 26c1cf755..586dfe020 100644 --- a/tests/features198/java17/SwitchPatternOK.java +++ b/tests/features198/java17/SwitchPatternOK.java @@ -1,4 +1,5 @@ import java.util.List; +import java.util.Locale; /** * Inspired by examples in https://openjdk.java.net/jeps/406 @@ -26,7 +27,7 @@ public class SwitchPatternOK { case null -> "null"; case Integer i -> String.format("int %d", i); case Long l -> String.format("long %d", l); - case Double d -> String.format("double %f", d); + case Double d -> String.format(Locale.ENGLISH, "double %f", d); case String s -> String.format("String %s", s); default -> o.toString(); }; |