[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-web/master] Set default locale US.



commit 9cd3ac5aa2cfccfa7c93c84be6f98059cafa181d
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Wed Jan 15 09:22:10 2020 +0100

    Set default locale US.
    
    Fixes #24532.
---
 CHANGELOG.md                                       |  1 +
 .../bwhist/RelayDescriptorDatabaseImporter.java    |  4 +---
 .../torproject/metrics/stats/clients/Database.java |  7 ++-----
 .../metrics/stats/hidserv/Aggregator.java          |  3 +--
 .../stats/hidserv/ComputedNetworkFractions.java    |  5 ++---
 .../stats/hidserv/ExtrapolatedHidServStats.java    |  6 ++----
 .../torproject/metrics/stats/hidserv/Simulate.java |  5 ++---
 .../org/torproject/metrics/stats/main/Main.java    |  3 +++
 .../torproject/metrics/stats/onionperf/Main.java   |  9 ++++-----
 .../torproject/metrics/stats/servers/Database.java | 22 +++++++---------------
 .../torproject/metrics/stats/totalcw/Database.java |  7 ++-----
 .../torproject/metrics/stats/webstats/Main.java    |  6 ++----
 .../torproject/metrics/web/DirectoryListing.java   |  3 +--
 .../org/torproject/metrics/web/NewsServlet.java    |  3 +--
 .../org/torproject/metrics/web/ServerMain.java     |  3 +++
 .../org/torproject/metrics/web/UpdateNews.java     |  2 ++
 16 files changed, 36 insertions(+), 53 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index d5e6188..57694f1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@
    - Make Jetty host configurable.
    - Configure a base URL in order to turn ExoneraTor's permanent
      links into https:// links.
+   - Set default locale `US` at the beginning of the execution.
 
 
 # Changes in version 1.3.0 - 2019-11-09
