aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-core
diff options
context:
space:
mode:
authorJulien HENRY <julien.henry@sonarsource.com>2021-11-04 16:42:59 +0100
committersonartech <sonartech@sonarsource.com>2021-11-05 20:03:28 +0000
commitbc65f5705bf0b064d997cd3a2210a39b0506a48f (patch)
treea98966b849036130ae8ea349038c2a4fd6717eff /sonar-core
parente018b6c4c690ce9e35ce1ad7752d7e2139661d0b (diff)
downloadsonarqube-bc65f5705bf0b064d997cd3a2210a39b0506a48f.tar.gz
sonarqube-bc65f5705bf0b064d997cd3a2210a39b0506a48f.zip
Specify Locale in humanReadableByteCountSI for consistent output
For example with a French Locale the decimal separator is a comma.
Diffstat (limited to 'sonar-core')
-rw-r--r--sonar-core/src/main/java/org/sonar/core/util/FileUtils.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/sonar-core/src/main/java/org/sonar/core/util/FileUtils.java b/sonar-core/src/main/java/org/sonar/core/util/FileUtils.java
index ad058a6f45b..c520287ae9e 100644
--- a/sonar-core/src/main/java/org/sonar/core/util/FileUtils.java
+++ b/sonar-core/src/main/java/org/sonar/core/util/FileUtils.java
@@ -19,6 +19,7 @@
*/
package org.sonar.core.util;
+import javax.annotation.Nullable;
import java.io.File;
import java.io.IOException;
import java.nio.file.FileVisitOption;
@@ -30,7 +31,7 @@ import java.nio.file.attribute.BasicFileAttributes;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.EnumSet;
-import javax.annotation.Nullable;
+import java.util.Locale;
import static com.google.common.base.Preconditions.checkArgument;
import static java.lang.String.format;
@@ -180,7 +181,7 @@ public final class FileUtils {
bytes /= 1000;
ci.next();
}
- return String.format("%.1f %cB", bytes / 1000.0, ci.current());
+ return String.format(Locale.ENGLISH, "%.1f %cB", bytes / 1000.0, ci.current());
}
/**