We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f61cc1 commit c849d12Copy full SHA for c849d12
1 file changed
java-checks/src/main/java/org/sonar/java/checks/MagicNumberCheck.java
@@ -38,7 +38,9 @@
38
39
import java.math.BigDecimal;
40
import java.text.DecimalFormat;
41
+import java.text.DecimalFormatSymbols;
42
import java.text.ParseException;
43
+import java.util.Locale;
44
45
@Rule(
46
key = "S109",
@@ -65,7 +67,9 @@ public void visitEnumConstant(EnumConstantTree tree) {
65
67
@Override
66
68
public void visitLiteral(LiteralTree tree) {
69
if (isNumberLiteral(tree)) {
70
+
71
DecimalFormat decimalFormat = new DecimalFormat();
72
+ decimalFormat.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.ENGLISH));
73
decimalFormat.setParseBigDecimal(true);
74
BigDecimal checked = null;
75
try {
0 commit comments