diff --git a/src/main/java/org/torproject/metrics/stats/bwhist/RelayDescriptorDatabaseImporter.java b/src/main/java/org/torproject/metrics/stats/bwhist/RelayDescriptorDatabaseImporter.java
index 09e7b67..2609188 100644
--- a/src/main/java/org/torproject/metrics/stats/bwhist/RelayDescriptorDatabaseImporter.java
+++ b/src/main/java/org/torproject/metrics/stats/bwhist/RelayDescriptorDatabaseImporter.java
@@ -28,7 +28,6 @@ import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 import java.util.SortedSet;
@@ -626,8 +625,7 @@ public final class RelayDescriptorDatabaseImporter {
         + "dirwrite";
     statistics.add(columns.split(", "));
     Statement st = this.conn.createStatement();
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     String queryString = "SELECT " + columns + " FROM stats_bandwidth";
     try (ResultSet rs = st.executeQuery(queryString)) {
       while (rs.next()) {
diff --git a/src/main/java/org/torproject/metrics/stats/clients/Database.java b/src/main/java/org/torproject/metrics/stats/clients/Database.java
index 3d8d63d..ac715fd 100644
--- a/src/main/java/org/torproject/metrics/stats/clients/Database.java
+++ b/src/main/java/org/torproject/metrics/stats/clients/Database.java
@@ -14,7 +14,6 @@ import java.time.Instant;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.List;
-import java.util.Locale;
 import java.util.TimeZone;
 
 /** Database wrapper to connect to the database, insert data, run the stored
@@ -95,8 +94,7 @@ class Database implements AutoCloseable {
     String columns = "date, node, country, transport, version, frac, users";
     statistics.add(columns.split(", "));
     Statement st = this.connection.createStatement();
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     String queryString = "SELECT " + columns + " FROM estimated";
     try (ResultSet rs = st.executeQuery(queryString)) {
       while (rs.next()) {
@@ -120,8 +118,7 @@ class Database implements AutoCloseable {
     String columns = "date, node, country, transport, version, frac, low, high";
     statistics.add(columns.split(", "));
     Statement st = this.connection.createStatement();
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     String queryString = "SELECT " + columns + " FROM combined";
     try (ResultSet rs = st.executeQuery(queryString)) {
       while (rs.next()) {
diff --git a/src/main/java/org/torproject/metrics/stats/hidserv/Aggregator.java b/src/main/java/org/torproject/metrics/stats/hidserv/Aggregator.java
index 3ab1c1d..cb52598 100644
--- a/src/main/java/org/torproject/metrics/stats/hidserv/Aggregator.java
+++ b/src/main/java/org/torproject/metrics/stats/hidserv/Aggregator.java
@@ -13,7 +13,6 @@ import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Comparator;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 import java.util.SortedMap;
@@ -177,7 +176,7 @@ public class Aggregator {
         /* Put together all aggregated values in a single line. */
         String date = e.getKey();
         int numStats = weightedValues.size();
-        sb.append(String.format(Locale.US, "%s,%s,%.0f,%.0f,%.0f,%.8f,%d%n",
+        sb.append(String.format("%s,%s,%.0f,%.0f,%.0f,%.8f,%d%n",
             date, type, weightedMean, weightedMedian, weightedInterquartileMean,
             sumFraction, numStats));
       }
diff --git a/src/main/java/org/torproject/metrics/stats/hidserv/ComputedNetworkFractions.java b/src/main/java/org/torproject/metrics/stats/hidserv/ComputedNetworkFractions.java
index 4858588..3f3f12d 100644
--- a/src/main/java/org/torproject/metrics/stats/hidserv/ComputedNetworkFractions.java
+++ b/src/main/java/org/torproject/metrics/stats/hidserv/ComputedNetworkFractions.java
@@ -8,7 +8,6 @@ import org.slf4j.LoggerFactory;
 
 import java.util.Collections;
 import java.util.HashMap;
-import java.util.Locale;
 import java.util.Map;
 
 /** Computed fraction of hidden-service activity that a single relay is
@@ -117,9 +116,9 @@ public class ComputedNetworkFractions implements Document {
         validAfterDate);
     String second = validAfterHour
         + (this.fractionRendRelayedCells == 0.0 ? ","
-            : String.format(Locale.US, ",%f", this.fractionRendRelayedCells))
+            : String.format(",%f", this.fractionRendRelayedCells))
         + (this.fractionDirOnionsSeen == 0.0 ? ","
-            : String.format(Locale.US, ",%f", this.fractionDirOnionsSeen));
+            : String.format(",%f", this.fractionDirOnionsSeen));
     return new String[] { first, second };
   }
 
diff --git a/src/main/java/org/torproject/metrics/stats/hidserv/ExtrapolatedHidServStats.java b/src/main/java/org/torproject/metrics/stats/hidserv/ExtrapolatedHidServStats.java
index ba42317..71048f3 100644
--- a/src/main/java/org/torproject/metrics/stats/hidserv/ExtrapolatedHidServStats.java
+++ b/src/main/java/org/torproject/metrics/stats/hidserv/ExtrapolatedHidServStats.java
@@ -6,8 +6,6 @@ package org.torproject.metrics.stats.hidserv;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Locale;
-
 /** Extrapolated network totals of hidden-service statistics reported by a
  * single relay.  Extrapolated values are based on reported statistics and
  * computed network fractions in the statistics interval. */
@@ -118,10 +116,10 @@ public class ExtrapolatedHidServStats implements Document {
         DateTimeHelper.ISO_DATE_FORMAT);
     String second = this.fingerprint
         + (this.fractionRendRelayedCells == 0.0 ? ",,"
-        : String.format(Locale.US, ",%.0f,%f",
+        : String.format(",%.0f,%f",
         this.extrapolatedRendRelayedCells, this.fractionRendRelayedCells))
         + (this.fractionDirOnionsSeen == 0.0 ? ",,"
-        : String.format(Locale.US, ",%.0f,%f",
+        : String.format(",%.0f,%f",
         this.extrapolatedDirOnionsSeen, this.fractionDirOnionsSeen));
     return new String[] { first, second };
   }
diff --git a/src/main/java/org/torproject/metrics/stats/hidserv/Simulate.java b/src/main/java/org/torproject/metrics/stats/hidserv/Simulate.java
index 8374514..696fc1d 100644
--- a/src/main/java/org/torproject/metrics/stats/hidserv/Simulate.java
+++ b/src/main/java/org/torproject/metrics/stats/hidserv/Simulate.java
@@ -13,7 +13,6 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Comparator;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 import java.util.Random;
 import java.util.SortedMap;
@@ -197,7 +196,7 @@ public class Simulate {
           totalInterquartileProbability += extrapolation[2];
         }
       }
-      sb.append(String.format(Locale.US, "%d,%.2f,%.0f,%.0f,%.0f%n", run,
+      sb.append(String.format("%d,%.2f,%.0f,%.0f,%.0f%n", run,
           fraction, totalValues / totalProbability, weightedMedian,
           totalInterquartileValues / totalInterquartileProbability));
     }
@@ -352,7 +351,7 @@ public class Simulate {
           totalInterquartileProbability += extrapolation[2];
         }
       }
-      sb.append(String.format(Locale.US, "%d,%.2f,%.0f,%.0f,%.0f%n", run,
+      sb.append(String.format("%d,%.2f,%.0f,%.0f,%.0f%n", run,
           fraction, totalValues / totalProbability, weightedMedian,
           totalInterquartileValues / totalInterquartileProbability));
     }
diff --git a/src/main/java/org/torproject/metrics/stats/main/Main.java b/src/main/java/org/torproject/metrics/stats/main/Main.java
index 4ea15b4..3a4baf7 100644
--- a/src/main/java/org/torproject/metrics/stats/main/Main.java
+++ b/src/main/java/org/torproject/metrics/stats/main/Main.java
@@ -10,6 +10,7 @@ import java.nio.file.Files;
 import java.nio.file.StandardCopyOption;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Locale;
 
 public class Main {
 
@@ -29,6 +30,8 @@ public class Main {
 
     log.info("Starting metrics update run.");
 
+    Locale.setDefault(Locale.US);
+
     File[] outputDirs = new File[] { modulesDir, statsDir };
     for (File outputDir : outputDirs) {
       if (outputDir.exists()) {
diff --git a/src/main/java/org/torproject/metrics/stats/onionperf/Main.java b/src/main/java/org/torproject/metrics/stats/onionperf/Main.java
index 454e3b2..c8e3a90 100644
--- a/src/main/java/org/torproject/metrics/stats/onionperf/Main.java
+++ b/src/main/java/org/torproject/metrics/stats/onionperf/Main.java
@@ -27,7 +27,6 @@ import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Locale;
 import java.util.Set;
 import java.util.TimeZone;
 
@@ -251,7 +250,7 @@ public class Main {
     Statement st = connection.createStatement();
     String queryString = "SELECT date, filesize, source, server, q1, md, q3, "
         + "timeouts, failures, requests FROM onionperf";
-    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
+    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
     dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
     Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     try (ResultSet rs = st.executeQuery(queryString)) {
@@ -280,7 +279,7 @@ public class Main {
     Statement st = connection.createStatement();
     String queryString = "SELECT date, source, position, q1, md, q3 "
         + "FROM buildtimes_stats";
-    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
+    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
     dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
     Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     try (ResultSet rs = st.executeQuery(queryString)) {
@@ -305,7 +304,7 @@ public class Main {
     Statement st = connection.createStatement();
     String queryString = "SELECT date, source, server, low, q1, md, q3, high "
         + "FROM latencies_stats";
-    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
+    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
     dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
     Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     try (ResultSet rs = st.executeQuery(queryString)) {
@@ -332,7 +331,7 @@ public class Main {
     Statement st = connection.createStatement();
     String queryString = "SELECT date, source, server, low, q1, md, q3, high "
         + "FROM throughput_stats";
-    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
+    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
     dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
     Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     try (ResultSet rs = st.executeQuery(queryString)) {
diff --git a/src/main/java/org/torproject/metrics/stats/servers/Database.java b/src/main/java/org/torproject/metrics/stats/servers/Database.java
index fb3fdf5..8e5e31d 100644
--- a/src/main/java/org/torproject/metrics/stats/servers/Database.java
+++ b/src/main/java/org/torproject/metrics/stats/servers/Database.java
@@ -18,7 +18,6 @@ import java.util.Calendar;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 import java.util.Set;
 import java.util.SortedSet;
@@ -267,8 +266,7 @@ class Database implements AutoCloseable {
     this.psStatusesSelect.clearParameters();
     this.psStatusesSelect.setString(1,
         networkStatus.isRelay ? "relay" : "bridge");
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     this.psStatusesSelect.setTimestamp(2,
         Timestamp.from(ZonedDateTime.of(networkStatus.timestamp,
         ZoneId.of("UTC")).toInstant()), calendar);
@@ -414,8 +412,7 @@ class Database implements AutoCloseable {
         + "server_count_sum_avg, advertised_bandwidth_bytes_sum_avg";
     statistics.add(columns.split(", "));
     Statement st = this.connection.createStatement();
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     String queryString = "SELECT " + columns + " FROM ipv6servers";
     try (ResultSet rs = st.executeQuery(queryString)) {
       while (rs.next()) {
@@ -443,8 +440,7 @@ class Database implements AutoCloseable {
     String columns = "date, isexit, isguard, advbw";
     statistics.add(columns.split(", "));
     Statement st = this.connection.createStatement();
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     String queryString = "SELECT " + columns + " FROM bandwidth_advbw";
     try (ResultSet rs = st.executeQuery(queryString)) {
       while (rs.next()) {
@@ -465,8 +461,7 @@ class Database implements AutoCloseable {
     String columns = "date, relays, bridges";
     statistics.add(columns.split(", "));
     Statement st = this.connection.createStatement();
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     String queryString = "SELECT " + columns + " FROM servers_networksize";
     try (ResultSet rs = st.executeQuery(queryString)) {
       while (rs.next()) {
@@ -486,8 +481,7 @@ class Database implements AutoCloseable {
     String columns = "date, flag, relays";
     statistics.add(columns.split(", "));
     Statement st = this.connection.createStatement();
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     String queryString = "SELECT " + columns + " FROM servers_relayflags";
     try (ResultSet rs = st.executeQuery(queryString)) {
       while (rs.next()) {
@@ -507,8 +501,7 @@ class Database implements AutoCloseable {
     String columns = "date, version, relays";
     statistics.add(columns.split(", "));
     Statement st = this.connection.createStatement();
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     String queryString = "SELECT " + columns + " FROM servers_versions";
     try (ResultSet rs = st.executeQuery(queryString)) {
       while (rs.next()) {
@@ -528,8 +521,7 @@ class Database implements AutoCloseable {
     String columns = "date, platform, relays";
     statistics.add(columns.split(", "));
     Statement st = this.connection.createStatement();
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     String queryString = "SELECT " + columns + " FROM servers_platforms";
     try (ResultSet rs = st.executeQuery(queryString)) {
       while (rs.next()) {
diff --git a/src/main/java/org/torproject/metrics/stats/totalcw/Database.java b/src/main/java/org/torproject/metrics/stats/totalcw/Database.java
index a35099f..3d51604 100644
--- a/src/main/java/org/torproject/metrics/stats/totalcw/Database.java
+++ b/src/main/java/org/torproject/metrics/stats/totalcw/Database.java
@@ -17,7 +17,6 @@ import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.List;
-import java.util.Locale;
 import java.util.TimeZone;
 
 /** Database wrapper to connect to the database, insert data, run the stored
@@ -122,8 +121,7 @@ class Database implements AutoCloseable {
 
   private void insertStatusIfAbsent(LocalDateTime validAfter,
       Integer authorityId, long[] measuredSums) throws SQLException {
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     this.psVoteSelect.clearParameters();
     this.psVoteSelect.setTimestamp(1,
         Timestamp.from(ZonedDateTime.of(validAfter,
@@ -173,8 +171,7 @@ class Database implements AutoCloseable {
   Iterable<OutputLine> queryTotalcw() throws SQLException {
     List<OutputLine> statistics = new ArrayList<>();
     Statement st = this.connection.createStatement();
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     String queryString = "SELECT " + OutputLine.columnHeadersDelimitedBy(", ")
         + " FROM totalcw";
     try (ResultSet rs = st.executeQuery(queryString)) {
diff --git a/src/main/java/org/torproject/metrics/stats/webstats/Main.java b/src/main/java/org/torproject/metrics/stats/webstats/Main.java
index f581c8a..17e21e9 100644
--- a/src/main/java/org/torproject/metrics/stats/webstats/Main.java
+++ b/src/main/java/org/torproject/metrics/stats/webstats/Main.java
@@ -33,7 +33,6 @@ import java.time.format.DateTimeFormatter;
 import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 import java.util.SortedSet;
 import java.util.TimeZone;
@@ -272,10 +271,9 @@ public class Main {
     SortedSet<String> statistics = new TreeSet<>();
     Statement st = connection.createStatement();
     String queryString = "SELECT " + ALL_COLUMNS + " FROM webstats";
-    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd", Locale.US);
+    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
     dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
-    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"),
-        Locale.US);
+    Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     try (ResultSet rs = st.executeQuery(queryString)) {
       while (rs.next()) {
         statistics.add(String.format("%s,%s,%s,%s,%s,%s,%d",
diff --git a/src/main/java/org/torproject/metrics/web/DirectoryListing.java b/src/main/java/org/torproject/metrics/web/DirectoryListing.java
index 09f2aaa..aceec59 100644
--- a/src/main/java/org/torproject/metrics/web/DirectoryListing.java
+++ b/src/main/java/org/torproject/metrics/web/DirectoryListing.java
@@ -18,7 +18,6 @@ import java.net.URLConnection;
 import java.util.ArrayList;
 import java.util.HashMap;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 import java.util.SortedSet;
 import java.util.TreeSet;
@@ -201,7 +200,7 @@ public class DirectoryListing extends HashMap<String, List<String[]>>
     int exp = (int) (Math.log(bytes) / Math.log(1024));
     char pre = "KMGTPE".charAt(exp - 1);
     return String
-        .format(Locale.US, "%.1f %siB", bytes / Math.pow(1024, exp), pre);
+        .format("%.1f %siB", bytes / Math.pow(1024, exp), pre);
   }
 }
 
diff --git a/src/main/java/org/torproject/metrics/web/NewsServlet.java b/src/main/java/org/torproject/metrics/web/NewsServlet.java
index c91233a..b5dddc1 100644
--- a/src/main/java/org/torproject/metrics/web/NewsServlet.java
+++ b/src/main/java/org/torproject/metrics/web/NewsServlet.java
@@ -8,7 +8,6 @@ import java.util.ArrayList;
 import java.util.Calendar;
 import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.Locale;
 import java.util.Map;
 import java.util.TimeZone;
 
@@ -49,7 +48,7 @@ public class NewsServlet extends AnyServlet {
       HttpServletResponse response) throws IOException, ServletException {
     /* Create categories based on current system time. */
     Map<String, String[]> cutOffDates = new LinkedHashMap<>();
-    Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.US);
+    Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
     cal.set(Calendar.DAY_OF_WEEK, 1);
     cutOffDates.put(String.format("%tF", cal),
         new String[] { "This week", "week" });
diff --git a/src/main/java/org/torproject/metrics/web/ServerMain.java b/src/main/java/org/torproject/metrics/web/ServerMain.java
index db01bc5..bb03086 100644
--- a/src/main/java/org/torproject/metrics/web/ServerMain.java
+++ b/src/main/java/org/torproject/metrics/web/ServerMain.java
@@ -9,12 +9,15 @@ import org.eclipse.jetty.xml.XmlConfiguration;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Locale;
+
 public class ServerMain {
 
   private static final Logger log = LoggerFactory.getLogger(ServerMain.class);
 
   /** Starts the web server listening for incoming client connections. */
   public static void main(String[] args) {
+    Locale.setDefault(Locale.US);
     try {
       Resource jettyXml = Resource.newSystemResource("jetty.xml");
       log.info("Reading configuration from '{}'.", jettyXml);
diff --git a/src/main/java/org/torproject/metrics/web/UpdateNews.java b/src/main/java/org/torproject/metrics/web/UpdateNews.java
index 92103fe..8f4440e 100644
--- a/src/main/java/org/torproject/metrics/web/UpdateNews.java
+++ b/src/main/java/org/torproject/metrics/web/UpdateNews.java
@@ -14,6 +14,7 @@ import java.io.InputStreamReader;
 import java.net.URL;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Locale;
 
 public class UpdateNews {
 
@@ -21,6 +22,7 @@ public class UpdateNews {
 
   /** Update news. */
   public static void main(String[] args) throws Exception {
+    Locale.setDefault(Locale.US);
     URL textFile = new URL(
         "https://trac.torproject.org/projects/tor/wiki/doc/";
         + "MetricsTimeline?format=txt");



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits