use US locale to format strings
This is especially important for all strings that are passed to gnuplot. Because gnuplot uses the US locale during parsing.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
package org.lucares.pdb.datastore.lang;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.antlr.v4.runtime.ParserRuleContext;
|
||||
|
||||
public class SyntaxException extends RuntimeException {
|
||||
@@ -27,7 +29,8 @@ public class SyntaxException extends RuntimeException {
|
||||
private static String generateMessage(final int lineStart, final int startIndex, final int lineStop,
|
||||
final int stopIndex) {
|
||||
|
||||
return String.format("line=%d, start=%d, to line=%d stop=%d", lineStart, startIndex, lineStop, stopIndex);
|
||||
return String.format(Locale.US, "line=%d, start=%d, to line=%d stop=%d", lineStart, startIndex, lineStop,
|
||||
stopIndex);
|
||||
}
|
||||
|
||||
public int getLineStart() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package org.lucares.recommind.logs;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
@@ -162,7 +163,7 @@ public class AxisSettings {
|
||||
}
|
||||
|
||||
private void appendfln(final StringBuilder builder, final String format, final Object... args) {
|
||||
builder.append(String.format(format + "\n", args));
|
||||
builder.append(String.format(Locale.US, format + "\n", args));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -10,6 +10,7 @@ import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
@@ -209,7 +210,7 @@ public class Plotter {
|
||||
|
||||
final int values = csvSummary.getValues();
|
||||
result.append(" (");
|
||||
result.append(String.format("%,d", values));
|
||||
result.append(String.format(Locale.US, "%,d", values));
|
||||
result.append(")");
|
||||
|
||||
return result.toString();
|
||||
|
||||
@@ -15,6 +15,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.stream.Stream;
|
||||
import java.util.zip.GZIPOutputStream;
|
||||
@@ -90,7 +91,8 @@ public class PdbExport {
|
||||
writer.flush();
|
||||
writer.close();
|
||||
}
|
||||
exportFile = backupDir.resolve(String.format("%s.%05d.pdb.gz", datePrefix, exportFileCounter++));
|
||||
exportFile = backupDir
|
||||
.resolve(String.format(Locale.US, "%s.%05d.pdb.gz", datePrefix, exportFileCounter++));
|
||||
exportFiles.add(exportFile);
|
||||
writer = createWriter(exportFile);
|
||||
LOGGER.info("new export file: {}", exportFile);
|
||||
@@ -128,8 +130,9 @@ public class PdbExport {
|
||||
final long end = System.currentTimeMillis();
|
||||
final long duration = end - begin;
|
||||
final long entriesPerSecond = (long) (chunk / (duration / 1000.0));
|
||||
LOGGER.info("progress: {} - {} entries/s + duration {}", String.format("%,d", count),
|
||||
String.format("%,d", entriesPerSecond), duration);
|
||||
LOGGER.info("progress: {} - {} entries/s + duration {}",
|
||||
String.format(Locale.US, "%,d", count),
|
||||
String.format(Locale.US, "%,d", entriesPerSecond), duration);
|
||||
begin = System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.ArrayBlockingQueue;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
@@ -120,7 +121,7 @@ public class PerformanceDb implements AutoCloseable {
|
||||
final long duration = end - lastSync;
|
||||
final long entriesPerSecond = (long) (insertionsSinceLastSync / (duration / 1000.0));
|
||||
|
||||
METRICS_LOGGER.debug(String.format("inserting %d/s ; total: %,d; last: %s",
|
||||
METRICS_LOGGER.debug(String.format(Locale.US, "inserting %d/s ; total: %,d; last: %s",
|
||||
entriesPerSecond, count, entry));
|
||||
|
||||
lastSync = System.currentTimeMillis();
|
||||
|
||||
Reference in New Issue
Block a user