Commit 9844bc52 authored by Karsten Loesing's avatar Karsten Loesing
Browse files

Set default locale US and default time zone UTC.

Part of these changes have already been made in earlier commits as
part of #24532. This commit makes remaining changes as part of #33655.
parent 334550d6
Loading
Loading
Loading
Loading

build @ b5e1a2d7

Original line number Diff line number Diff line
Subproject commit fd856466bcb260f53ef69a24c102d0e49d171cc3
Subproject commit b5e1a2d7b29e58cc0645f068a1ebf4377bf9d8b8
+0 −3
Original line number Diff line number Diff line
@@ -27,7 +27,6 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.TimeZone;
import java.util.TreeMap;

public class Main {
@@ -72,7 +71,6 @@ public class Main {
    }
    SimpleDateFormat dateTimeFormat = new SimpleDateFormat(
        "yyyy-MM-dd HH:mm:ss");
    dateTimeFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
    for (Descriptor descriptor : descriptorReader.readDescriptors(new File(
        org.torproject.metrics.stats.main.Main.descriptorsDir,
        "recent/relay-descriptors/consensuses"))) {
@@ -150,7 +148,6 @@ public class Main {

    /* Aggregate statistics. */
    SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
    String today = dateFormat.format(new Date());
    SortedMap<String, List<Long>> preAggregatedValues = new TreeMap<>();
    try (BufferedReader br = new BufferedReader(new FileReader(resultsFile))) {
+0 −3
Original line number Diff line number Diff line
@@ -28,7 +28,6 @@ import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import java.util.SortedSet;
import java.util.TimeZone;
import java.util.TreeMap;
import java.util.TreeSet;

@@ -184,7 +183,6 @@ public class Main {
          + "proceeding.  To fix this, you'll have to re-import "
          + "statistics for the following dates:");
      DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
      dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
      for (long conflictingDate : conflictingDates) {
        sb.append("\n ")
            .append(dateFormat.format(conflictingDate * ONE_DAY_IN_MILLIS));
@@ -436,7 +434,6 @@ public class Main {
      SortedMap<String, Short> aggregateStats,
      SortedSet<RawStat> rawStats) {
    DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
    String yesterday = dateFormat.format(System.currentTimeMillis()
        - ONE_DAY_IN_MILLIS);
    SortedMap<String, List<Short>> fractionsByDateAndDirection
+0 −2
Original line number Diff line number Diff line
@@ -8,7 +8,6 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.Map;
import java.util.TimeZone;

/** Utility class to format and parse dates and timestamps. */
public class DateTimeHelper {
@@ -49,7 +48,6 @@ public class DateTimeHelper {
    if (!threadDateFormats.containsKey(format)) {
      DateFormat dateFormat = new SimpleDateFormat(format);
      dateFormat.setLenient(false);
      dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
      threadDateFormats.put(format, dateFormat);
    }
    return threadDateFormats.get(format);
+0 −2
Original line number Diff line number Diff line
@@ -11,7 +11,6 @@ import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;

/**
 * Checks request parameters passed to graph-generating servlets.
@@ -45,7 +44,6 @@ public class GraphParameterChecker {
   */
  public GraphParameterChecker() {
    this.dateFormat = new SimpleDateFormat("yyyy-MM-dd");
    this.dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
    this.availableGraphs = new HashMap<>();
    for (Metric metric : ContentProvider.getInstance().getMetricsList()) {
      if ("Graph".equals(metric.getType())) {
Loading