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;
|
package org.lucares.pdb.datastore.lang;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.antlr.v4.runtime.ParserRuleContext;
|
import org.antlr.v4.runtime.ParserRuleContext;
|
||||||
|
|
||||||
public class SyntaxException extends RuntimeException {
|
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,
|
private static String generateMessage(final int lineStart, final int startIndex, final int lineStop,
|
||||||
final int stopIndex) {
|
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() {
|
public int getLineStart() {
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package org.lucares.recommind.logs;
|
package org.lucares.recommind.logs;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
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) {
|
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
|
@Override
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.TimeUnit;
|
import java.util.concurrent.TimeUnit;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
@@ -209,7 +210,7 @@ public class Plotter {
|
|||||||
|
|
||||||
final int values = csvSummary.getValues();
|
final int values = csvSummary.getValues();
|
||||||
result.append(" (");
|
result.append(" (");
|
||||||
result.append(String.format("%,d", values));
|
result.append(String.format(Locale.US, "%,d", values));
|
||||||
result.append(")");
|
result.append(")");
|
||||||
|
|
||||||
return result.toString();
|
return result.toString();
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.concurrent.atomic.AtomicLong;
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import java.util.zip.GZIPOutputStream;
|
import java.util.zip.GZIPOutputStream;
|
||||||
@@ -90,7 +91,8 @@ public class PdbExport {
|
|||||||
writer.flush();
|
writer.flush();
|
||||||
writer.close();
|
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);
|
exportFiles.add(exportFile);
|
||||||
writer = createWriter(exportFile);
|
writer = createWriter(exportFile);
|
||||||
LOGGER.info("new export file: {}", exportFile);
|
LOGGER.info("new export file: {}", exportFile);
|
||||||
@@ -128,8 +130,9 @@ public class PdbExport {
|
|||||||
final long end = System.currentTimeMillis();
|
final long end = System.currentTimeMillis();
|
||||||
final long duration = end - begin;
|
final long duration = end - begin;
|
||||||
final long entriesPerSecond = (long) (chunk / (duration / 1000.0));
|
final long entriesPerSecond = (long) (chunk / (duration / 1000.0));
|
||||||
LOGGER.info("progress: {} - {} entries/s + duration {}", String.format("%,d", count),
|
LOGGER.info("progress: {} - {} entries/s + duration {}",
|
||||||
String.format("%,d", entriesPerSecond), duration);
|
String.format(Locale.US, "%,d", count),
|
||||||
|
String.format(Locale.US, "%,d", entriesPerSecond), duration);
|
||||||
begin = System.currentTimeMillis();
|
begin = System.currentTimeMillis();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import java.util.ArrayList;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.concurrent.ArrayBlockingQueue;
|
import java.util.concurrent.ArrayBlockingQueue;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
@@ -120,7 +121,7 @@ public class PerformanceDb implements AutoCloseable {
|
|||||||
final long duration = end - lastSync;
|
final long duration = end - lastSync;
|
||||||
final long entriesPerSecond = (long) (insertionsSinceLastSync / (duration / 1000.0));
|
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));
|
entriesPerSecond, count, entry));
|
||||||
|
|
||||||
lastSync = System.currentTimeMillis();
|
lastSync = System.currentTimeMillis();
|
||||||
|
|||||||
Reference in New Issue
Block a user