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>tags/V1_9_8_RC1
@@ -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(); | |||
}); |
@@ -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(); | |||
}; |
@@ -42,7 +42,7 @@ | |||
<line text="null" /> | |||
<line text="int 123" /> | |||
<line text="long 999" /> | |||
<line text="double 12,340000" /> | |||
<line text="double 12.340000" /> | |||
<line text="String foo" /> | |||
<line text="[123, foo, 999, 12.34]" /> | |||
<line text="Non-circle" /> | |||
@@ -63,7 +63,7 @@ | |||
<line text="null" /> | |||
<line text="int 123" /> | |||
<line text="long 999" /> | |||
<line text="double 12,340000" /> | |||
<line text="double 12.340000" /> | |||
<line text="String foo" /> | |||
<line text="[123, foo, 999, 12.34]" /> | |||
<line text="Non-circle" /> |