tor-commits
Threads by month
- ----- 2025 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
January 2017
- 22 participants
- 1796 discussions

11 Jan '17
commit 34fdd510efc2ee66113457d3f1339f7c8ebf70c0
Merge: 39ef343 3833f67
Author: Nick Mathewson <nickm(a)torproject.org>
Date: Wed Jan 11 09:11:58 2017 -0500
Merge branch 'maint-0.2.4' into maint-0.2.5
changes/geoip-january2017 | 4 +
src/config/geoip | 3160 +++++++++++++++++++++++++++++----------------
src/config/geoip6 | 561 +++++++-
3 files changed, 2552 insertions(+), 1173 deletions(-)
1
0

11 Jan '17
commit 817b93caca99a2cdf92ac6877009a061b67a36e0
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Wed Jan 11 14:40:40 2017 +0100
Extend order parameter to first_seen.
Implements #21095.
---
CHANGELOG.md | 3 +-
build.xml | 2 +-
.../onionoo/docs/DetailsDocumentFields.java | 13 +++
.../org/torproject/onionoo/server/NodeIndex.java | 12 ---
.../org/torproject/onionoo/server/NodeIndexer.java | 15 ---
.../onionoo/server/OrderParameterValues.java | 24 +++++
.../torproject/onionoo/server/RequestHandler.java | 43 ++++-----
.../torproject/onionoo/server/ResourceServlet.java | 40 ++++++--
.../torproject/onionoo/server/ResponseBuilder.java | 7 +-
.../onionoo/server/SummaryDocumentComparator.java | 51 ++++++++++
src/main/resources/web/protocol.html | 7 +-
.../onionoo/server/ResourceServletTest.java | 59 ++++++++++--
.../server/SummaryDocumentComparatorTest.java | 105 +++++++++++++++++++++
13 files changed, 307 insertions(+), 74 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6d01ec0..4ed4e98 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,4 +1,4 @@
-# Changes in version x.x.x - 2017-xx-xx
+# Changes in version 3.2-1.x.x - 2017-xx-xx
* Major changes
- Fix a bug where we'd believe that we have first seen a bridge on
@@ -13,6 +13,7 @@
- Accept the same characters in qualified search terms as in their
parameter equivalents.
- Exclude bandwidth history values from the future.
+ - Extend order parameter to "first_seen".
* Minor changes
- Include XZ binaries in release binaries.
diff --git a/build.xml b/build.xml
index 3c2ad5c..5bfea72 100644
--- a/build.xml
+++ b/build.xml
@@ -8,7 +8,7 @@
<property name="javadoc-title" value="Onionoo API Documentation"/>
<property name="implementation-title" value="Onionoo" />
- <property name="onionoo.protocol.version" value="3.1"/>
+ <property name="onionoo.protocol.version" value="3.2"/>
<property name="release.version"
value="${onionoo.protocol.version}-1.0.0-dev"/>
<property name="descriptorversion" value="1.5.0"/>
diff --git a/src/main/java/org/torproject/onionoo/docs/DetailsDocumentFields.java b/src/main/java/org/torproject/onionoo/docs/DetailsDocumentFields.java
new file mode 100644
index 0000000..df46149
--- /dev/null
+++ b/src/main/java/org/torproject/onionoo/docs/DetailsDocumentFields.java
@@ -0,0 +1,13 @@
+/* Copyright 2017 The Tor Project
+ * See LICENSE for licensing information */
+
+package org.torproject.onionoo.docs;
+
+/** Provides constants for details document field names. */
+public interface DetailsDocumentFields {
+
+ public static final String FIRST_SEEN = "first_seen";
+
+ public static final String CONSENSUS_WEIGHT = "consensus_weight";
+}
+
diff --git a/src/main/java/org/torproject/onionoo/server/NodeIndex.java b/src/main/java/org/torproject/onionoo/server/NodeIndex.java
index 9f9cf74..439d302 100644
--- a/src/main/java/org/torproject/onionoo/server/NodeIndex.java
+++ b/src/main/java/org/torproject/onionoo/server/NodeIndex.java
@@ -6,7 +6,6 @@ package org.torproject.onionoo.server;
import org.torproject.onionoo.docs.SummaryDocument;
import java.text.SimpleDateFormat;
-import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
@@ -42,17 +41,6 @@ class NodeIndex {
return bridgesPublishedString;
}
- private List<String> relaysByConsensusWeight;
-
- public void setRelaysByConsensusWeight(
- List<String> relaysByConsensusWeight) {
- this.relaysByConsensusWeight = relaysByConsensusWeight;
- }
-
- public List<String> getRelaysByConsensusWeight() {
- return relaysByConsensusWeight;
- }
-
private Map<String, SummaryDocument> relayFingerprintSummaryLines;
public void setRelayFingerprintSummaryLines(
diff --git a/src/main/java/org/torproject/onionoo/server/NodeIndexer.java b/src/main/java/org/torproject/onionoo/server/NodeIndexer.java
index 1229e6b..d380aaa 100644
--- a/src/main/java/org/torproject/onionoo/server/NodeIndexer.java
+++ b/src/main/java/org/torproject/onionoo/server/NodeIndexer.java
@@ -14,11 +14,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.SortedMap;
@@ -177,7 +174,6 @@ public class NodeIndexer implements ServletContextListener, Runnable {
}
}
Time time = TimeFactory.getTime();
- List<String> orderRelaysByConsensusWeight = new ArrayList<String>();
/* This variable can go away once all Onionoo services had their
* hourly updater write effective families to summary documents at
* least once. Remove this code after September 8, 2015. */
@@ -188,11 +184,6 @@ public class NodeIndexer implements ServletContextListener, Runnable {
.toUpperCase();
newRelayFingerprintSummaryLines.put(fingerprint, entry);
newRelayFingerprintSummaryLines.put(hashedFingerprint, entry);
- long consensusWeight = entry.getConsensusWeight();
- orderRelaysByConsensusWeight.add(String.format("%020d %s",
- consensusWeight, fingerprint));
- orderRelaysByConsensusWeight.add(String.format("%020d %s",
- consensusWeight, hashedFingerprint));
if (entry.getCountryCode() != null) {
String countryCode = entry.getCountryCode();
if (!newRelaysByCountryCode.containsKey(countryCode)) {
@@ -254,11 +245,6 @@ public class NodeIndexer implements ServletContextListener, Runnable {
newRelaysByContact.get(contact).add(fingerprint);
newRelaysByContact.get(contact).add(hashedFingerprint);
}
- Collections.sort(orderRelaysByConsensusWeight);
- List<String> newRelaysByConsensusWeight = new ArrayList<String>();
- for (String relay : orderRelaysByConsensusWeight) {
- newRelaysByConsensusWeight.add(relay.split(" ")[1]);
- }
/* This loop can go away once all Onionoo services had their hourly
* updater write effective families to summary documents at least
* once. Remove this code after September 8, 2015. */
@@ -313,7 +299,6 @@ public class NodeIndexer implements ServletContextListener, Runnable {
hashedHashedFingerprint);
}
NodeIndex newNodeIndex = new NodeIndex();
- newNodeIndex.setRelaysByConsensusWeight(newRelaysByConsensusWeight);
newNodeIndex.setRelayFingerprintSummaryLines(
newRelayFingerprintSummaryLines);
newNodeIndex.setBridgeFingerprintSummaryLines(
diff --git a/src/main/java/org/torproject/onionoo/server/OrderParameterValues.java b/src/main/java/org/torproject/onionoo/server/OrderParameterValues.java
new file mode 100644
index 0000000..eec47ef
--- /dev/null
+++ b/src/main/java/org/torproject/onionoo/server/OrderParameterValues.java
@@ -0,0 +1,24 @@
+/* Copyright 2017 The Tor Project
+ * See LICENSE for licensing information */
+
+package org.torproject.onionoo.server;
+
+import org.torproject.onionoo.docs.DetailsDocumentFields;
+
+/** Provides constants for order parameter values. */
+public class OrderParameterValues {
+
+ private static final String DESCENDING = "-";
+
+ public static final String FIRST_SEEN_ASC = DetailsDocumentFields.FIRST_SEEN;
+
+ public static final String FIRST_SEEN_DES =
+ DESCENDING + DetailsDocumentFields.FIRST_SEEN;
+
+ public static final String CONSENSUS_WEIGHT_ASC =
+ DetailsDocumentFields.CONSENSUS_WEIGHT;
+
+ public static final String CONSENSUS_WEIGHT_DES =
+ DESCENDING + DetailsDocumentFields.CONSENSUS_WEIGHT;
+}
+
diff --git a/src/main/java/org/torproject/onionoo/server/RequestHandler.java b/src/main/java/org/torproject/onionoo/server/RequestHandler.java
index c94edd4..36d817f 100644
--- a/src/main/java/org/torproject/onionoo/server/RequestHandler.java
+++ b/src/main/java/org/torproject/onionoo/server/RequestHandler.java
@@ -10,6 +10,7 @@ import org.torproject.onionoo.docs.SummaryDocument;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
+import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
@@ -513,34 +514,26 @@ public class RequestHandler {
}
private void order() {
- if (this.order != null && this.order.length == 1) {
- List<String> orderBy = new ArrayList<String>(
- this.nodeIndex.getRelaysByConsensusWeight());
- if (this.order[0].startsWith("-")) {
- Collections.reverse(orderBy);
+ List<SummaryDocument> uniqueRelays = new ArrayList<>();
+ List<SummaryDocument> uniqueBridges = new ArrayList<>();
+ for (SummaryDocument relay : this.filteredRelays.values()) {
+ if (!uniqueRelays.contains(relay)) {
+ uniqueRelays.add(relay);
}
- for (String relay : orderBy) {
- if (this.filteredRelays.containsKey(relay)
- && !this.orderedRelays.contains(filteredRelays.get(relay))) {
- this.orderedRelays.add(this.filteredRelays.remove(relay));
- }
- }
- for (String relay : this.filteredRelays.keySet()) {
- if (!this.orderedRelays.contains(this.filteredRelays.get(relay))) {
- this.orderedRelays.add(this.filteredRelays.remove(relay));
- }
+ }
+ for (SummaryDocument bridge : this.filteredBridges.values()) {
+ if (!uniqueBridges.contains(bridge)) {
+ uniqueBridges.add(bridge);
}
- Set<SummaryDocument> uniqueBridges = new HashSet<SummaryDocument>(
- this.filteredBridges.values());
- this.orderedBridges.addAll(uniqueBridges);
- } else {
- Set<SummaryDocument> uniqueRelays = new HashSet<SummaryDocument>(
- this.filteredRelays.values());
- this.orderedRelays.addAll(uniqueRelays);
- Set<SummaryDocument> uniqueBridges = new HashSet<SummaryDocument>(
- this.filteredBridges.values());
- this.orderedBridges.addAll(uniqueBridges);
}
+ if (this.order != null) {
+ Comparator<SummaryDocument> comparator
+ = new SummaryDocumentComparator(this.order);
+ Collections.sort(uniqueRelays, comparator);
+ Collections.sort(uniqueBridges, comparator);
+ }
+ this.orderedRelays.addAll(uniqueRelays);
+ this.orderedBridges.addAll(uniqueBridges);
}
private void offset() {
diff --git a/src/main/java/org/torproject/onionoo/server/ResourceServlet.java b/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
index 45a52a2..3818731 100644
--- a/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
+++ b/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
@@ -267,16 +267,12 @@ public class ResourceServlet extends HttpServlet {
rh.setContact(contactParts);
}
if (parameterMap.containsKey("order")) {
- String orderParameter = parameterMap.get("order").toLowerCase();
- String orderByField = orderParameter;
- if (orderByField.startsWith("-")) {
- orderByField = orderByField.substring(1);
- }
- if (!orderByField.equals("consensus_weight")) {
+ String[] order = this.parseOrderParameter(parameterMap.get("order"));
+ if (order == null) {
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
- rh.setOrder(new String[] { orderParameter });
+ rh.setOrder(order);
}
if (parameterMap.containsKey("offset")) {
String offsetParameter = parameterMap.get("offset");
@@ -483,6 +479,36 @@ public class ResourceServlet extends HttpServlet {
return parameter.split(" ");
}
+ private static Pattern orderParameterPattern =
+ Pattern.compile("^[0-9a-zA-Z_,-]*$");
+
+ private static HashSet<String> knownOrderParameters = new HashSet<>(
+ Arrays.asList(new String[] { OrderParameterValues.CONSENSUS_WEIGHT_ASC,
+ OrderParameterValues.CONSENSUS_WEIGHT_DES,
+ OrderParameterValues.FIRST_SEEN_ASC,
+ OrderParameterValues.FIRST_SEEN_DES }));
+
+ private String[] parseOrderParameter(String parameter) {
+ if (!orderParameterPattern.matcher(parameter).matches()) {
+ /* Orders contain illegal character(s). */
+ return null;
+ }
+ String[] orderParameters = parameter.toLowerCase().split(",");
+ Set<String> seenOrderParameters = new HashSet<>();
+ for (String orderParameter : orderParameters) {
+ if (!knownOrderParameters.contains(orderParameter)) {
+ /* Unknown order parameter. */
+ return null;
+ }
+ if (!seenOrderParameters.add(orderParameter.startsWith("-")
+ ? orderParameter.substring(1) : orderParameter)) {
+ /* Duplicate parameter. */
+ return null;
+ }
+ }
+ return orderParameters;
+ }
+
private static Pattern fieldsParameterPattern =
Pattern.compile("^[0-9a-zA-Z_,]*$");
diff --git a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
index bb532f6..1986784 100644
--- a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
+++ b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
@@ -6,6 +6,7 @@ package org.torproject.onionoo.server;
import org.torproject.onionoo.docs.BandwidthDocument;
import org.torproject.onionoo.docs.ClientsDocument;
import org.torproject.onionoo.docs.DetailsDocument;
+import org.torproject.onionoo.docs.DetailsDocumentFields;
import org.torproject.onionoo.docs.DocumentStore;
import org.torproject.onionoo.docs.DocumentStoreFactory;
import org.torproject.onionoo.docs.SummaryDocument;
@@ -77,7 +78,7 @@ public class ResponseBuilder {
return this.charsWritten;
}
- private static final String PROTOCOL_VERSION = "3.1";
+ private static final String PROTOCOL_VERSION = "3.2";
private static final String NEXT_MAJOR_VERSION_SCHEDULED = null;
@@ -205,7 +206,7 @@ public class ResponseBuilder {
} else if (field.equals("last_changed_address_or_port")) {
dd.setLastChangedAddressOrPort(
detailsDocument.getLastChangedAddressOrPort());
- } else if (field.equals("first_seen")) {
+ } else if (field.equals(DetailsDocumentFields.FIRST_SEEN)) {
dd.setFirstSeen(detailsDocument.getFirstSeen());
} else if (field.equals("running")) {
dd.setRunning(detailsDocument.getRunning());
@@ -227,7 +228,7 @@ public class ResponseBuilder {
dd.setAsNumber(detailsDocument.getAsNumber());
} else if (field.equals("as_name")) {
dd.setAsName(detailsDocument.getAsName());
- } else if (field.equals("consensus_weight")) {
+ } else if (field.equals(DetailsDocumentFields.CONSENSUS_WEIGHT)) {
dd.setConsensusWeight(detailsDocument.getConsensusWeight());
} else if (field.equals("host_name")) {
dd.setHostName(detailsDocument.getHostName());
diff --git a/src/main/java/org/torproject/onionoo/server/SummaryDocumentComparator.java b/src/main/java/org/torproject/onionoo/server/SummaryDocumentComparator.java
new file mode 100644
index 0000000..64f61cc
--- /dev/null
+++ b/src/main/java/org/torproject/onionoo/server/SummaryDocumentComparator.java
@@ -0,0 +1,51 @@
+/* Copyright 2017 The Tor Project
+ * See LICENSE for licensing information */
+
+package org.torproject.onionoo.server;
+
+import org.torproject.onionoo.docs.SummaryDocument;
+
+import java.util.Comparator;
+
+public class SummaryDocumentComparator implements Comparator<SummaryDocument> {
+
+ private final String[] orderParameters;
+
+ /** Comparator is initialized with the order parameters. */
+ public SummaryDocumentComparator(String ... orderParameters) {
+ this.orderParameters = orderParameters;
+ }
+
+ @Override
+ public int compare(SummaryDocument o1, SummaryDocument o2) {
+ int result = 0;
+ for (String orderParameter : orderParameters) {
+ switch (orderParameter) {
+ case OrderParameterValues.CONSENSUS_WEIGHT_ASC:
+ result = Long.compare(o1.getConsensusWeight(),
+ o2.getConsensusWeight());
+ break;
+ case OrderParameterValues.CONSENSUS_WEIGHT_DES:
+ result = Long.compare(o2.getConsensusWeight(),
+ o1.getConsensusWeight());
+ break;
+ case OrderParameterValues.FIRST_SEEN_ASC:
+ result = Long.compare(o1.getFirstSeenMillis(),
+ o2.getFirstSeenMillis());
+ break;
+ case OrderParameterValues.FIRST_SEEN_DES:
+ result = Long.compare(o2.getFirstSeenMillis(),
+ o1.getFirstSeenMillis());
+ break;
+ default:
+ throw new RuntimeException("Invalid order parameter: "
+ + orderParameter + ". Check initialization of this class!");
+ }
+ if (result != 0) {
+ break;
+ }
+ }
+ return result;
+ }
+}
+
diff --git a/src/main/resources/web/protocol.html b/src/main/resources/web/protocol.html
index 6e8dc34..f13e41c 100644
--- a/src/main/resources/web/protocol.html
+++ b/src/main/resources/web/protocol.html
@@ -187,6 +187,8 @@ documents on August 25, 2015.</li>
characters of a space-separated fingerprint on November 15, 2015.</li>
<li><strong>3.1</strong>: Removed optional "family" field on January 18,
2016.</li>
+<li><strong>3.2</strong>: Extended order parameter to "first_seen" on
+January 11, 2017.</li>
</ul>
</div> <!-- box -->
@@ -473,10 +475,13 @@ Re-order results by a comma-separated list
of fields in ascending or descending order.
Results are first ordered by the first list element, then by the second,
and so on.
-Possible fields for ordering are: <strong>consensus_weight</strong>.
+Possible fields for ordering are: <strong>consensus_weight</strong> and
+<strong>first_seen</strong>.
Field names are case-insensitive.
Ascending order is the default; descending order is selected by prepending
fields with a minus sign (<strong>-</strong>).
+Field names can be listed at most once in either ascending or descending
+order.
Relays or bridges which don't have any value for a field to be ordered by
are always appended to the end, regardless or sorting order.
The ordering is defined independent of the requested document type and
diff --git a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
index f17e228..e7358ea 100644
--- a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
+++ b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
@@ -1123,9 +1123,9 @@ public class ResourceServletTest {
}
@Test()
- public void testFirstSeenDaysSixToSixteen() {
+ public void testFirstSeenDaysSevenToSixteen() {
this.assertSummaryDocument(
- "/summary?first_seen_days=6-16", 2, null, 1, null);
+ "/summary?first_seen_days=7-16", 2, null, 1, null);
}
@Test()
@@ -1253,7 +1253,7 @@ public class ResourceServletTest {
@Test()
public void testOrderConsensusWeightAscending() {
this.assertSummaryDocument(
- "/summary?order=consensus_weight", 3,
+ "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC, 3,
new String[] { "TorkaZ", "TimMayTribute", "Ferrari458" }, 3,
null);
}
@@ -1261,7 +1261,7 @@ public class ResourceServletTest {
@Test()
public void testOrderConsensusWeightDescending() {
this.assertSummaryDocument(
- "/summary?order=-consensus_weight", 3,
+ "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_DES, 3,
new String[] { "Ferrari458", "TimMayTribute", "TorkaZ" }, 3,
null);
}
@@ -1269,13 +1269,15 @@ public class ResourceServletTest {
@Test()
public void testOrderConsensusWeightAscendingTwice() {
this.assertErrorStatusCode(
- "/summary?order=consensus_weight,consensus_weight", 400);
+ "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC
+ + "," + OrderParameterValues.CONSENSUS_WEIGHT_ASC, 400);
}
@Test()
public void testOrderConsensusWeightAscendingThenDescending() {
this.assertErrorStatusCode(
- "/summary?order=consensus_weight,-consensus_weight", 400);
+ "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC + ","
+ + OrderParameterValues.CONSENSUS_WEIGHT_DES + "", 400);
}
@Test()
@@ -1295,18 +1297,57 @@ public class ResourceServletTest {
@Test()
public void testOrderConsensusWeightAscendingLimit1() {
this.assertSummaryDocument(
- "/summary?order=consensus_weight&limit=1", 1,
+ "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC
+ + "&limit=1", 1,
new String[] { "TorkaZ" }, 0, null);
}
@Test()
- public void testOrderConsensusWeightDecendingLimit1() {
+ public void testOrderConsensusWeightDescendingLimit1() {
this.assertSummaryDocument(
- "/summary?order=-consensus_weight&limit=1", 1,
+ "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_DES
+ + "&limit=1", 1,
new String[] { "Ferrari458" }, 0, null);
}
@Test()
+ public void testOrderConsensusWeightFiveTimes() {
+ this.assertErrorStatusCode(
+ "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC + ","
+ + OrderParameterValues.CONSENSUS_WEIGHT_ASC + ","
+ + OrderParameterValues.CONSENSUS_WEIGHT_ASC + ","
+ + OrderParameterValues.CONSENSUS_WEIGHT_ASC + ","
+ + OrderParameterValues.CONSENSUS_WEIGHT_ASC, 400);
+ }
+
+ @Test()
+ public void testOrderFirstSeenThenConsensusWeight() {
+ this.assertSummaryDocument(
+ "/summary?order=" + OrderParameterValues.FIRST_SEEN_ASC + ","
+ + OrderParameterValues.CONSENSUS_WEIGHT_ASC, 3,
+ new String[] { "TimMayTribute", "Ferrari458", "TorkaZ" }, 3,
+ new String[] { "gummy", null, "ec2bridgercc7f31fe" });
+ }
+
+ @Test()
+ public void testOrderFirstSeenDescendingThenConsensusWeight() {
+ this.assertSummaryDocument("/summary?order="
+ + OrderParameterValues.FIRST_SEEN_DES + ","
+ + OrderParameterValues.CONSENSUS_WEIGHT_ASC, 3,
+ new String[] { "TorkaZ", "TimMayTribute", "Ferrari458" }, 3,
+ new String[] { "ec2bridgercc7f31fe", null, "gummy" });
+ }
+
+ @Test()
+ public void testOrderConsensusWeightThenFirstSeenDescending() {
+ this.assertSummaryDocument(
+ "/summary?order=" + OrderParameterValues.CONSENSUS_WEIGHT_ASC + ","
+ + OrderParameterValues.FIRST_SEEN_DES, 3,
+ new String[] { "TorkaZ", "TimMayTribute", "Ferrari458" }, 3,
+ null);
+ }
+
+ @Test()
public void testOffsetOne() {
this.assertSummaryDocument(
"/summary?offset=1", 2, null, 3, null);
diff --git a/src/test/java/org/torproject/onionoo/server/SummaryDocumentComparatorTest.java b/src/test/java/org/torproject/onionoo/server/SummaryDocumentComparatorTest.java
new file mode 100644
index 0000000..c1d909f
--- /dev/null
+++ b/src/test/java/org/torproject/onionoo/server/SummaryDocumentComparatorTest.java
@@ -0,0 +1,105 @@
+/* Copyright 2017 The Tor Project
+ * See LICENSE for licensing information */
+
+package org.torproject.onionoo.server;
+
+import static org.junit.Assert.assertEquals;
+
+import org.torproject.onionoo.docs.DateTimeHelper;
+import org.torproject.onionoo.docs.DetailsDocumentFields;
+import org.torproject.onionoo.docs.SummaryDocument;
+
+import org.hamcrest.Matchers;
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.junit.runners.Parameterized.Parameters;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.TreeSet;
+
+(a)RunWith(Parameterized.class)
+public class SummaryDocumentComparatorTest {
+
+ @Rule
+ public ExpectedException thrown = ExpectedException.none();
+
+ private SummaryDocument createSummaryDoc() {
+ return new SummaryDocument(true, "TorkaZ",
+ "000C5F55BD4814B917CC474BD537F1A3B33CCE2A", Arrays.asList(
+ new String[] { "62.216.201.221", "62.216.201.222",
+ "62.216.201.223" }), DateTimeHelper.parse("2013-04-19 05:00:00"),
+ false, new TreeSet<>(Arrays.asList(new String[] { "Running",
+ "Valid" })), 20L, "de",
+ DateTimeHelper.parse("2013-04-18 05:00:00"), "AS8767",
+ "torkaz <klaus dot zufall at gmx dot de> "
+ + "<fb-token:np5_g_83jmf=>", new TreeSet<>(Arrays.asList(
+ new String[] { "001C13B3A55A71B977CA65EC85539D79C653A3FC",
+ "0025C136C1F3A9EEFE2AE3F918F03BFA21B5070B" })),
+ new TreeSet<>(Arrays.asList(
+ new String[] { "001C13B3A55A71B977CA65EC85539D79C653A3FC" })));
+ }
+
+ /** Some values for running all comparison types. */
+ @Parameters
+ public static Collection<Object[]> data() {
+ return Arrays.asList(new Object[][] {
+ {OrderParameterValues.FIRST_SEEN_ASC, new long[]{1234L, 85968L}},
+ {OrderParameterValues.FIRST_SEEN_DES, new long[]{12345L, 859689L}},
+ {OrderParameterValues.CONSENSUS_WEIGHT_ASC, new long[]{12340L, 85968L}},
+ {OrderParameterValues.CONSENSUS_WEIGHT_DES, new long[]{1234L, 59680L}},
+ {OrderParameterValues.FIRST_SEEN_ASC, new long[]{91234L, 5968L}},
+ {OrderParameterValues.FIRST_SEEN_DES, new long[]{912345L, 59689L}},
+ {OrderParameterValues.CONSENSUS_WEIGHT_ASC, new long[]{912340L, 5968L}},
+ {OrderParameterValues.CONSENSUS_WEIGHT_DES, new long[]{91234L, 59680L}},
+ {OrderParameterValues.FIRST_SEEN_ASC, new long[]{1234L, 1234L}},
+ {OrderParameterValues.FIRST_SEEN_DES, new long[]{12345L, 12345L}},
+ {OrderParameterValues.CONSENSUS_WEIGHT_ASC, new long[]{12340L, 12340L}},
+ {OrderParameterValues.CONSENSUS_WEIGHT_DES, new long[]{1234L, 1234L}}
+ }
+ );
+ }
+
+ private SummaryDocument[] sd = new SummaryDocument[2];
+ private String order;
+ private int expected;
+
+ /** This constructor receives the above defined data for each run. */
+ public SummaryDocumentComparatorTest(String order, long[] vals) {
+ for (int i = 0; i < sd.length; i++) {
+ sd[i] = createSummaryDoc();
+ if (order.contains(DetailsDocumentFields.FIRST_SEEN)) {
+ sd[i].setFirstSeenMillis(vals[i]);
+ } else {
+ sd[i].setConsensusWeight(vals[i]);
+ }
+ }
+ this.order = order;
+ this.expected = Long.compare(vals[0], vals[1]);
+ if (order.contains("-")) {
+ this.expected = - this.expected;
+ }
+ }
+
+ @Test()
+ public void testInvalidParameter() {
+ String[] dummy = {OrderParameterValues.FIRST_SEEN_DES, "odd parameter"};
+ thrown.expect(RuntimeException.class);
+ thrown.expectMessage(Matchers
+ .allOf(Matchers.containsString("Invalid order parameter"),
+ Matchers.containsString(dummy[1])));
+ SummaryDocumentComparator sdc = new SummaryDocumentComparator(dummy);
+ sdc.compare(createSummaryDoc(), createSummaryDoc());
+ }
+
+ @Test()
+ public void testRegularComparisons() {
+ SummaryDocumentComparator sdc
+ = new SummaryDocumentComparator(this.order);
+ assertEquals(this.expected, sdc.compare(this.sd[0], this.sd[1]));
+ }
+
+}
1
0
commit c47806764c69eaf246cbc9032d2dbaba7ca95a8e
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Tue Jan 10 15:16:39 2017 +0100
Use diamond operator.
---
.../torproject/onionoo/docs/BandwidthStatus.java | 9 +--
.../onionoo/docs/ClientsGraphHistory.java | 2 +-
.../torproject/onionoo/docs/ClientsHistory.java | 2 +-
.../org/torproject/onionoo/docs/ClientsStatus.java | 6 +-
.../torproject/onionoo/docs/DateTimeHelper.java | 2 +-
.../org/torproject/onionoo/docs/DetailsStatus.java | 2 +-
.../org/torproject/onionoo/docs/DocumentStore.java | 32 ++++----
.../org/torproject/onionoo/docs/NodeStatus.java | 40 +++++-----
.../torproject/onionoo/docs/SummaryDocument.java | 4 +-
.../org/torproject/onionoo/docs/UptimeHistory.java | 2 +-
.../org/torproject/onionoo/docs/UptimeStatus.java | 11 +--
.../org/torproject/onionoo/docs/WeightsStatus.java | 3 +-
.../onionoo/server/MostFrequentString.java | 7 +-
.../org/torproject/onionoo/server/NodeIndexer.java | 43 ++++------
.../torproject/onionoo/server/RequestHandler.java | 35 ++++----
.../torproject/onionoo/server/ResourceServlet.java | 8 +-
.../torproject/onionoo/server/ResponseBuilder.java | 6 +-
.../onionoo/updater/ClientsStatusUpdater.java | 5 +-
.../onionoo/updater/DescriptorDownloader.java | 4 +-
.../onionoo/updater/DescriptorQueue.java | 5 +-
.../onionoo/updater/DescriptorSource.java | 5 +-
.../torproject/onionoo/updater/LookupService.java | 21 +++--
.../onionoo/updater/NodeDetailsStatusUpdater.java | 93 +++++++++-------------
.../onionoo/updater/ReverseDomainNameResolver.java | 10 +--
.../onionoo/updater/UptimeStatusUpdater.java | 25 +++---
.../onionoo/updater/WeightsStatusUpdater.java | 17 ++--
.../onionoo/writer/BandwidthDocumentWriter.java | 7 +-
.../onionoo/writer/ClientsDocumentWriter.java | 22 +++--
.../onionoo/writer/DetailsDocumentWriter.java | 17 ++--
.../onionoo/writer/SummaryDocumentWriter.java | 2 +-
.../onionoo/writer/UptimeDocumentWriter.java | 19 ++---
.../onionoo/writer/WeightsDocumentWriter.java | 7 +-
.../onionoo/docs/BandwidthStatusTest.java | 3 +-
.../onionoo/docs/DummyDocumentStore.java | 5 +-
.../torproject/onionoo/docs/NodeStatusTest.java | 6 +-
.../onionoo/docs/SummaryDocumentTest.java | 6 +-
.../torproject/onionoo/docs/UptimeStatusTest.java | 2 +-
.../onionoo/server/ResourceServletTest.java | 26 +++---
.../torproject/onionoo/updater/DummyConsensus.java | 2 +-
.../onionoo/updater/DummyDescriptorSource.java | 5 +-
.../onionoo/updater/DummyStatusEntry.java | 2 +-
.../onionoo/updater/LookupServiceTest.java | 70 ++++++++--------
42 files changed, 257 insertions(+), 343 deletions(-)
diff --git a/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java b/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
index 580bfbd..911af2a 100644
--- a/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
@@ -29,8 +29,7 @@ public class BandwidthStatus extends Document {
this.isDirty = false;
}
- private SortedMap<Long, long[]> writeHistory =
- new TreeMap<Long, long[]>();
+ private SortedMap<Long, long[]> writeHistory = new TreeMap<>();
public void setWriteHistory(SortedMap<Long, long[]> writeHistory) {
this.writeHistory = writeHistory;
@@ -40,8 +39,7 @@ public class BandwidthStatus extends Document {
return this.writeHistory;
}
- private SortedMap<Long, long[]> readHistory =
- new TreeMap<Long, long[]>();
+ private SortedMap<Long, long[]> readHistory = new TreeMap<>();
public void setReadHistory(SortedMap<Long, long[]> readHistory) {
this.readHistory = readHistory;
@@ -117,8 +115,7 @@ public class BandwidthStatus extends Document {
}
private void compressHistory(SortedMap<Long, long[]> history) {
- SortedMap<Long, long[]> uncompressedHistory =
- new TreeMap<Long, long[]>(history);
+ SortedMap<Long, long[]> uncompressedHistory = new TreeMap<>(history);
history.clear();
long lastStartMillis = 0L;
long lastEndMillis = 0L;
diff --git a/src/main/java/org/torproject/onionoo/docs/ClientsGraphHistory.java b/src/main/java/org/torproject/onionoo/docs/ClientsGraphHistory.java
index df538a9..6b2bd3d 100644
--- a/src/main/java/org/torproject/onionoo/docs/ClientsGraphHistory.java
+++ b/src/main/java/org/torproject/onionoo/docs/ClientsGraphHistory.java
@@ -59,7 +59,7 @@ public class ClientsGraphHistory {
return this.count;
}
- private List<Integer> values = new ArrayList<Integer>();
+ private List<Integer> values = new ArrayList<>();
public void setValues(List<Integer> values) {
this.values = values;
diff --git a/src/main/java/org/torproject/onionoo/docs/ClientsHistory.java b/src/main/java/org/torproject/onionoo/docs/ClientsHistory.java
index e1f0353..c1c93fd 100644
--- a/src/main/java/org/torproject/onionoo/docs/ClientsHistory.java
+++ b/src/main/java/org/torproject/onionoo/docs/ClientsHistory.java
@@ -117,7 +117,7 @@ public class ClientsHistory implements Comparable<ClientsHistory> {
private static SortedMap<String, Double> parseResponses(
String responsesString) {
- SortedMap<String, Double> responses = new TreeMap<String, Double>();
+ SortedMap<String, Double> responses = new TreeMap<>();
if (responsesString.length() > 0) {
for (String pair : responsesString.split(",")) {
String[] keyValue = pair.split("=");
diff --git a/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java b/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java
index 55bdc7b..cfc424e 100644
--- a/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java
@@ -27,8 +27,7 @@ public class ClientsStatus extends Document {
this.isDirty = false;
}
- private SortedSet<ClientsHistory> history =
- new TreeSet<ClientsHistory>();
+ private SortedSet<ClientsHistory> history = new TreeSet<>();
public void setHistory(SortedSet<ClientsHistory> history) {
this.history = history;
@@ -73,8 +72,7 @@ public class ClientsStatus extends Document {
/** Compresses the history of clients objects by merging adjacent
* intervals, depending on how far back in the past they lie. */
public void compressHistory() {
- SortedSet<ClientsHistory> uncompressedHistory =
- new TreeSet<ClientsHistory>(this.history);
+ SortedSet<ClientsHistory> uncompressedHistory = new TreeSet<>(this.history);
history.clear();
ClientsHistory lastResponses = null;
String lastMonthString = "1970-01";
diff --git a/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java b/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java
index 9721612..7a63f53 100644
--- a/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java
+++ b/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java
@@ -78,7 +78,7 @@ public class DateTimeHelper {
}
protected Map<String, DateFormat> initialValue() {
- return new HashMap<String, DateFormat>();
+ return new HashMap<>();
}
public void remove() {
diff --git a/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java b/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java
index bad3964..0a0c215 100644
--- a/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java
@@ -255,7 +255,7 @@ public class DetailsStatus extends Document {
* includes the primary address and all additionally configured
* onion-routing addresses. */
public SortedSet<String> getOrAddresses() {
- SortedSet<String> orAddresses = new TreeSet<String>();
+ SortedSet<String> orAddresses = new TreeSet<>();
if (this.address != null) {
orAddresses.add(this.address);
}
diff --git a/src/main/java/org/torproject/onionoo/docs/DocumentStore.java b/src/main/java/org/torproject/onionoo/docs/DocumentStore.java
index 08fb984..39d6271 100644
--- a/src/main/java/org/torproject/onionoo/docs/DocumentStore.java
+++ b/src/main/java/org/torproject/onionoo/docs/DocumentStore.java
@@ -115,15 +115,14 @@ public class DocumentStore {
this.cacheNodeStatuses();
}
if (updatedAfter >= this.lastModifiedNodeStatuses) {
- return new TreeSet<String>(this.updatedNodeStatuses);
+ return new TreeSet<>(this.updatedNodeStatuses);
} else {
- return new TreeSet<String>(this.cachedNodeStatuses.keySet());
+ return new TreeSet<>(this.cachedNodeStatuses.keySet());
}
}
private void cacheNodeStatuses() {
- SortedMap<String, NodeStatus> parsedNodeStatuses =
- new TreeMap<String, NodeStatus>();
+ SortedMap<String, NodeStatus> parsedNodeStatuses = new TreeMap<>();
File directory = this.statusDir;
if (directory != null) {
File summaryFile = new File(directory, "summary");
@@ -150,7 +149,7 @@ public class DocumentStore {
}
}
this.cachedNodeStatuses = parsedNodeStatuses;
- this.updatedNodeStatuses = new TreeSet<String>();
+ this.updatedNodeStatuses = new TreeSet<>();
}
private SortedSet<String> listSummaryDocuments(long updatedAfter) {
@@ -158,15 +157,14 @@ public class DocumentStore {
this.cacheSummaryDocuments();
}
if (updatedAfter >= this.lastModifiedSummaryDocuments) {
- return new TreeSet<String>(this.updatedSummaryDocuments);
+ return new TreeSet<>(this.updatedSummaryDocuments);
} else {
- return new TreeSet<String>(this.cachedSummaryDocuments.keySet());
+ return new TreeSet<>(this.cachedSummaryDocuments.keySet());
}
}
private void cacheSummaryDocuments() {
- SortedMap<String, SummaryDocument> parsedSummaryDocuments =
- new TreeMap<String, SummaryDocument>();
+ SortedMap<String, SummaryDocument> parsedSummaryDocuments = new TreeMap<>();
if (this.outDir != null) {
File summaryFile = new File(this.outDir, "summary");
if (summaryFile.exists()) {
@@ -198,12 +196,12 @@ public class DocumentStore {
}
}
this.cachedSummaryDocuments = parsedSummaryDocuments;
- this.updatedSummaryDocuments = new TreeSet<String>();
+ this.updatedSummaryDocuments = new TreeSet<>();
}
private <T extends Document> SortedSet<String> listDocumentFiles(
Class<T> documentType, long updatedAfter) {
- SortedSet<String> fingerprints = new TreeSet<String>();
+ SortedSet<String> fingerprints = new TreeSet<>();
File directory = null;
String subdirectory = null;
if (documentType.equals(DetailsStatus.class)) {
@@ -238,7 +236,7 @@ public class DocumentStore {
subdirectory = "uptimes";
}
if (directory != null && subdirectory != null) {
- Stack<File> files = new Stack<File>();
+ Stack<File> files = new Stack<>();
files.add(new File(directory, subdirectory));
while (!files.isEmpty()) {
File file = files.pop();
@@ -418,7 +416,7 @@ public class DocumentStore {
boolean isRelay = detailsDocument.getHashedFingerprint() == null;
boolean running = false;
String nickname = detailsDocument.getNickname();
- List<String> addresses = new ArrayList<String>();
+ List<String> addresses = new ArrayList<>();
String countryCode = null;
String asNumber = null;
String contact = null;
@@ -443,7 +441,7 @@ public class DocumentStore {
}
}
}
- SortedSet<String> relayFlags = new TreeSet<String>();
+ SortedSet<String> relayFlags = new TreeSet<>();
SortedSet<String> family = null;
long lastSeenMillis = -1L;
long consensusWeight = -1L;
@@ -727,10 +725,8 @@ public class DocumentStore {
return;
}
File summaryFile = new File(directory, "summary");
- SortedMap<String, NodeStatus> cachedRelays =
- new TreeMap<String, NodeStatus>();
- SortedMap<String, NodeStatus> cachedBridges =
- new TreeMap<String, NodeStatus>();
+ SortedMap<String, NodeStatus> cachedRelays = new TreeMap<>();
+ SortedMap<String, NodeStatus> cachedBridges = new TreeMap<>();
for (Map.Entry<String, NodeStatus> e :
this.cachedNodeStatuses.entrySet()) {
if (e.getValue().isRelay()) {
diff --git a/src/main/java/org/torproject/onionoo/docs/NodeStatus.java b/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
index a2b44f8..7e4e438 100644
--- a/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
@@ -76,7 +76,7 @@ public class NodeStatus extends Document {
}
private SortedSet<String> stringArrayToSortedSet(String[] stringArray) {
- SortedSet<String> sortedSet = new TreeSet<String>();
+ SortedSet<String> sortedSet = new TreeSet<>();
if (stringArray != null) {
sortedSet.addAll(Arrays.asList(stringArray));
}
@@ -137,7 +137,7 @@ public class NodeStatus extends Document {
* includes the primary address and all additionally configured
* onion-routing addresses. */
public SortedSet<String> getOrAddresses() {
- SortedSet<String> orAddresses = new TreeSet<String>();
+ SortedSet<String> orAddresses = new TreeSet<>();
if (this.address != null) {
orAddresses.add(this.address);
}
@@ -193,11 +193,9 @@ public class NodeStatus extends Document {
return this.dirPort;
}
- private static Map<String, Integer> relayFlagIndexes =
- new HashMap<String, Integer>();
+ private static Map<String, Integer> relayFlagIndexes = new HashMap<>();
- private static Map<Integer, String> relayFlagStrings =
- new HashMap<Integer, String>();
+ private static Map<Integer, String> relayFlagStrings = new HashMap<>();
private BitSet relayFlags;
@@ -226,7 +224,7 @@ public class NodeStatus extends Document {
@SuppressWarnings("checkstyle:javadocmethod")
public SortedSet<String> getRelayFlags() {
- SortedSet<String> result = new TreeSet<String>();
+ SortedSet<String> result = new TreeSet<>();
if (this.relayFlags != null) {
for (int i = this.relayFlags.nextSetBit(0); i >= 0;
i = this.relayFlags.nextSetBit(i + 1)) {
@@ -267,10 +265,10 @@ public class NodeStatus extends Document {
}
private SortedMap<Long, Set<String>> lastAddresses =
- new TreeMap<Long, Set<String>>(Collections.reverseOrder());
+ new TreeMap<>(Collections.reverseOrder());
public SortedMap<Long, Set<String>> getLastAddresses() {
- return new TreeMap<Long, Set<String>>(this.lastAddresses);
+ return new TreeMap<>(this.lastAddresses);
}
/** Adds addresses and ports together with the time in milliseconds
@@ -278,7 +276,7 @@ public class NodeStatus extends Document {
* addresses and ports. */
public void addLastAddresses(long lastSeenMillis, String address,
int orPort, int dirPort, SortedSet<String> orAddressesAndPorts) {
- Set<String> addressesAndPorts = new HashSet<String>();
+ Set<String> addressesAndPorts = new HashSet<>();
addressesAndPorts.add(address + ":" + orPort);
if (dirPort > 0) {
addressesAndPorts.add(address + ":" + dirPort);
@@ -332,7 +330,7 @@ public class NodeStatus extends Document {
}
public SortedSet<String> getExitAddresses() {
- return new TreeSet<String>(this.exitAddresses);
+ return new TreeSet<>(this.exitAddresses);
}
/* GeoIP lookup results: */
@@ -396,7 +394,7 @@ public class NodeStatus extends Document {
* declared family that are not in a mutual family relationship with
* this relay. */
public SortedSet<String> getAllegedFamily() {
- SortedSet<String> allegedFamily = new TreeSet<String>(
+ SortedSet<String> allegedFamily = new TreeSet<>(
stringArrayToSortedSet(this.declaredFamily));
allegedFamily.removeAll(stringArrayToSortedSet(this.effectiveFamily));
return allegedFamily;
@@ -406,7 +404,7 @@ public class NodeStatus extends Document {
* reached via mutual family relationships except for those that can be
* reached directly via such a relationship. */
public SortedSet<String> getIndirectFamily() {
- SortedSet<String> indirectFamily = new TreeSet<String>(
+ SortedSet<String> indirectFamily = new TreeSet<>(
stringArrayToSortedSet(this.extendedFamily));
indirectFamily.removeAll(stringArrayToSortedSet(this.effectiveFamily));
return indirectFamily;
@@ -433,8 +431,8 @@ public class NodeStatus extends Document {
NodeStatus nodeStatus = new NodeStatus(fingerprint);
nodeStatus.setRelay(parts[0].equals("r"));
nodeStatus.setNickname(parts[1]);
- SortedSet<String> orAddressesAndPorts = new TreeSet<String>();
- SortedSet<String> exitAddresses = new TreeSet<String>();
+ SortedSet<String> orAddressesAndPorts = new TreeSet<>();
+ SortedSet<String> exitAddresses = new TreeSet<>();
String addresses = parts[3];
String address = null;
if (addresses.contains(";")) {
@@ -471,7 +469,7 @@ public class NodeStatus extends Document {
int dirPort = Integer.parseInt(parts[7]);
nodeStatus.setOrPort(orPort);
nodeStatus.setDirPort(dirPort);
- nodeStatus.setRelayFlags(new TreeSet<String>(
+ nodeStatus.setRelayFlags(new TreeSet<>(
Arrays.asList(parts[8].split(","))));
nodeStatus.setConsensusWeight(Long.parseLong(parts[9]));
nodeStatus.setCountryCode(parts[10]);
@@ -523,9 +521,9 @@ public class NodeStatus extends Document {
* 2. indirect members that can be reached via others only.
* Each group contains zero or more ';'-separated fingerprints. */
String[] groups = parts[22].split(":", -1);
- SortedSet<String> allegedFamily = new TreeSet<String>();
- SortedSet<String> effectiveFamily = new TreeSet<String>();
- SortedSet<String> indirectFamily = new TreeSet<String>();
+ SortedSet<String> allegedFamily = new TreeSet<>();
+ SortedSet<String> effectiveFamily = new TreeSet<>();
+ SortedSet<String> indirectFamily = new TreeSet<>();
if (groups[0].length() > 0) {
allegedFamily.addAll(Arrays.asList(groups[0].split(";")));
}
@@ -535,12 +533,12 @@ public class NodeStatus extends Document {
if (groups.length > 2 && groups[2].length() > 0) {
indirectFamily.addAll(Arrays.asList(groups[2].split(";")));
}
- SortedSet<String> declaredFamily = new TreeSet<String>();
+ SortedSet<String> declaredFamily = new TreeSet<>();
declaredFamily.addAll(allegedFamily);
declaredFamily.addAll(effectiveFamily);
nodeStatus.setDeclaredFamily(declaredFamily);
nodeStatus.setEffectiveFamily(effectiveFamily);
- SortedSet<String> extendedFamily = new TreeSet<String>();
+ SortedSet<String> extendedFamily = new TreeSet<>();
extendedFamily.addAll(effectiveFamily);
extendedFamily.addAll(indirectFamily);
nodeStatus.setExtendedFamily(extendedFamily);
diff --git a/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java b/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
index b7f62ad..3ca4960 100644
--- a/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
+++ b/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
@@ -145,7 +145,7 @@ public class SummaryDocument extends Document {
private List<String> stringArrayToList(String[] stringArray) {
List<String> list;
if (stringArray == null) {
- list = new ArrayList<String>();
+ list = new ArrayList<>();
} else {
list = Arrays.asList(stringArray);
}
@@ -153,7 +153,7 @@ public class SummaryDocument extends Document {
}
private SortedSet<String> stringArrayToSortedSet(String[] stringArray) {
- SortedSet<String> sortedSet = new TreeSet<String>();
+ SortedSet<String> sortedSet = new TreeSet<>();
if (stringArray != null) {
sortedSet.addAll(Arrays.asList(stringArray));
}
diff --git a/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java b/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
index bcf0c6e..7c78f54 100644
--- a/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
+++ b/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
@@ -83,7 +83,7 @@ public class UptimeHistory implements Comparable<UptimeHistory> {
}
SortedSet<String> flags = null;
if (parts[0].equals("R")) {
- flags = new TreeSet<String>();
+ flags = new TreeSet<>();
for (int i = 3; i < parts.length; i++) {
flags.add(parts[i]);
}
diff --git a/src/main/java/org/torproject/onionoo/docs/UptimeStatus.java b/src/main/java/org/torproject/onionoo/docs/UptimeStatus.java
index 286b32f..18cd259 100644
--- a/src/main/java/org/torproject/onionoo/docs/UptimeStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/UptimeStatus.java
@@ -26,15 +26,13 @@ public class UptimeStatus extends Document {
this.isDirty = false;
}
- private SortedSet<UptimeHistory> relayHistory =
- new TreeSet<UptimeHistory>();
+ private SortedSet<UptimeHistory> relayHistory = new TreeSet<>();
public SortedSet<UptimeHistory> getRelayHistory() {
return this.relayHistory;
}
- private SortedSet<UptimeHistory> bridgeHistory =
- new TreeSet<UptimeHistory>();
+ private SortedSet<UptimeHistory> bridgeHistory = new TreeSet<>();
public SortedSet<UptimeHistory> getBridgeHistory() {
return this.bridgeHistory;
@@ -69,7 +67,7 @@ public class UptimeStatus extends Document {
UptimeHistory interval = new UptimeHistory(relay, startMillis, 1,
flags);
NavigableSet<UptimeHistory> existingIntervals =
- new TreeSet<UptimeHistory>(history.headSet(new UptimeHistory(
+ new TreeSet<>(history.headSet(new UptimeHistory(
relay, startMillis + DateTimeHelper.ONE_HOUR, 0, flags)));
for (UptimeHistory prev : existingIntervals.descendingSet()) {
if (prev.isRelay() != interval.isRelay()
@@ -116,8 +114,7 @@ public class UptimeStatus extends Document {
}
private void compressHistory(SortedSet<UptimeHistory> history) {
- SortedSet<UptimeHistory> uncompressedHistory =
- new TreeSet<UptimeHistory>(history);
+ SortedSet<UptimeHistory> uncompressedHistory = new TreeSet<>(history);
history.clear();
UptimeHistory lastInterval = null;
for (UptimeHistory interval : uncompressedHistory) {
diff --git a/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java b/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java
index 5c18dee..3257283 100644
--- a/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java
@@ -40,8 +40,7 @@ public class WeightsStatus extends Document {
}
};
- private SortedMap<long[], double[]> history =
- new TreeMap<long[], double[]>(histComparator);
+ private SortedMap<long[], double[]> history = new TreeMap<>(histComparator);
public void setHistory(SortedMap<long[], double[]> history) {
this.history = history;
diff --git a/src/main/java/org/torproject/onionoo/server/MostFrequentString.java b/src/main/java/org/torproject/onionoo/server/MostFrequentString.java
index 3e8697e..e9c8667 100644
--- a/src/main/java/org/torproject/onionoo/server/MostFrequentString.java
+++ b/src/main/java/org/torproject/onionoo/server/MostFrequentString.java
@@ -14,7 +14,7 @@ import java.util.TreeSet;
class MostFrequentString {
- Map<String, Integer> stringFrequencies = new HashMap<String, Integer>();
+ Map<String, Integer> stringFrequencies = new HashMap<>();
void addString(String string) {
if (!this.stringFrequencies.containsKey(string)) {
@@ -27,15 +27,14 @@ class MostFrequentString {
@Override
public String toString() {
- SortedMap<Integer, SortedSet<String>> sortedFrequencies =
- new TreeMap<Integer, SortedSet<String>>(
+ SortedMap<Integer, SortedSet<String>> sortedFrequencies = new TreeMap<>(
Collections.reverseOrder());
if (this.stringFrequencies.isEmpty()) {
return "null (0)";
}
for (Map.Entry<String, Integer> e : stringFrequencies.entrySet()) {
if (!sortedFrequencies.containsKey(e.getValue())) {
- sortedFrequencies.put(e.getValue(), new TreeSet<String>(
+ sortedFrequencies.put(e.getValue(), new TreeSet<>(
Arrays.asList(new String[] { e.getKey() } )));
} else {
sortedFrequencies.get(e.getValue()).add(e.getKey());
diff --git a/src/main/java/org/torproject/onionoo/server/NodeIndexer.java b/src/main/java/org/torproject/onionoo/server/NodeIndexer.java
index b470323..1229e6b 100644
--- a/src/main/java/org/torproject/onionoo/server/NodeIndexer.java
+++ b/src/main/java/org/torproject/onionoo/server/NodeIndexer.java
@@ -144,31 +144,21 @@ public class NodeIndexer implements ServletContextListener, Runnable {
}
documentStore.invalidateDocumentCache();
Map<String, SummaryDocument> newRelayFingerprintSummaryLines =
- new HashMap<String, SummaryDocument>();
+ new HashMap<>();
Map<String, SummaryDocument> newBridgeFingerprintSummaryLines =
- new HashMap<String, SummaryDocument>();
- Map<String, Set<String>> newRelaysByCountryCode =
- new HashMap<String, Set<String>>();
- Map<String, Set<String>> newRelaysByAsNumber =
- new HashMap<String, Set<String>>();
- Map<String, Set<String>> newRelaysByFlag =
- new HashMap<String, Set<String>>();
- Map<String, Set<String>> newBridgesByFlag =
- new HashMap<String, Set<String>>();
- Map<String, Set<String>> newRelaysByContact =
- new HashMap<String, Set<String>>();
- Map<String, Set<String>> newRelaysByFamily =
- new HashMap<String, Set<String>>();
- SortedMap<Integer, Set<String>> newRelaysByFirstSeenDays =
- new TreeMap<Integer, Set<String>>();
- SortedMap<Integer, Set<String>> newBridgesByFirstSeenDays =
- new TreeMap<Integer, Set<String>>();
- SortedMap<Integer, Set<String>> newRelaysByLastSeenDays =
- new TreeMap<Integer, Set<String>>();
- SortedMap<Integer, Set<String>> newBridgesByLastSeenDays =
- new TreeMap<Integer, Set<String>>();
- Set<SummaryDocument> currentRelays = new HashSet<SummaryDocument>();
- Set<SummaryDocument> currentBridges = new HashSet<SummaryDocument>();
+ new HashMap<>();
+ Map<String, Set<String>> newRelaysByCountryCode = new HashMap<>();
+ Map<String, Set<String>> newRelaysByAsNumber = new HashMap<>();
+ Map<String, Set<String>> newRelaysByFlag = new HashMap<>();
+ Map<String, Set<String>> newBridgesByFlag = new HashMap<>();
+ Map<String, Set<String>> newRelaysByContact = new HashMap<>();
+ Map<String, Set<String>> newRelaysByFamily = new HashMap<>();
+ SortedMap<Integer, Set<String>> newRelaysByFirstSeenDays = new TreeMap<>();
+ SortedMap<Integer, Set<String>> newBridgesByFirstSeenDays = new TreeMap<>();
+ SortedMap<Integer, Set<String>> newRelaysByLastSeenDays = new TreeMap<>();
+ SortedMap<Integer, Set<String>> newBridgesByLastSeenDays = new TreeMap<>();
+ Set<SummaryDocument> currentRelays = new HashSet<>();
+ Set<SummaryDocument> currentBridges = new HashSet<>();
SortedSet<String> fingerprints = documentStore.list(
SummaryDocument.class);
long relaysLastValidAfterMillis = 0L;
@@ -191,8 +181,7 @@ public class NodeIndexer implements ServletContextListener, Runnable {
/* This variable can go away once all Onionoo services had their
* hourly updater write effective families to summary documents at
* least once. Remove this code after September 8, 2015. */
- SortedMap<String, Set<String>> computedEffectiveFamilies =
- new TreeMap<String, Set<String>>();
+ SortedMap<String, Set<String>> computedEffectiveFamilies = new TreeMap<>();
for (SummaryDocument entry : currentRelays) {
String fingerprint = entry.getFingerprint().toUpperCase();
String hashedFingerprint = entry.getHashedFingerprint()
@@ -276,7 +265,7 @@ public class NodeIndexer implements ServletContextListener, Runnable {
for (Map.Entry<String, Set<String>> e :
computedEffectiveFamilies.entrySet()) {
String fingerprint = e.getKey();
- Set<String> inMutualFamilyRelation = new HashSet<String>();
+ Set<String> inMutualFamilyRelation = new HashSet<>();
for (String otherFingerprint : e.getValue()) {
if (computedEffectiveFamilies.containsKey(otherFingerprint)
&& computedEffectiveFamilies.get(otherFingerprint).contains(
diff --git a/src/main/java/org/torproject/onionoo/server/RequestHandler.java b/src/main/java/org/torproject/onionoo/server/RequestHandler.java
index 32af238..c94edd4 100644
--- a/src/main/java/org/torproject/onionoo/server/RequestHandler.java
+++ b/src/main/java/org/torproject/onionoo/server/RequestHandler.java
@@ -133,11 +133,9 @@ public class RequestHandler {
this.family = family;
}
- private Map<String, SummaryDocument> filteredRelays =
- new HashMap<String, SummaryDocument>();
+ private Map<String, SummaryDocument> filteredRelays = new HashMap<>();
- private Map<String, SummaryDocument> filteredBridges =
- new HashMap<String, SummaryDocument>();
+ private Map<String, SummaryDocument> filteredBridges = new HashMap<>();
/** Handles this request by filtering by all given parameters and then
* possibly ordering, offsetting, and limiting results. */
@@ -190,7 +188,7 @@ public class RequestHandler {
return;
}
boolean runningRequested = this.running.equals("true");
- Set<String> removeRelays = new HashSet<String>();
+ Set<String> removeRelays = new HashSet<>();
for (Map.Entry<String, SummaryDocument> e
: filteredRelays.entrySet()) {
if (e.getValue().isRunning() != runningRequested) {
@@ -200,7 +198,7 @@ public class RequestHandler {
for (String fingerprint : removeRelays) {
this.filteredRelays.remove(fingerprint);
}
- Set<String> removeBridges = new HashSet<String>();
+ Set<String> removeBridges = new HashSet<>();
for (Map.Entry<String, SummaryDocument> e
: filteredBridges.entrySet()) {
if (e.getValue().isRunning() != runningRequested) {
@@ -223,7 +221,7 @@ public class RequestHandler {
}
private void filterBySearchTerm(String searchTerm) {
- Set<String> removeRelays = new HashSet<String>();
+ Set<String> removeRelays = new HashSet<>();
for (Map.Entry<String, SummaryDocument> e
: filteredRelays.entrySet()) {
String fingerprint = e.getKey();
@@ -276,7 +274,7 @@ public class RequestHandler {
for (String fingerprint : removeRelays) {
this.filteredRelays.remove(fingerprint);
}
- Set<String> removeBridges = new HashSet<String>();
+ Set<String> removeBridges = new HashSet<>();
for (Map.Entry<String, SummaryDocument> e :
filteredBridges.entrySet()) {
String hashedFingerprint = e.getKey();
@@ -356,7 +354,7 @@ public class RequestHandler {
} else {
Set<String> relaysWithCountryCode =
this.nodeIndex.getRelaysByCountryCode().get(countryCode);
- Set<String> removeRelays = new HashSet<String>();
+ Set<String> removeRelays = new HashSet<>();
for (String fingerprint : this.filteredRelays.keySet()) {
if (!relaysWithCountryCode.contains(fingerprint)) {
removeRelays.add(fingerprint);
@@ -383,7 +381,7 @@ public class RequestHandler {
} else {
Set<String> relaysWithAsNumber =
this.nodeIndex.getRelaysByAsNumber().get(asNumber);
- Set<String> removeRelays = new HashSet<String>();
+ Set<String> removeRelays = new HashSet<>();
for (String fingerprint : this.filteredRelays.keySet()) {
if (!relaysWithAsNumber.contains(fingerprint)) {
removeRelays.add(fingerprint);
@@ -407,7 +405,7 @@ public class RequestHandler {
} else {
Set<String> relaysWithFlag = this.nodeIndex.getRelaysByFlag().get(
flag);
- Set<String> removeRelays = new HashSet<String>();
+ Set<String> removeRelays = new HashSet<>();
for (String fingerprint : this.filteredRelays.keySet()) {
if (!relaysWithFlag.contains(fingerprint)) {
removeRelays.add(fingerprint);
@@ -422,7 +420,7 @@ public class RequestHandler {
} else {
Set<String> bridgesWithFlag = this.nodeIndex.getBridgesByFlag().get(
flag);
- Set<String> removeBridges = new HashSet<String>();
+ Set<String> removeBridges = new HashSet<>();
for (String fingerprint : this.filteredBridges.keySet()) {
if (!bridgesWithFlag.contains(fingerprint)) {
removeBridges.add(fingerprint);
@@ -459,7 +457,7 @@ public class RequestHandler {
private void filterNodesByDays(
Map<String, SummaryDocument> filteredNodes,
SortedMap<Integer, Set<String>> nodesByDays, int[] days) {
- Set<String> removeNodes = new HashSet<String>();
+ Set<String> removeNodes = new HashSet<>();
for (Set<String> nodes : nodesByDays.headMap(days[0]).values()) {
removeNodes.addAll(nodes);
}
@@ -479,7 +477,7 @@ public class RequestHandler {
/* Not filtering by contact information. */
return;
}
- Set<String> removeRelays = new HashSet<String>();
+ Set<String> removeRelays = new HashSet<>();
for (Map.Entry<String, Set<String>> e :
this.nodeIndex.getRelaysByContact().entrySet()) {
String contact = e.getKey();
@@ -502,8 +500,7 @@ public class RequestHandler {
/* Not filtering by relay family. */
return;
}
- Set<String> removeRelays = new HashSet<String>(
- this.filteredRelays.keySet());
+ Set<String> removeRelays = new HashSet<>(this.filteredRelays.keySet());
removeRelays.remove(this.family);
if (this.nodeIndex.getRelaysByFamily().containsKey(this.family)) {
removeRelays.removeAll(this.nodeIndex.getRelaysByFamily()
@@ -580,15 +577,13 @@ public class RequestHandler {
}
}
- private List<SummaryDocument> orderedRelays =
- new ArrayList<SummaryDocument>();
+ private List<SummaryDocument> orderedRelays = new ArrayList<>();
public List<SummaryDocument> getOrderedRelays() {
return this.orderedRelays;
}
- private List<SummaryDocument> orderedBridges =
- new ArrayList<SummaryDocument>();
+ private List<SummaryDocument> orderedBridges = new ArrayList<>();
public List<SummaryDocument> getOrderedBridges() {
return this.orderedBridges;
diff --git a/src/main/java/org/torproject/onionoo/server/ResourceServlet.java b/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
index 0e4c68f..45a52a2 100644
--- a/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
+++ b/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
@@ -66,13 +66,13 @@ public class ResourceServlet extends HttpServlet {
private static final long CACHE_INTERVAL = 5L * 60L * 1000L;
- private static Set<String> knownParameters = new HashSet<String>(
+ private static Set<String> knownParameters = new HashSet<>(
Arrays.asList(("type,running,search,lookup,fingerprint,country,as,"
+ "flag,first_seen_days,last_seen_days,contact,order,limit,"
+ "offset,fields,family").split(",")));
private static Set<String> illegalSearchQualifiers =
- new HashSet<String>(Arrays.asList(("search,fingerprint,order,limit,"
+ new HashSet<>(Arrays.asList(("search,fingerprint,order,limit,"
+ "offset,fields").split(",")));
/** Handles the HTTP GET request in the wrapped <code>request</code> by
@@ -124,7 +124,7 @@ public class ResourceServlet extends HttpServlet {
/* Extract parameters either from the old-style URI or from request
* parameters. */
- Map<String, String> parameterMap = new HashMap<String, String>();
+ Map<String, String> parameterMap = new HashMap<>();
for (Object parameterKey : request.getParameterMap().keySet()) {
String[] parameterValues =
request.getParameterValues((String) parameterKey);
@@ -148,7 +148,7 @@ public class ResourceServlet extends HttpServlet {
response.sendError(HttpServletResponse.SC_BAD_REQUEST);
return;
}
- List<String> unqualifiedSearchTerms = new ArrayList<String>();
+ List<String> unqualifiedSearchTerms = new ArrayList<>();
for (String searchTerm : searchTerms) {
if (searchTerm.contains(":") && !searchTerm.startsWith("[")) {
String[] parts = searchTerm.split(":", 2);
diff --git a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
index 4c13334..bb532f6 100644
--- a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
+++ b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
@@ -47,15 +47,13 @@ public class ResponseBuilder {
this.bridgesPublishedString = bridgesPublishedString;
}
- private List<SummaryDocument> orderedRelays =
- new ArrayList<SummaryDocument>();
+ private List<SummaryDocument> orderedRelays = new ArrayList<>();
public void setOrderedRelays(List<SummaryDocument> orderedRelays) {
this.orderedRelays = orderedRelays;
}
- private List<SummaryDocument> orderedBridges =
- new ArrayList<SummaryDocument>();
+ private List<SummaryDocument> orderedBridges = new ArrayList<>();
public void setOrderedBridges(List<SummaryDocument> orderedBridges) {
this.orderedBridges = orderedBridges;
diff --git a/src/main/java/org/torproject/onionoo/updater/ClientsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/ClientsStatusUpdater.java
index 20971f8..44c4e1b 100644
--- a/src/main/java/org/torproject/onionoo/updater/ClientsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/ClientsStatusUpdater.java
@@ -66,7 +66,7 @@ public class ClientsStatusUpdater implements DescriptorListener,
}
private SortedMap<String, SortedSet<ClientsHistory>> newResponses =
- new TreeMap<String, SortedSet<ClientsHistory>>();
+ new TreeMap<>();
private void processBridgeExtraInfoDescriptor(
ExtraInfoDescriptor descriptor) {
@@ -125,8 +125,7 @@ public class ClientsStatusUpdater implements DescriptorListener,
private SortedMap<String, Double> weightResponsesWithUniqueIps(
double totalResponses, SortedMap<String, Integer> uniqueIps,
String omitString) {
- SortedMap<String, Double> weightedResponses =
- new TreeMap<String, Double>();
+ SortedMap<String, Double> weightedResponses = new TreeMap<>();
int totalUniqueIps = 0;
if (uniqueIps != null) {
for (Map.Entry<String, Integer> e : uniqueIps.entrySet()) {
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorDownloader.java b/src/main/java/org/torproject/onionoo/updater/DescriptorDownloader.java
index d51bc20..1e41f25 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorDownloader.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorDownloader.java
@@ -61,7 +61,7 @@ class DescriptorDownloader {
}
}
- private SortedSet<String> localFiles = new TreeSet<String>();
+ private SortedSet<String> localFiles = new TreeSet<>();
public int statLocalFiles() {
File localDirectory = new File(this.inDir, this.directory);
@@ -73,7 +73,7 @@ class DescriptorDownloader {
return this.localFiles.size();
}
- private SortedSet<String> remoteFiles = new TreeSet<String>();
+ private SortedSet<String> remoteFiles = new TreeSet<>();
public int fetchRemoteDirectory() {
String directoryUrl = this.protocolHostNameResourcePrefix
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java b/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java
index 27a046e..5ce8cfa 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java
@@ -156,7 +156,7 @@ class DescriptorQueue {
}
this.historyFile = new File(this.statusDir, historyFileName);
if (this.historyFile.exists() && this.historyFile.isFile()) {
- SortedMap<String, Long> excludedFiles = new TreeMap<String, Long>();
+ SortedMap<String, Long> excludedFiles = new TreeMap<>();
try (BufferedReader br = new BufferedReader(new FileReader(
this.historyFile))) {
String line;
@@ -184,8 +184,7 @@ class DescriptorQueue {
if (this.historyFile == null) {
return;
}
- SortedMap<String, Long> excludedAndParsedFiles =
- new TreeMap<String, Long>();
+ SortedMap<String, Long> excludedAndParsedFiles = new TreeMap<>();
excludedAndParsedFiles.putAll(
this.descriptorReader.getExcludedFiles());
excludedAndParsedFiles.putAll(this.descriptorReader.getParsedFiles());
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java b/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java
index 79fe53b..33c8a8e 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java
@@ -34,9 +34,8 @@ public class DescriptorSource {
/** Instantiates a new descriptor source. */
public DescriptorSource() {
- this.descriptorQueues = new ArrayList<DescriptorQueue>();
- this.descriptorListeners =
- new HashMap<DescriptorType, Set<DescriptorListener>>();
+ this.descriptorQueues = new ArrayList<>();
+ this.descriptorListeners = new HashMap<>();
}
private DescriptorQueue getDescriptorQueue(
diff --git a/src/main/java/org/torproject/onionoo/updater/LookupService.java b/src/main/java/org/torproject/onionoo/updater/LookupService.java
index fcef0bc..fb9bf4a 100644
--- a/src/main/java/org/torproject/onionoo/updater/LookupService.java
+++ b/src/main/java/org/torproject/onionoo/updater/LookupService.java
@@ -104,15 +104,14 @@ public class LookupService {
public SortedMap<String, LookupResult> lookup(
SortedSet<String> addressStrings) {
- SortedMap<String, LookupResult> lookupResults =
- new TreeMap<String, LookupResult>();
+ SortedMap<String, LookupResult> lookupResults = new TreeMap<>();
if (!this.hasAllFiles) {
return lookupResults;
}
/* Obtain a map from relay IP address strings to numbers. */
- Map<String, Long> addressStringNumbers = new HashMap<String, Long>();
+ Map<String, Long> addressStringNumbers = new HashMap<>();
for (String addressString : addressStrings) {
long addressNumber = this.parseAddressString(addressString);
if (addressNumber >= 0L) {
@@ -125,12 +124,11 @@ public class LookupService {
/* Obtain a map from IP address numbers to blocks and to latitudes and
longitudes. */
- Map<Long, Long> addressNumberBlocks = new HashMap<Long, Long>();
- Map<Long, Float[]> addressNumberLatLong =
- new HashMap<Long, Float[]>();
+ Map<Long, Long> addressNumberBlocks = new HashMap<>();
+ Map<Long, Float[]> addressNumberLatLong = new HashMap<>();
try (BufferedReader br = this.createBufferedReaderFromUtf8File(
this.geoLite2CityBlocksIPv4CsvFile)) {
- SortedSet<Long> sortedAddressNumbers = new TreeSet<Long>(
+ SortedSet<Long> sortedAddressNumbers = new TreeSet<>(
addressStringNumbers.values());
String line = br.readLine();
while ((line = br.readLine()) != null) {
@@ -193,11 +191,10 @@ public class LookupService {
}
/* Obtain a map from relevant blocks to location lines. */
- Map<Long, String> blockLocations = new HashMap<Long, String>();
+ Map<Long, String> blockLocations = new HashMap<>();
try (BufferedReader br = this.createBufferedReaderFromUtf8File(
this.geoLite2CityLocationsEnCsvFile)) {
- Set<Long> blockNumbers = new HashSet<Long>(
- addressNumberBlocks.values());
+ Set<Long> blockNumbers = new HashSet<>(addressNumberBlocks.values());
String line = br.readLine();
while ((line = br.readLine()) != null) {
String[] parts = line.replaceAll("\"", "").split(",", 13);
@@ -229,10 +226,10 @@ public class LookupService {
}
/* Obtain a map from IP address numbers to ASN. */
- Map<Long, String> addressNumberAsn = new HashMap<Long, String>();
+ Map<Long, String> addressNumberAsn = new HashMap<>();
try (BufferedReader br = this.createBufferedReaderFromIso88591File(
this.geoIpAsNum2CsvFile)) {
- SortedSet<Long> sortedAddressNumbers = new TreeSet<Long>(
+ SortedSet<Long> sortedAddressNumbers = new TreeSet<>(
addressStringNumbers.values());
long firstAddressNumber = sortedAddressNumbers.first();
String line;
diff --git a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
index 202524d..b6dcdf7 100644
--- a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
@@ -82,8 +82,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
private long now;
- private SortedMap<String, NodeStatus> knownNodes =
- new TreeMap<String, NodeStatus>();
+ private SortedMap<String, NodeStatus> knownNodes = new TreeMap<>();
private long relaysLastValidAfterMillis = -1L;
@@ -145,8 +144,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
}
}
- private Map<String, SortedSet<String>> declaredFamilies =
- new HashMap<String, SortedSet<String>>();
+ private Map<String, SortedSet<String>> declaredFamilies = new HashMap<>();
private void processRelayServerDescriptor(
ServerDescriptor descriptor) {
@@ -178,7 +176,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
detailsStatus.setContact(descriptor.getContact());
detailsStatus.setPlatform(descriptor.getPlatform());
if (descriptor.getFamilyEntries() != null) {
- SortedSet<String> declaredFamily = new TreeSet<String>();
+ SortedSet<String> declaredFamily = new TreeSet<>();
for (String familyMember : descriptor.getFamilyEntries()) {
if (familyMember.startsWith("$") && familyMember.length() >= 41) {
declaredFamily.add(
@@ -193,8 +191,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
&& (descriptor.getIpv6DefaultPolicy().equals("accept")
|| descriptor.getIpv6DefaultPolicy().equals("reject"))
&& descriptor.getIpv6PortList() != null) {
- Map<String, List<String>> exitPolicyV6Summary =
- new HashMap<String, List<String>>();
+ Map<String, List<String>> exitPolicyV6Summary = new HashMap<>();
List<String> portsOrPortRanges = Arrays.asList(
descriptor.getIpv6PortList().split(","));
exitPolicyV6Summary.put(descriptor.getIpv6DefaultPolicy(),
@@ -206,8 +203,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
this.documentStore.store(detailsStatus, fingerprint);
}
- private Map<String, Map<String, Long>> exitListEntries =
- new HashMap<String, Map<String, Long>>();
+ private Map<String, Map<String, Long>> exitListEntries = new HashMap<>();
private void processExitList(ExitList exitList) {
for (ExitList.Entry exitListEntry : exitList.getEntries()) {
@@ -219,8 +215,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
continue;
}
if (!this.exitListEntries.containsKey(fingerprint)) {
- this.exitListEntries.put(fingerprint,
- new HashMap<String, Long>());
+ this.exitListEntries.put(fingerprint, new HashMap<String, Long>());
}
String exitAddress = exitAddressScanMillis.getKey();
if (!this.exitListEntries.get(fingerprint).containsKey(
@@ -234,11 +229,9 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
}
}
- private Map<String, Long> lastSeenUnmeasured =
- new HashMap<String, Long>();
+ private Map<String, Long> lastSeenUnmeasured = new HashMap<>();
- private Map<String, Long> lastSeenMeasured =
- new HashMap<String, Long>();
+ private Map<String, Long> lastSeenMeasured = new HashMap<>();
private void processRelayNetworkStatusConsensus(
RelayNetworkStatusConsensus consensus) {
@@ -248,7 +241,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
}
Set<String> recommendedVersions = null;
if (consensus.getRecommendedServerVersions() != null) {
- recommendedVersions = new HashSet<String>();
+ recommendedVersions = new HashSet<>();
for (String recommendedVersion :
consensus.getRecommendedServerVersions()) {
recommendedVersions.add("Tor " + recommendedVersion);
@@ -266,7 +259,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
String address = entry.getAddress();
int orPort = entry.getOrPort();
int dirPort = entry.getDirPort();
- SortedSet<String> orAddressesAndPorts = new TreeSet<String>(
+ SortedSet<String> orAddressesAndPorts = new TreeSet<>(
entry.getOrAddresses());
nodeStatus.addLastAddresses(validAfterMillis, address, orPort,
dirPort, orAddressesAndPorts);
@@ -374,7 +367,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
nodeStatus.setRelay(false);
nodeStatus.setNickname(entry.getNickname());
nodeStatus.setAddress(entry.getAddress());
- nodeStatus.setOrAddressesAndPorts(new TreeSet<String>(
+ nodeStatus.setOrAddressesAndPorts(new TreeSet<>(
entry.getOrAddresses()));
nodeStatus.setOrPort(entry.getOrPort());
nodeStatus.setDirPort(entry.getDirPort());
@@ -405,9 +398,9 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
/* Step 2: read node statuses from disk. */
- private SortedSet<String> currentRelays = new TreeSet<String>();
+ private SortedSet<String> currentRelays = new TreeSet<>();
- private SortedSet<String> runningRelays = new TreeSet<String>();
+ private SortedSet<String> runningRelays = new TreeSet<>();
private void readNodeStatuses() {
SortedSet<String> previouslyKnownNodes = this.documentStore.list(
@@ -534,8 +527,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
* probabilities. */
private void startReverseDomainNameLookups() {
- Map<String, Long> addressLastLookupTimes =
- new HashMap<String, Long>();
+ Map<String, Long> addressLastLookupTimes = new HashMap<>();
for (String fingerprint : this.currentRelays) {
NodeStatus nodeStatus = this.knownNodes.get(fingerprint);
addressLastLookupTimes.put(nodeStatus.getAddress(),
@@ -545,11 +537,10 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
this.reverseDomainNameResolver.startReverseDomainNameLookups();
}
- private SortedMap<String, LookupResult> geoIpLookupResults =
- new TreeMap<String, LookupResult>();
+ private SortedMap<String, LookupResult> geoIpLookupResults = new TreeMap<>();
private void lookUpCitiesAndASes() {
- SortedSet<String> addressStrings = new TreeSet<String>();
+ SortedSet<String> addressStrings = new TreeSet<>();
for (String fingerprint : this.currentRelays) {
NodeStatus nodeStatus = this.knownNodes.get(fingerprint);
addressStrings.add(nodeStatus.getAddress());
@@ -571,17 +562,13 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
}
}
- private SortedMap<String, Float> consensusWeightFractions =
- new TreeMap<String, Float>();
+ private SortedMap<String, Float> consensusWeightFractions = new TreeMap<>();
- private SortedMap<String, Float> guardProbabilities =
- new TreeMap<String, Float>();
+ private SortedMap<String, Float> guardProbabilities = new TreeMap<>();
- private SortedMap<String, Float> middleProbabilities =
- new TreeMap<String, Float>();
+ private SortedMap<String, Float> middleProbabilities = new TreeMap<>();
- private SortedMap<String, Float> exitProbabilities =
- new TreeMap<String, Float>();
+ private SortedMap<String, Float> exitProbabilities = new TreeMap<>();
private void calculatePathSelectionProbabilities() {
boolean consensusContainsBandwidthWeights = false;
@@ -594,7 +581,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
double wee = 0.0;
double wed = 0.0;
if (this.lastBandwidthWeights != null) {
- SortedSet<String> weightKeys = new TreeSet<String>(Arrays.asList(
+ SortedSet<String> weightKeys = new TreeSet<>(Arrays.asList(
"Wgg,Wgd,Wmg,Wmm,Wme,Wmd,Wee,Wed".split(",")));
weightKeys.removeAll(this.lastBandwidthWeights.keySet());
if (weightKeys.isEmpty()) {
@@ -615,14 +602,10 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
+ "this execution.");
return;
}
- SortedMap<String, Double> consensusWeights =
- new TreeMap<String, Double>();
- SortedMap<String, Double> guardWeights =
- new TreeMap<String, Double>();
- SortedMap<String, Double> middleWeights =
- new TreeMap<String, Double>();
- SortedMap<String, Double> exitWeights =
- new TreeMap<String, Double>();
+ SortedMap<String, Double> consensusWeights = new TreeMap<>();
+ SortedMap<String, Double> guardWeights = new TreeMap<>();
+ SortedMap<String, Double> middleWeights = new TreeMap<>();
+ SortedMap<String, Double> exitWeights = new TreeMap<>();
double totalConsensusWeight = 0.0;
double totalGuardWeight = 0.0;
double totalMiddleWeight = 0.0;
@@ -685,8 +668,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
}
private void computeEffectiveAndExtendedFamilies() {
- SortedMap<String, SortedSet<String>> declaredFamilies =
- new TreeMap<String, SortedSet<String>>();
+ SortedMap<String, SortedSet<String>> declaredFamilies = new TreeMap<>();
for (String fingerprint : this.currentRelays) {
NodeStatus nodeStatus = this.knownNodes.get(fingerprint);
if (nodeStatus != null && nodeStatus.getDeclaredFamily() != null
@@ -694,13 +676,12 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
declaredFamilies.put(fingerprint, nodeStatus.getDeclaredFamily());
}
}
- SortedMap<String, SortedSet<String>> effectiveFamilies =
- new TreeMap<String, SortedSet<String>>();
+ SortedMap<String, SortedSet<String>> effectiveFamilies = new TreeMap<>();
for (Map.Entry<String, SortedSet<String>> e :
declaredFamilies.entrySet()) {
String fingerprint = e.getKey();
SortedSet<String> declaredFamily = e.getValue();
- SortedSet<String> effectiveFamily = new TreeSet<String>();
+ SortedSet<String> effectiveFamily = new TreeSet<>();
for (String declaredFamilyMember : declaredFamily) {
if (declaredFamilies.containsKey(declaredFamilyMember)
&& declaredFamilies.get(declaredFamilyMember).contains(
@@ -712,16 +693,15 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
effectiveFamilies.put(fingerprint, effectiveFamily);
}
}
- SortedMap<String, SortedSet<String>> extendedFamilies =
- new TreeMap<String, SortedSet<String>>();
- SortedSet<String> visited = new TreeSet<String>();
+ SortedMap<String, SortedSet<String>> extendedFamilies = new TreeMap<>();
+ SortedSet<String> visited = new TreeSet<>();
for (String fingerprint : effectiveFamilies.keySet()) {
if (visited.contains(fingerprint)) {
continue;
}
- SortedSet<String> toVisit = new TreeSet<String>();
+ SortedSet<String> toVisit = new TreeSet<>();
toVisit.add(fingerprint);
- SortedSet<String> extendedFamily = new TreeSet<String>();
+ SortedSet<String> extendedFamily = new TreeSet<>();
while (!toVisit.isEmpty()) {
String visiting = toVisit.first();
toVisit.remove(visiting);
@@ -739,7 +719,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
if (extendedFamily.size() > 1) {
for (String member : extendedFamily) {
SortedSet<String> extendedFamilyWithoutMember =
- new TreeSet<String>(extendedFamily);
+ new TreeSet<>(extendedFamily);
extendedFamilyWithoutMember.remove(member);
extendedFamilies.put(member, extendedFamilyWithoutMember);
}
@@ -763,8 +743,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
private long startedRdnsLookups = -1L;
- private SortedMap<String, String> rdnsLookupResults =
- new TreeMap<String, String>();
+ private SortedMap<String, String> rdnsLookupResults = new TreeMap<>();
private void finishReverseDomainNameLookups() {
this.reverseDomainNameResolver.finishReverseDomainNameLookups();
@@ -795,7 +774,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
nodeStatus.setContact(detailsStatus.getContact());
- Map<String, Long> exitAddresses = new HashMap<String, Long>();
+ Map<String, Long> exitAddresses = new HashMap<>();
if (detailsStatus.getExitAddresses() != null) {
for (Map.Entry<String, Long> e :
detailsStatus.getExitAddresses().entrySet()) {
@@ -817,7 +796,7 @@ public class NodeDetailsStatusUpdater implements DescriptorListener,
}
detailsStatus.setExitAddresses(exitAddresses);
SortedSet<String> exitAddressesWithoutOrAddresses =
- new TreeSet<String>(exitAddresses.keySet());
+ new TreeSet<>(exitAddresses.keySet());
exitAddressesWithoutOrAddresses.removeAll(
nodeStatus.getOrAddresses());
nodeStatus.setExitAddresses(exitAddressesWithoutOrAddresses);
diff --git a/src/main/java/org/torproject/onionoo/updater/ReverseDomainNameResolver.java b/src/main/java/org/torproject/onionoo/updater/ReverseDomainNameResolver.java
index 3c26975..04222bf 100644
--- a/src/main/java/org/torproject/onionoo/updater/ReverseDomainNameResolver.java
+++ b/src/main/java/org/torproject/onionoo/updater/ReverseDomainNameResolver.java
@@ -52,7 +52,7 @@ public class ReverseDomainNameResolver {
* threads and returns immediately. */
public void startReverseDomainNameLookups() {
this.startedRdnsLookups = this.time.currentTimeMillis();
- this.rdnsLookupJobs = new HashSet<String>();
+ this.rdnsLookupJobs = new HashSet<>();
for (Map.Entry<String, Long> e :
this.addressLastLookupTimes.entrySet()) {
if (e.getValue() < this.startedRdnsLookups
@@ -60,9 +60,9 @@ public class ReverseDomainNameResolver {
this.rdnsLookupJobs.add(e.getKey());
}
}
- this.rdnsLookupResults = new HashMap<String, String>();
- this.rdnsLookupMillis = new ArrayList<Long>();
- this.rdnsLookupWorkers = new ArrayList<RdnsLookupWorker>();
+ this.rdnsLookupResults = new HashMap<>();
+ this.rdnsLookupMillis = new ArrayList<>();
+ this.rdnsLookupWorkers = new ArrayList<>();
for (int i = 0; i < RDNS_LOOKUP_WORKERS_NUM; i++) {
RdnsLookupWorker rdnsLookupWorker = new RdnsLookupWorker(this);
this.rdnsLookupWorkers.add(rdnsLookupWorker);
@@ -87,7 +87,7 @@ public class ReverseDomainNameResolver {
/** Returns reverse domain name lookup results. */
public Map<String, String> getLookupResults() {
synchronized (this.rdnsLookupResults) {
- return new HashMap<String, String>(this.rdnsLookupResults);
+ return new HashMap<>(this.rdnsLookupResults);
}
}
diff --git a/src/main/java/org/torproject/onionoo/updater/UptimeStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/UptimeStatusUpdater.java
index fb8139c..2b5f5fc 100644
--- a/src/main/java/org/torproject/onionoo/updater/UptimeStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/UptimeStatusUpdater.java
@@ -57,11 +57,9 @@ public class UptimeStatusUpdater implements DescriptorListener,
private static class Flags {
- private static Map<String, Integer> flagIndexes =
- new HashMap<String, Integer>();
+ private static Map<String, Integer> flagIndexes = new HashMap<>();
- private static Map<Integer, String> flagStrings =
- new HashMap<Integer, String>();
+ private static Map<Integer, String> flagStrings = new HashMap<>();
private BitSet flags;
@@ -77,7 +75,7 @@ public class UptimeStatusUpdater implements DescriptorListener,
}
public SortedSet<String> getFlags() {
- SortedSet<String> result = new TreeSet<String>();
+ SortedSet<String> result = new TreeSet<>();
if (this.flags != null) {
for (int i = this.flags.nextSetBit(0); i >= 0;
i = this.flags.nextSetBit(i + 1)) {
@@ -88,16 +86,15 @@ public class UptimeStatusUpdater implements DescriptorListener,
}
}
- private SortedMap<Long, Flags>
- newRelayStatuses = new TreeMap<Long, Flags>();
+ private SortedMap<Long, Flags> newRelayStatuses = new TreeMap<>();
private SortedMap<String, SortedMap<Long, Flags>>
- newRunningRelays = new TreeMap<String, SortedMap<Long, Flags>>();
+ newRunningRelays = new TreeMap<>();
- private SortedSet<Long> newBridgeStatuses = new TreeSet<Long>();
+ private SortedSet<Long> newBridgeStatuses = new TreeSet<>();
private SortedMap<String, SortedSet<Long>>
- newRunningBridges = new TreeMap<String, SortedSet<Long>>();
+ newRunningBridges = new TreeMap<>();
private void processRelayNetworkStatusConsensus(
RelayNetworkStatusConsensus consensus) {
@@ -118,7 +115,7 @@ public class UptimeStatusUpdater implements DescriptorListener,
}
private void processBridgeNetworkStatus(BridgeNetworkStatus status) {
- SortedSet<String> fingerprints = new TreeSet<String>();
+ SortedSet<String> fingerprints = new TreeSet<>();
for (NetworkStatusEntry entry :
status.getStatusEntries().values()) {
fingerprints.add(entry.getFingerprint());
@@ -145,15 +142,13 @@ public class UptimeStatusUpdater implements DescriptorListener,
this.updateStatus(true, null, this.newRelayStatuses);
for (Map.Entry<String, SortedSet<Long>> e :
this.newRunningBridges.entrySet()) {
- SortedMap<Long, Flags> dateHourMillisNoFlags =
- new TreeMap<Long, Flags>();
+ SortedMap<Long, Flags> dateHourMillisNoFlags = new TreeMap<>();
for (long dateHourMillis : e.getValue()) {
dateHourMillisNoFlags.put(dateHourMillis, null);
}
this.updateStatus(false, e.getKey(), dateHourMillisNoFlags);
}
- SortedMap<Long, Flags> dateHourMillisNoFlags =
- new TreeMap<Long, Flags>();
+ SortedMap<Long, Flags> dateHourMillisNoFlags = new TreeMap<>();
for (long dateHourMillis : this.newBridgeStatuses) {
dateHourMillisNoFlags.put(dateHourMillis, null);
}
diff --git a/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java
index 7ce1863..9ae60a9 100644
--- a/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java
@@ -97,7 +97,7 @@ public class WeightsStatusUpdater implements DescriptorListener,
SortedMap<String, Integer> bandwidthWeights =
consensus.getBandwidthWeights();
if (bandwidthWeights != null) {
- SortedSet<String> missingWeightKeys = new TreeSet<String>(
+ SortedSet<String> missingWeightKeys = new TreeSet<>(
Arrays.asList("Wgg,Wgd,Wmg,Wmm,Wme,Wmd,Wee,Wed".split(",")));
missingWeightKeys.removeAll(bandwidthWeights.keySet());
if (missingWeightKeys.isEmpty()) {
@@ -112,14 +112,10 @@ public class WeightsStatusUpdater implements DescriptorListener,
containsBandwidthWeights = true;
}
}
- SortedMap<String, Double> consensusWeights =
- new TreeMap<String, Double>();
- SortedMap<String, Double> guardWeights =
- new TreeMap<String, Double>();
- SortedMap<String, Double> middleWeights =
- new TreeMap<String, Double>();
- SortedMap<String, Double> exitWeights =
- new TreeMap<String, Double>();
+ SortedMap<String, Double> consensusWeights = new TreeMap<>();
+ SortedMap<String, Double> guardWeights = new TreeMap<>();
+ SortedMap<String, Double> middleWeights = new TreeMap<>();
+ SortedMap<String, Double> exitWeights = new TreeMap<>();
double totalConsensusWeight = 0.0;
double totalGuardWeight = 0.0;
double totalMiddleWeight = 0.0;
@@ -167,8 +163,7 @@ public class WeightsStatusUpdater implements DescriptorListener,
}
}
}
- SortedMap<String, double[]> pathSelectionProbabilities =
- new TreeMap<String, double[]>();
+ SortedMap<String, double[]> pathSelectionProbabilities = new TreeMap<>();
for (String fingerprint : consensusWeights.keySet()) {
double[] probabilities = new double[] { -1.0, -1.0, -1.0, -1.0,
-1.0, -1.0, -1.0 };
diff --git a/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java
index 84e42ce..a809aba 100644
--- a/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java
@@ -95,13 +95,12 @@ public class BandwidthDocumentWriter implements DocumentWriter {
private Map<String, GraphHistory> compileGraphType(
SortedMap<Long, long[]> history) {
- Map<String, GraphHistory> graphs =
- new LinkedHashMap<String, GraphHistory>();
+ Map<String, GraphHistory> graphs = new LinkedHashMap<>();
for (int i = 0; i < this.graphIntervals.length; i++) {
String graphName = this.graphNames[i];
long graphInterval = this.graphIntervals[i];
long dataPointInterval = this.dataPointIntervals[i];
- List<Long> dataPoints = new ArrayList<Long>();
+ List<Long> dataPoints = new ArrayList<>();
long intervalStartMillis = ((this.now - graphInterval)
/ dataPointInterval) * dataPointInterval;
long totalMillis = 0L;
@@ -180,7 +179,7 @@ public class BandwidthDocumentWriter implements DocumentWriter {
graphHistory.setCount(count);
int previousNonNullIndex = -2;
boolean foundTwoAdjacentDataPoints = false;
- List<Integer> values = new ArrayList<Integer>();
+ List<Integer> values = new ArrayList<>();
for (int j = firstNonNullIndex; j <= lastNonNullIndex; j++) {
long dataPoint = dataPoints.get(j);
if (dataPoint >= 0L) {
diff --git a/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java
index 868d5c1..fb262e9 100644
--- a/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java
@@ -112,8 +112,7 @@ public class ClientsDocumentWriter implements DocumentWriter {
SortedSet<ClientsHistory> history) {
ClientsDocument clientsDocument = new ClientsDocument();
clientsDocument.setFingerprint(hashedFingerprint);
- Map<String, ClientsGraphHistory> averageClients =
- new LinkedHashMap<String, ClientsGraphHistory>();
+ Map<String, ClientsGraphHistory> averageClients = new LinkedHashMap<>();
for (int graphIntervalIndex = 0; graphIntervalIndex
< this.graphIntervals.length; graphIntervalIndex++) {
String graphName = this.graphNames[graphIntervalIndex];
@@ -132,18 +131,15 @@ public class ClientsDocumentWriter implements DocumentWriter {
long graphInterval = this.graphIntervals[graphIntervalIndex];
long dataPointInterval =
this.dataPointIntervals[graphIntervalIndex];
- List<Double> dataPoints = new ArrayList<Double>();
+ List<Double> dataPoints = new ArrayList<>();
long intervalStartMillis = ((this.now - graphInterval)
/ dataPointInterval) * dataPointInterval;
long millis = 0L;
double responses = 0.0;
double totalResponses = 0.0;
- SortedMap<String, Double> totalResponsesByCountry =
- new TreeMap<String, Double>();
- SortedMap<String, Double> totalResponsesByTransport =
- new TreeMap<String, Double>();
- SortedMap<String, Double> totalResponsesByVersion =
- new TreeMap<String, Double>();
+ SortedMap<String, Double> totalResponsesByCountry = new TreeMap<>();
+ SortedMap<String, Double> totalResponsesByTransport = new TreeMap<>();
+ SortedMap<String, Double> totalResponsesByVersion = new TreeMap<>();
for (ClientsHistory hist : history) {
if (hist.getEndMillis() < intervalStartMillis) {
continue;
@@ -231,7 +227,7 @@ public class ClientsDocumentWriter implements DocumentWriter {
graphHistory.setCount(count);
int previousNonNullIndex = -2;
boolean foundTwoAdjacentDataPoints = false;
- List<Integer> values = new ArrayList<Integer>();
+ List<Integer> values = new ArrayList<>();
for (int dataPointIndex = firstNonNullIndex; dataPointIndex
<= lastNonNullIndex; dataPointIndex++) {
double dataPoint = dataPoints.get(dataPointIndex);
@@ -246,7 +242,7 @@ public class ClientsDocumentWriter implements DocumentWriter {
}
graphHistory.setValues(values);
if (!totalResponsesByCountry.isEmpty()) {
- SortedMap<String, Float> countries = new TreeMap<String, Float>();
+ SortedMap<String, Float> countries = new TreeMap<>();
for (Map.Entry<String, Double> e :
totalResponsesByCountry.entrySet()) {
if (e.getValue() > totalResponses / 100.0) {
@@ -257,7 +253,7 @@ public class ClientsDocumentWriter implements DocumentWriter {
graphHistory.setCountries(countries);
}
if (!totalResponsesByTransport.isEmpty()) {
- SortedMap<String, Float> transports = new TreeMap<String, Float>();
+ SortedMap<String, Float> transports = new TreeMap<>();
for (Map.Entry<String, Double> e :
totalResponsesByTransport.entrySet()) {
if (e.getValue() > totalResponses / 100.0) {
@@ -268,7 +264,7 @@ public class ClientsDocumentWriter implements DocumentWriter {
graphHistory.setTransports(transports);
}
if (!totalResponsesByVersion.isEmpty()) {
- SortedMap<String, Float> versions = new TreeMap<String, Float>();
+ SortedMap<String, Float> versions = new TreeMap<>();
for (Map.Entry<String, Double> e :
totalResponsesByVersion.entrySet()) {
if (e.getValue() > totalResponses / 100.0) {
diff --git a/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java
index 5e3e175..e3f638d 100644
--- a/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java
@@ -56,7 +56,7 @@ public class DetailsDocumentWriter implements DocumentWriter {
DetailsDocument detailsDocument = new DetailsDocument();
detailsDocument.setNickname(detailsStatus.getNickname());
detailsDocument.setFingerprint(fingerprint);
- List<String> orAddresses = new ArrayList<String>();
+ List<String> orAddresses = new ArrayList<>();
orAddresses.add(detailsStatus.getAddress() + ":"
+ detailsStatus.getOrPort());
for (String orAddress : detailsStatus.getOrAddressesAndPorts()) {
@@ -80,8 +80,7 @@ public class DetailsDocumentWriter implements DocumentWriter {
String portList = detailsStatus.getPortList();
if (defaultPolicy != null && (defaultPolicy.equals("accept")
|| defaultPolicy.equals("reject")) && portList != null) {
- Map<String, List<String>> exitPolicySummary =
- new HashMap<String, List<String>>();
+ Map<String, List<String>> exitPolicySummary = new HashMap<>();
List<String> portsOrPortRanges = Arrays.asList(portList.split(","));
exitPolicySummary.put(defaultPolicy, portsOrPortRanges);
detailsDocument.setExitPolicySummary(exitPolicySummary);
@@ -118,7 +117,7 @@ public class DetailsDocumentWriter implements DocumentWriter {
detailsDocument.setPlatform(detailsStatus.getPlatform());
if (detailsStatus.getAllegedFamily() != null
&& !detailsStatus.getAllegedFamily().isEmpty()) {
- SortedSet<String> allegedFamily = new TreeSet<String>();
+ SortedSet<String> allegedFamily = new TreeSet<>();
for (String familyMember : detailsStatus.getAllegedFamily()) {
if (familyMember.length() >= 40) {
allegedFamily.add("$" + familyMember);
@@ -130,7 +129,7 @@ public class DetailsDocumentWriter implements DocumentWriter {
}
if (detailsStatus.getEffectiveFamily() != null
&& !detailsStatus.getEffectiveFamily().isEmpty()) {
- SortedSet<String> effectiveFamily = new TreeSet<String>();
+ SortedSet<String> effectiveFamily = new TreeSet<>();
for (String familyMember : detailsStatus.getEffectiveFamily()) {
effectiveFamily.add("$" + familyMember);
}
@@ -138,7 +137,7 @@ public class DetailsDocumentWriter implements DocumentWriter {
}
if (detailsStatus.getIndirectFamily() != null
&& !detailsStatus.getIndirectFamily().isEmpty()) {
- SortedSet<String> indirectFamily = new TreeSet<String>();
+ SortedSet<String> indirectFamily = new TreeSet<>();
for (String familyMember : detailsStatus.getIndirectFamily()) {
indirectFamily.add("$" + familyMember);
}
@@ -149,10 +148,10 @@ public class DetailsDocumentWriter implements DocumentWriter {
detailsDocument.setHibernating(detailsStatus.getHibernating());
if (detailsStatus.getExitAddresses() != null) {
SortedSet<String> exitAddressesWithoutOrAddresses =
- new TreeSet<String>(detailsStatus.getExitAddresses().keySet());
+ new TreeSet<>(detailsStatus.getExitAddresses().keySet());
exitAddressesWithoutOrAddresses.removeAll(
detailsStatus.getOrAddresses());
- detailsDocument.setExitAddresses(new ArrayList<String>(
+ detailsDocument.setExitAddresses(new ArrayList<>(
exitAddressesWithoutOrAddresses));
}
detailsDocument.setMeasured(detailsStatus.getMeasured());
@@ -165,7 +164,7 @@ public class DetailsDocumentWriter implements DocumentWriter {
detailsDocument.setNickname(detailsStatus.getNickname());
detailsDocument.setHashedFingerprint(fingerprint);
String address = detailsStatus.getAddress();
- List<String> orAddresses = new ArrayList<String>();
+ List<String> orAddresses = new ArrayList<>();
orAddresses.add(address + ":" + detailsStatus.getOrPort());
SortedSet<String> orAddressesAndPorts =
detailsStatus.getOrAddressesAndPorts();
diff --git a/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java
index 24c7e0c..b2f678d 100644
--- a/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java
@@ -65,7 +65,7 @@ public class SummaryDocumentWriter implements DocumentWriter {
}
continue;
}
- List<String> addresses = new ArrayList<String>();
+ List<String> addresses = new ArrayList<>();
addresses.add(nodeStatus.getAddress());
for (String orAddress : nodeStatus.getOrAddresses()) {
if (!addresses.contains(orAddress)) {
diff --git a/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java
index 42f5661..0154604 100644
--- a/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java
@@ -107,8 +107,7 @@ public class UptimeDocumentWriter implements DocumentWriter {
SortedSet<UptimeHistory> knownStatuses) {
UptimeDocument uptimeDocument = new UptimeDocument();
uptimeDocument.setFingerprint(fingerprint);
- Map<String, GraphHistory> uptime =
- new LinkedHashMap<String, GraphHistory>();
+ Map<String, GraphHistory> uptime = new LinkedHashMap<>();
for (int graphIntervalIndex = 0; graphIntervalIndex
< this.graphIntervals.length; graphIntervalIndex++) {
String graphName = this.graphNames[graphIntervalIndex];
@@ -119,17 +118,15 @@ public class UptimeDocumentWriter implements DocumentWriter {
}
}
uptimeDocument.setUptime(uptime);
- SortedMap<String, Map<String, GraphHistory>> flags =
- new TreeMap<String, Map<String, GraphHistory>>();
- SortedSet<String> allFlags = new TreeSet<String>();
+ SortedMap<String, Map<String, GraphHistory>> flags = new TreeMap<>();
+ SortedSet<String> allFlags = new TreeSet<>();
for (UptimeHistory hist : history) {
if (hist.getFlags() != null) {
allFlags.addAll(hist.getFlags());
}
}
for (String flag : allFlags) {
- Map<String, GraphHistory> graphsForFlags =
- new LinkedHashMap<String, GraphHistory>();
+ Map<String, GraphHistory> graphsForFlags = new LinkedHashMap<>();
for (int graphIntervalIndex = 0; graphIntervalIndex
< this.graphIntervals.length; graphIntervalIndex++) {
String graphName = this.graphNames[graphIntervalIndex];
@@ -157,7 +154,7 @@ public class UptimeDocumentWriter implements DocumentWriter {
this.dataPointIntervals[graphIntervalIndex];
int dataPointIntervalHours = (int) (dataPointInterval
/ DateTimeHelper.ONE_HOUR);
- List<Integer> uptimeDataPoints = new ArrayList<Integer>();
+ List<Integer> uptimeDataPoints = new ArrayList<>();
long intervalStartMillis = ((this.now - graphInterval)
/ dataPointInterval) * dataPointInterval;
int uptimeHours = 0;
@@ -200,7 +197,7 @@ public class UptimeDocumentWriter implements DocumentWriter {
/ DateTimeHelper.ONE_HOUR);
}
uptimeDataPoints.add(uptimeHours);
- List<Integer> statusDataPoints = new ArrayList<Integer>();
+ List<Integer> statusDataPoints = new ArrayList<>();
intervalStartMillis = ((this.now - graphInterval)
/ dataPointInterval) * dataPointInterval;
int statusHours = -1;
@@ -246,7 +243,7 @@ public class UptimeDocumentWriter implements DocumentWriter {
statusDataPoints.add(statusHours * 5 > dataPointIntervalHours
? statusHours : -1);
}
- List<Double> dataPoints = new ArrayList<Double>();
+ List<Double> dataPoints = new ArrayList<>();
for (int dataPointIndex = 0; dataPointIndex < statusDataPoints.size();
dataPointIndex++) {
if (dataPointIndex >= uptimeDataPoints.size()) {
@@ -297,7 +294,7 @@ public class UptimeDocumentWriter implements DocumentWriter {
graphHistory.setCount(count);
int previousNonNullIndex = -2;
boolean foundTwoAdjacentDataPoints = false;
- List<Integer> values = new ArrayList<Integer>();
+ List<Integer> values = new ArrayList<>();
for (int dataPointIndex = firstNonNullIndex; dataPointIndex
<= lastNonNullIndex; dataPointIndex++) {
double dataPoint = dataPoints.get(dataPointIndex);
diff --git a/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java
index 35ef3ae..5b45b78 100644
--- a/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java
@@ -98,8 +98,7 @@ public class WeightsDocumentWriter implements DocumentWriter {
private Map<String, GraphHistory> compileGraphType(
SortedMap<long[], double[]> history, int graphTypeIndex) {
- Map<String, GraphHistory> graphs =
- new LinkedHashMap<String, GraphHistory>();
+ Map<String, GraphHistory> graphs = new LinkedHashMap<>();
for (int graphIntervalIndex = 0; graphIntervalIndex
< this.graphIntervals.length; graphIntervalIndex++) {
String graphName = this.graphNames[graphIntervalIndex];
@@ -117,7 +116,7 @@ public class WeightsDocumentWriter implements DocumentWriter {
long graphInterval = this.graphIntervals[graphIntervalIndex];
long dataPointInterval =
this.dataPointIntervals[graphIntervalIndex];
- List<Double> dataPoints = new ArrayList<Double>();
+ List<Double> dataPoints = new ArrayList<>();
long intervalStartMillis = ((this.now - graphInterval)
/ dataPointInterval) * dataPointInterval;
long totalMillis = 0L;
@@ -188,7 +187,7 @@ public class WeightsDocumentWriter implements DocumentWriter {
graphHistory.setCount(count);
int previousNonNullIndex = -2;
boolean foundTwoAdjacentDataPoints = false;
- List<Integer> values = new ArrayList<Integer>();
+ List<Integer> values = new ArrayList<>();
for (int dataPointIndex = firstNonNullIndex; dataPointIndex
<= lastNonNullIndex; dataPointIndex++) {
double dataPoint = dataPoints.get(dataPointIndex);
diff --git a/src/test/java/org/torproject/onionoo/docs/BandwidthStatusTest.java b/src/test/java/org/torproject/onionoo/docs/BandwidthStatusTest.java
index e327b64..6fcd05b 100644
--- a/src/test/java/org/torproject/onionoo/docs/BandwidthStatusTest.java
+++ b/src/test/java/org/torproject/onionoo/docs/BandwidthStatusTest.java
@@ -69,8 +69,7 @@ public class BandwidthStatusTest {
return this.intervalLength;
}
- private SortedMap<Long, Long> bandwidthValues =
- new TreeMap<>();
+ private SortedMap<Long, Long> bandwidthValues = new TreeMap<>();
public SortedMap<Long, Long> getBandwidthValues() {
return this.bandwidthValues;
diff --git a/src/test/java/org/torproject/onionoo/docs/DummyDocumentStore.java b/src/test/java/org/torproject/onionoo/docs/DummyDocumentStore.java
index 3c80cfa..4904044 100644
--- a/src/test/java/org/torproject/onionoo/docs/DummyDocumentStore.java
+++ b/src/test/java/org/torproject/onionoo/docs/DummyDocumentStore.java
@@ -20,8 +20,7 @@ public class DummyDocumentStore extends DocumentStore {
private <T extends Document> SortedMap<String, Document>
getStoredDocumentsByClass(Class<T> documentType) {
if (!this.storedDocuments.containsKey(documentType)) {
- this.storedDocuments.put(documentType,
- new TreeMap<String, Document>());
+ this.storedDocuments.put(documentType, new TreeMap<String, Document>());
}
return this.storedDocuments.get(documentType);
}
@@ -63,7 +62,7 @@ public class DummyDocumentStore extends DocumentStore {
public <T extends Document> SortedSet<String> list(
Class<T> documentType) {
this.performedListOperations++;
- SortedSet<String> fingerprints = new TreeSet<String>(
+ SortedSet<String> fingerprints = new TreeSet<>(
this.getStoredDocumentsByClass(documentType).keySet());
fingerprints.remove(FINGERPRINT_NULL);
return fingerprints;
diff --git a/src/test/java/org/torproject/onionoo/docs/NodeStatusTest.java b/src/test/java/org/torproject/onionoo/docs/NodeStatusTest.java
index 2e7c3a3..284edd9 100644
--- a/src/test/java/org/torproject/onionoo/docs/NodeStatusTest.java
+++ b/src/test/java/org/torproject/onionoo/docs/NodeStatusTest.java
@@ -26,11 +26,11 @@ public class NodeStatusTest {
private void assertFamiliesCanBeDeSerialized(
String[] declaredFamilyArray, String[] effectiveFamilyArray,
String[] extendedFamilyArray) {
- SortedSet<String> declaredFamily = new TreeSet<String>(
+ SortedSet<String> declaredFamily = new TreeSet<>(
Arrays.asList(declaredFamilyArray));
- SortedSet<String> effectiveFamily = new TreeSet<String>(
+ SortedSet<String> effectiveFamily = new TreeSet<>(
Arrays.asList(effectiveFamilyArray));
- SortedSet<String> extendedFamily = new TreeSet<String>(
+ SortedSet<String> extendedFamily = new TreeSet<>(
Arrays.asList(extendedFamilyArray));
NodeStatus nodeStatus = NodeStatus.fromString(GABELMOO_NODE_STATUS);
nodeStatus.setDeclaredFamily(declaredFamily);
diff --git a/src/test/java/org/torproject/onionoo/docs/SummaryDocumentTest.java b/src/test/java/org/torproject/onionoo/docs/SummaryDocumentTest.java
index 359fa03..413ca83 100644
--- a/src/test/java/org/torproject/onionoo/docs/SummaryDocumentTest.java
+++ b/src/test/java/org/torproject/onionoo/docs/SummaryDocumentTest.java
@@ -18,14 +18,14 @@ public class SummaryDocumentTest {
"000C5F55BD4814B917CC474BD537F1A3B33CCE2A", Arrays.asList(
new String[] { "62.216.201.221", "62.216.201.222",
"62.216.201.223" }), DateTimeHelper.parse("2013-04-19 05:00:00"),
- false, new TreeSet<String>(Arrays.asList(new String[] { "Running",
+ false, new TreeSet<>(Arrays.asList(new String[] { "Running",
"Valid" })), 20L, "de",
DateTimeHelper.parse("2013-04-18 05:00:00"), "AS8767",
"torkaz <klaus dot zufall at gmx dot de> "
- + "<fb-token:np5_g_83jmf=>", new TreeSet<String>(Arrays.asList(
+ + "<fb-token:np5_g_83jmf=>", new TreeSet<>(Arrays.asList(
new String[] { "001C13B3A55A71B977CA65EC85539D79C653A3FC",
"0025C136C1F3A9EEFE2AE3F918F03BFA21B5070B" })),
- new TreeSet<String>(Arrays.asList(
+ new TreeSet<>(Arrays.asList(
new String[] { "001C13B3A55A71B977CA65EC85539D79C653A3FC" })));
}
diff --git a/src/test/java/org/torproject/onionoo/docs/UptimeStatusTest.java b/src/test/java/org/torproject/onionoo/docs/UptimeStatusTest.java
index b5fa157..0d95925 100644
--- a/src/test/java/org/torproject/onionoo/docs/UptimeStatusTest.java
+++ b/src/test/java/org/torproject/onionoo/docs/UptimeStatusTest.java
@@ -208,7 +208,7 @@ public class UptimeStatusTest {
}
private static final SortedSet<String> RUNNING_FLAG =
- new TreeSet<String>(Arrays.asList(new String[] { "Running" }));
+ new TreeSet<>(Arrays.asList(new String[] { "Running" }));
@Test()
public void testAddFlagsToNoFlagsEnd() {
diff --git a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
index 9d47bd2..f17e228 100644
--- a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
+++ b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
@@ -136,29 +136,28 @@ public class ResourceServletTest {
"000C5F55BD4814B917CC474BD537F1A3B33CCE2A", Arrays.asList(
new String[] { "62.216.201.221", "62.216.201.222",
"62.216.201.223" }), DateTimeHelper.parse("2013-04-19 05:00:00"),
- false, new TreeSet<String>(Arrays.asList(new String[] { "Running",
+ false, new TreeSet<>(Arrays.asList(new String[] { "Running",
"Valid" })), 20L, "de",
DateTimeHelper.parse("2013-04-18 05:00:00"), "AS8767",
"torkaz <klaus dot zufall at gmx dot de> "
- + "<fb-token:np5_g_83jmf=>", new TreeSet<String>(Arrays.asList(
+ + "<fb-token:np5_g_83jmf=>", new TreeSet<>(Arrays.asList(
new String[] { "001C13B3A55A71B977CA65EC85539D79C653A3FC",
"0025C136C1F3A9EEFE2AE3F918F03BFA21B5070B" })),
- new TreeSet<String>(Arrays.asList(
+ new TreeSet<>(Arrays.asList(
new String[] { "001C13B3A55A71B977CA65EC85539D79C653A3FC" })));
org.torproject.onionoo.docs.SummaryDocument relayFerrari458 =
new org.torproject.onionoo.docs.SummaryDocument(true, "Ferrari458",
"001C13B3A55A71B977CA65EC85539D79C653A3FC", Arrays.asList(
new String[] { "68.38.171.200", "[2001:4f8:3:2e::51]" }),
DateTimeHelper.parse("2013-04-24 12:00:00"), true,
- new TreeSet<String>(Arrays.asList(new String[] { "Fast", "Named",
+ new TreeSet<>(Arrays.asList(new String[] { "Fast", "Named",
"Running", "V2Dir", "Valid" })), 1140L, "us",
- DateTimeHelper.parse("2013-02-12 16:00:00"), "AS7922", null,
+ DateTimeHelper.parse("2013-04-16 18:00:00"), "AS7922", null,
new TreeSet<String>(Arrays.asList(new String[] {
"000C5F55BD4814B917CC474BD537F1A3B33CCE2A" })),
- new TreeSet<String>(Arrays.asList(new String[] {
+ new TreeSet<>(Arrays.asList(new String[] {
"000C5F55BD4814B917CC474BD537F1A3B33CCE2A" })));
- this.relays =
- new TreeMap<String, org.torproject.onionoo.docs.SummaryDocument>();
+ this.relays = new TreeMap<>();
this.relays.put("000C5F55BD4814B917CC474BD537F1A3B33CCE2A",
relayTorkaZ);
this.relays.put("001C13B3A55A71B977CA65EC85539D79C653A3FC",
@@ -168,7 +167,7 @@ public class ResourceServletTest {
"0025C136C1F3A9EEFE2AE3F918F03BFA21B5070B", Arrays.asList(
new String[] { "89.69.68.246" }),
DateTimeHelper.parse("2013-04-22 20:00:00"), false,
- new TreeSet<String>(Arrays.asList(new String[] { "Fast",
+ new TreeSet<>(Arrays.asList(new String[] { "Fast",
"Running", "Unnamed", "V2Dir", "Valid" })), 63L, "a1",
DateTimeHelper.parse("2013-04-16 18:00:00"), "AS6830",
"1024D/51E2A1C7 steven j. murdoch "
@@ -176,14 +175,13 @@ public class ResourceServletTest {
new TreeSet<String>(), new TreeSet<String>());
this.relays.put("0025C136C1F3A9EEFE2AE3F918F03BFA21B5070B",
relayTimMayTribute);
- this.bridges =
- new TreeMap<String, org.torproject.onionoo.docs.SummaryDocument>();
+ this.bridges = new TreeMap<>();
org.torproject.onionoo.docs.SummaryDocument bridgeec2bridgercc7f31fe =
new org.torproject.onionoo.docs.SummaryDocument(false,
"ec2bridgercc7f31fe", "0000831B236DFF73D409AD17B40E2A728A53994F",
Arrays.asList(new String[] { "10.199.7.176" }),
DateTimeHelper.parse("2013-04-21 18:07:03"), false,
- new TreeSet<String>(Arrays.asList(new String[] { "Valid" })), -1L,
+ new TreeSet<>(Arrays.asList(new String[] { "Valid" })), -1L,
null, DateTimeHelper.parse("2013-04-20 15:37:04"), null, null,
null, null);
this.bridges.put("0000831B236DFF73D409AD17B40E2A728A53994F",
@@ -193,7 +191,7 @@ public class ResourceServletTest {
"0002D9BDBBC230BD9C78FF502A16E0033EF87E0C", Arrays.asList(
new String[] { "10.0.52.84" }),
DateTimeHelper.parse("2013-04-20 17:37:04"), false,
- new TreeSet<String>(Arrays.asList(new String[] { "Valid" })), -1L,
+ new TreeSet<>(Arrays.asList(new String[] { "Valid" })), -1L,
null, DateTimeHelper.parse("2013-04-14 07:07:05"), null, null,
null, null);
this.bridges.put("0002D9BDBBC230BD9C78FF502A16E0033EF87E0C",
@@ -203,7 +201,7 @@ public class ResourceServletTest {
"1FEDE50ED8DBA1DD9F9165F78C8131E4A44AB756", Arrays.asList(
new String[] { "10.63.169.98" }),
DateTimeHelper.parse("2013-04-24 01:07:04"), true,
- new TreeSet<String>(Arrays.asList(new String[] { "Running",
+ new TreeSet<>(Arrays.asList(new String[] { "Running",
"Valid" })), -1L, null,
DateTimeHelper.parse("2013-01-16 21:07:04"), null, null, null,
null);
diff --git a/src/test/java/org/torproject/onionoo/updater/DummyConsensus.java b/src/test/java/org/torproject/onionoo/updater/DummyConsensus.java
index 54d0161..9745aa4 100644
--- a/src/test/java/org/torproject/onionoo/updater/DummyConsensus.java
+++ b/src/test/java/org/torproject/onionoo/updater/DummyConsensus.java
@@ -74,7 +74,7 @@ public class DummyConsensus implements RelayNetworkStatusConsensus {
return null;
}
- private SortedSet<String> knownFlags = new TreeSet<String>();
+ private SortedSet<String> knownFlags = new TreeSet<>();
public void addKnownFlag(String flag) {
this.knownFlags.add(flag);
diff --git a/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java b/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java
index 990b011..2312ef9 100644
--- a/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java
+++ b/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java
@@ -13,8 +13,7 @@ import java.util.Set;
public class DummyDescriptorSource extends DescriptorSource {
- private Map<DescriptorType, Set<Descriptor>> descriptors =
- new HashMap<DescriptorType, Set<Descriptor>>();
+ private Map<DescriptorType, Set<Descriptor>> descriptors = new HashMap<>();
/** Fills the given collection with descriptors of the requested type. */
public void provideDescriptors(DescriptorType descriptorType,
@@ -53,7 +52,7 @@ public class DummyDescriptorSource extends DescriptorSource {
@Override
public void readDescriptors() {
- Set<DescriptorType> descriptorTypes = new HashSet<DescriptorType>();
+ Set<DescriptorType> descriptorTypes = new HashSet<>();
descriptorTypes.addAll(this.descriptorListeners.keySet());
for (DescriptorType descriptorType : descriptorTypes) {
boolean relay;
diff --git a/src/test/java/org/torproject/onionoo/updater/DummyStatusEntry.java b/src/test/java/org/torproject/onionoo/updater/DummyStatusEntry.java
index da583b8..9da51fc 100644
--- a/src/test/java/org/torproject/onionoo/updater/DummyStatusEntry.java
+++ b/src/test/java/org/torproject/onionoo/updater/DummyStatusEntry.java
@@ -59,7 +59,7 @@ public class DummyStatusEntry implements NetworkStatusEntry {
return null;
}
- private SortedSet<String> flags = new TreeSet<String>();
+ private SortedSet<String> flags = new TreeSet<>();
public void addFlag(String flag) {
this.flags.add(flag);
diff --git a/src/test/java/org/torproject/onionoo/updater/LookupServiceTest.java b/src/test/java/org/torproject/onionoo/updater/LookupServiceTest.java
index bcd8571..6ffeaf6 100644
--- a/src/test/java/org/torproject/onionoo/updater/LookupServiceTest.java
+++ b/src/test/java/org/torproject/onionoo/updater/LookupServiceTest.java
@@ -32,12 +32,12 @@ public class LookupServiceTest {
private LookupService lookupService;
- private SortedSet<String> addressStrings = new TreeSet<String>();
+ private SortedSet<String> addressStrings = new TreeSet<>();
private SortedMap<String, LookupResult> lookupResults;
private void populateLines() {
- this.geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ this.geoLite2CityBlocksIPv4Lines = new ArrayList<>();
this.geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
@@ -48,7 +48,7 @@ public class LookupServiceTest {
+ "0,94035,37.3860,-122.0838");
this.geoLite2CityBlocksIPv4Lines.add("8.8.9.0/24,6252001,6252001,,0,"
+ "0,,38.0000,-97.0000");
- this.geoLite2CityLocationsEnLines = new ArrayList<String>();
+ this.geoLite2CityLocationsEnLines = new ArrayList<>();
this.geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -59,7 +59,7 @@ public class LookupServiceTest {
this.geoLite2CityLocationsEnLines.add("5375480,en,NA,"
+ "\"North America\",US,\"United States\",CA,California,,,"
+ "\"Mountain View\",807,America/Los_Angeles");
- this.geoipAsNum2Lines = new ArrayList<String>();
+ this.geoipAsNum2Lines = new ArrayList<>();
this.geoipAsNum2Lines.add("134743296,134744063,\"AS3356 Level 3 "
+ "Communications\"");
this.geoipAsNum2Lines.add("134744064,134744319,\"AS15169 Google "
@@ -252,7 +252,7 @@ public class LookupServiceTest {
@Test()
public void testLookupNoCorrespondingLocation() {
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -267,7 +267,7 @@ public class LookupServiceTest {
@Test()
public void testLookupBlocksStartNotANumber() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
@@ -281,7 +281,7 @@ public class LookupServiceTest {
@Test()
public void testLookupBlocksLocationX() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
@@ -294,7 +294,7 @@ public class LookupServiceTest {
@Test()
public void testLookupBlocksLocationEmpty() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
@@ -307,7 +307,7 @@ public class LookupServiceTest {
@Test()
public void testLookupBlocksTooFewFields() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
@@ -320,7 +320,7 @@ public class LookupServiceTest {
@Test()
public void testLookupBlocksExtraneousField() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
@@ -334,7 +334,7 @@ public class LookupServiceTest {
@Test()
public void testLookupBlocksThreeExtraneousFields() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
@@ -348,7 +348,7 @@ public class LookupServiceTest {
@Test()
public void testLookupLocationLocIdNotANumber() {
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -363,7 +363,7 @@ public class LookupServiceTest {
@Test()
public void testLookupLocationTooFewFields() {
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -378,7 +378,7 @@ public class LookupServiceTest {
@Test()
public void testLookupGeoipAsNum2EndBeforeStart() {
- List<String> geoipAsNum2Lines = new ArrayList<String>();
+ List<String> geoipAsNum2Lines = new ArrayList<>();
geoipAsNum2Lines.add("134743296,134744063,\"AS3356 Level 3 "
+ "Communications\"");
geoipAsNum2Lines.add("134744319,134744064,\"AS15169 Google Inc.\"");
@@ -391,7 +391,7 @@ public class LookupServiceTest {
@Test()
public void testLookupGeoipAsNum2StartNotANumber() {
- List<String> geoipAsNum2Lines = new ArrayList<String>();
+ List<String> geoipAsNum2Lines = new ArrayList<>();
geoipAsNum2Lines.add("one,134744319,\"AS15169 Google Inc.\"");
this.assertLookupResult(null, null, geoipAsNum2Lines, "8.8.8.8", null,
null, null, null, null, null, null, null);
@@ -399,7 +399,7 @@ public class LookupServiceTest {
@Test()
public void testLookupGeoipAsNum2StartTooLarge() {
- List<String> geoipAsNum2Lines = new ArrayList<String>();
+ List<String> geoipAsNum2Lines = new ArrayList<>();
geoipAsNum2Lines.add("1" + String.valueOf(Long.MAX_VALUE)
+ ",134744319,\"AS15169 Google Inc.\"");
this.assertLookupResult(null, null, geoipAsNum2Lines, "8.8.8.8", null,
@@ -408,7 +408,7 @@ public class LookupServiceTest {
@Test()
public void testLookupGeoipAsNum2TooFewFields() {
- List<String> geoipAsNum2Lines = new ArrayList<String>();
+ List<String> geoipAsNum2Lines = new ArrayList<>();
geoipAsNum2Lines.add("134744064,134744319");
this.assertLookupResult(null, null, geoipAsNum2Lines, "8.8.8.8", null,
null, null, null, null, null, null, null);
@@ -416,7 +416,7 @@ public class LookupServiceTest {
@Test()
public void testLookupGeoipAsNum2NoAsName() {
- List<String> geoipAsNum2Lines = new ArrayList<String>();
+ List<String> geoipAsNum2Lines = new ArrayList<>();
geoipAsNum2Lines.add("134743296,134744063,AS3356");
geoipAsNum2Lines.add("134744064,134744319,AS15169");
geoipAsNum2Lines.add("134744320,134750463,AS3356");
@@ -428,7 +428,7 @@ public class LookupServiceTest {
@Test()
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
public void testLookupLocationTurkey() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
@@ -441,7 +441,7 @@ public class LookupServiceTest {
+ "40.0781,29.5133");
geoLite2CityBlocksIPv4Lines.add("81.215.1.0/24,749748,298795,,0,0,,"
+ "40.6000,33.6153");
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -476,14 +476,14 @@ public class LookupServiceTest {
@Test()
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
public void testLookupLocationLatvia() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
+ "longitude");
geoLite2CityBlocksIPv4Lines.add("78.28.192.0/24,456202,458258,,0,0,,"
+ "56.5000,27.3167");
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -499,14 +499,14 @@ public class LookupServiceTest {
@Test()
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
public void testLookupLocationAzerbaijan() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
+ "longitude");
geoLite2CityBlocksIPv4Lines.add("94.20.148.0/24,585170,587116,,0,0,,"
+ "41.1919,47.1706");
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -523,14 +523,14 @@ public class LookupServiceTest {
@Test()
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
public void testLookupLocationVietnam() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
+ "longitude");
geoLite2CityBlocksIPv4Lines.add("115.78.92.0/23,1587976,1562822,,0,0,"
+ ",10.2333,106.3833");
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -547,14 +547,14 @@ public class LookupServiceTest {
@Test()
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
public void testLookupLocationJapan() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
+ "longitude");
geoLite2CityBlocksIPv4Lines.add("113.154.131.0/24,1848333,1861060,,0,"
+ "0,1012236,35.8000,139.1833");
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -571,14 +571,14 @@ public class LookupServiceTest {
@Test()
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
public void testLookupLocationDenmark() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
+ "longitude");
geoLite2CityBlocksIPv4Lines.add("2.110.246.0/24,2625001,2623032,,0,0,"
+ "5970,54.8880,10.4112");
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -596,14 +596,14 @@ public class LookupServiceTest {
@Test()
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
public void testLookupLocationGermany() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
+ "longitude");
geoLite2CityBlocksIPv4Lines.add("37.209.30.128/25,2947444,2921044,,0,"
+ "0,,48.6833,9.0167");
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -621,14 +621,14 @@ public class LookupServiceTest {
@Test()
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
public void testLookupLocationPoland() {
- List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<String>();
+ List<String> geoLite2CityBlocksIPv4Lines = new ArrayList<>();
geoLite2CityBlocksIPv4Lines.add("network,geoname_id,"
+ "registered_country_geoname_id,represented_country_geoname_id,"
+ "is_anonymous_proxy,is_satellite_provider,postal_code,latitude,"
+ "longitude");
geoLite2CityBlocksIPv4Lines.add("5.185.94.0/24,3099434,798544,,0,0,,"
+ "54.3608,18.6583");
- List<String> geoLite2CityLocationsEnLines = new ArrayList<String>();
+ List<String> geoLite2CityLocationsEnLines = new ArrayList<>();
geoLite2CityLocationsEnLines.add("geoname_id,locale_code,"
+ "continent_code,continent_name,country_iso_code,country_name,"
+ "subdivision_1_iso_code,subdivision_1_name,"
@@ -645,7 +645,7 @@ public class LookupServiceTest {
@Test()
@SuppressWarnings("AvoidEscapedUnicodeCharacters")
public void testLookupLocationAsNameNonAscii() {
- List<String> geoipAsNum2Lines = new ArrayList<String>();
+ List<String> geoipAsNum2Lines = new ArrayList<>();
geoipAsNum2Lines.add("3207917568,3207919615,\"AS52693 Conectel "
+ "Telecomunica\u00E7\u00F5es e Inform\u00E1tica Ltda ME\"");
geoipAsNum2Lines.add("3211196416,3211198463,\"AS262934 "
1
0

[translation/tor-browser-manual] Update translations for tor-browser-manual
by translation@torproject.org 11 Jan '17
by translation@torproject.org 11 Jan '17
11 Jan '17
commit 5a36c6c2b9b42302c5100c4792502942b933c62f
Author: Translation commit bot <translation(a)torproject.org>
Date: Wed Jan 11 10:18:20 2017 +0000
Update translations for tor-browser-manual
---
de/de.po | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/de/de.po b/de/de.po
index 4c8fe1a..b2ba6f2 100644
--- a/de/de.po
+++ b/de/de.po
@@ -8,12 +8,13 @@
# gregweb <gregweb(a)web.de>, 2016
# runasand <inactive+runasand(a)transifex.com>, 2016
# Inter Webs <hallohallo11(a)web.de>, 2016
+# Christian Humm <christian.lehberger(a)googlemail.com>, 2017
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2016-12-06 16:36-0600\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
-"Last-Translator: Inter Webs <hallohallo11(a)web.de>, 2016\n"
+"Last-Translator: Christian Humm <christian.lehberger(a)googlemail.com>, 2017\n"
"Language-Team: German (https://www.transifex.com/otf/teams/1519/de/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -281,6 +282,8 @@ msgid ""
"Select “yes” when asked if your Internet Service Provider blocks connections"
" to the Tor network."
msgstr ""
+"Wählen Sie \"ja\" aus, wenn Sie danach gefragt werden, ob Ihr "
+"Internetprovider Verbindungen zum Tor-Netzwerk blockiert."
#. This is a reference to an external file such as an image or video. When
#. the file changes, the md5 hash will change to let you know you need to
@@ -351,7 +354,7 @@ msgstr ""
#: downloading.page:27
msgid "GetTor"
-msgstr ""
+msgstr "GetTor"
#: downloading.page:28
msgid ""
@@ -362,7 +365,7 @@ msgstr ""
#: downloading.page:34
msgid "To use GetTor via email:"
-msgstr ""
+msgstr "Um GetTor mit Email zu benutzen:"
#: downloading.page:39
msgid ""
@@ -383,7 +386,7 @@ msgstr ""
#: downloading.page:57
msgid "To use GetTor via Twitter:"
-msgstr ""
+msgstr "Um GetTor mit Twitter zu benutzen:"
#: downloading.page:62
msgid ""
@@ -394,7 +397,7 @@ msgstr ""
#: downloading.page:70
msgid "To use GetTor via Jabber/XMPP (Tor Messenger, Jitsi, CoyIM):"
-msgstr ""
+msgstr "Um GetTor mit Jabber/XMPP (Tor Messenger, Jitsi, CoyIM) zu benutzen:"
#: downloading.page:75
msgid ""
@@ -500,6 +503,9 @@ msgid ""
"select this option. Tor Browser will take you through a series of "
"configuration options."
msgstr ""
+"Wenn Sie wissen, dass Ihre Verbindung zensiert wird oder einen Proxy "
+"benutzt, dann sollten Sie diese Option wählen. Tor Browser wird Sie durch "
+"eine Reihe von Konfigurationsoptionen führen."
#: first-time.page:44
msgid ""
1
0

11 Jan '17
commit 9a28463ac2ad880d1f4e2ae8535a8d6efd1752ec
Author: Sukhbir Singh <sukhbir(a)torproject.org>
Date: Wed Jan 11 00:29:02 2017 -0500
Fix typo in README.RELEASE
---
README.RELEASE | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.RELEASE b/README.RELEASE
index ab0f87b..0ba8ede 100644
--- a/README.RELEASE
+++ b/README.RELEASE
@@ -149,7 +149,7 @@ certificates and the private keys.
- gpg -abs sha256sums-signed-build.txt
- - Upload the signature (*.asc) back to paganini signed/ directory.
+ - Upload the signature (*.asc) back to build machine signed/ directory.
- At this stage, you have the code signed DMG and EXE, Linux builds, signed
MAR files, the update information, and the signed sha256sum of all files.
1
0

[tor-messenger-build/master] Add README.RELEASE file with the updated build process
by sukhbir@torproject.org 11 Jan '17
by sukhbir@torproject.org 11 Jan '17
11 Jan '17
commit bbe22c27058cfc087b64ef73710d0f63448f99fb
Author: Sukhbir Singh <sukhbir(a)torproject.org>
Date: Wed Jan 11 00:26:12 2017 -0500
Add README.RELEASE file with the updated build process
Also fix whitespace issues in signmars.py
---
README.RELEASE | 265 +++++++++++++++++++++++++++++++++++++
tools/update-responses/signmars.py | 4 +-
2 files changed, 267 insertions(+), 2 deletions(-)
diff --git a/README.RELEASE b/README.RELEASE
new file mode 100644
index 0000000..ab0f87b
--- /dev/null
+++ b/README.RELEASE
@@ -0,0 +1,265 @@
+Release Process for Tor Messenger
+=================================
+
+You are ready to release Tor Messenger when you have performed a substantial
+development effort, or you have to patch a security issue.
+
+The release process is divided into two parts: building Tor Messenger, and
+then signing the MAR files for secure automatic updates; follow this guide
+step by step to complete both the steps.
+
+Building
+========
+
+- If not already done, bump the version number in `ChangeLog', `rbm.conf',
+ `tools/update-responses/config.yml'
+
+- Ensure `HEAD' on the build machines matches the `master' of
+ `tor-messenger-build.git' repository.
+
+- Run `make tor-messenger-release'. The builds will be in the
+ `release/$VERSION' directory, along with the MAR files. This will also
+ output the `sha256sum' of the files.
+
+- Compare the Linux builds with at least one other person -- preferably
+ building on another machine -- to check if they are reproducible.
+
+- Test the builds on all platforms:
+
+ - Create an XMPP account and IRC account
+
+ - Ensure that the corresponding OTR keys have been generated (Tools >
+ OTR Preferences > Private Keys)
+
+ - Initiate an OTR conversation with another instance. Verify the
+ various authentication mechanisms.
+
+- If everything is fine, send the Windows and macOS builds (EXE and DMG) to
+ the Tor Browser team for code signing.
+
+! Wait to get the signed EXE and DMG back before proceeding to the next step !
+
+Making Update MARs
+==================
+
+This step only works if you want to do an update build and have a base version
+to diff against. So if you are upgrading from A to B, follow these steps; this
+assumes that A is the older version and B is the newer one.
+
+ ! These steps are not required if you are doing a build for just A or B !
+
+- Navigate to the build directory on the build machine
+
+- `cd tor-messenger-build/release/ && mkdir -p tor-messenger/signed/$VERSION'
+ (where $VERSION is the version of the release, same as in rbm.conf).
+
+- You are now in the tor-messenger/signed/$VERSION/ directory
+
+- Copy all the release files from tor-messenger-release into this directory
+
+ cp -r ../../../$VERSION/* .
+
+ ! If this is the first time you are doing an update, make sure the older
+ version is also present in the signed/ directory. For example if you are
+ building B for the first time, you should have A/ in the signed/ directory.
+ Repeat the above steps for A (if not already done):
+ mkdir -p tor-messenger/signed/A
+ cd A/
+ cp -r ../../../A/* .
+ The `gen_incrementals' script will complain about this.
+
+- Now copy the SIGNED Windows and macOS EXE and DMG files which the Tor
+ Browser team has uploaded.
+ - Check this step again to ensure you have the signed binaries. Compare
+ the checksums!
+
+- At this stage, you have the code signed binaries and the unsigned complete
+ MARs.
+
+- Now go to `tor-messenger-build/tools/update-responses'.
+
+- Edit `config.yml':
+ - Check and update the version in the `channel' section
+ - In `version', add a new section (see existing sections for help)
+ corresponding to the release version
+ - Assume you are updating from A to B. Your `config.yml' should look like:
+
+ channels:
+ release: B
+ B:
+ platformVersion: 45.6.0
+ detailsURL: https://blog.torproject.org/blog/tor-messenger-B-released
+ incremental_from:
+ - A
+
+- Now run `./gen_incrementals'. In the `signed/$VERSION' directory, you should
+ see incremental MARs from A->B along with the existing complete MARs.
+
+- This completes the MAR generation step. The next step is signing, which
+ takes place offline.
+
+Signing Update MARs
+===================
+
+This step has to be performed offline and assumes you have the MAR signing
+certificates and the private keys.
+
+ ! DO NOT copy the certificate directory to ANY remote machine !
+
+! This step works only on a Linux machine (32-bit or 64-bit)
+
+# Offline Steps Start #
+
+- Create a new local directory
+
+- Copy `signmars.py' from the build repository (`tor-messenger/tools/update-responses/')
+
+- Copy the following files from the signed/ directory in the previous section
+ to the current local directory:
+
+ mar-tools-linux*.zip
+ *.mar
+
+ scp tor-messenger-build/release/tor-messenger/signed/$VERSION/{*.mar,mar-tools-linux*.zip} .
+
+- Set `NSS_DB_DIR' to point to the directory with the certificate files. You
+ should point to the directory with the `cert8.db' file.
+
+- Run `signmars.py' and follow the steps. The signed MARs will be in the
+ signed/ directory.
+
+- cd signed/
+
+- Upload the signed MARs back to the directory you copied them from.
+
+ scp *.mar tor-messenger-build/release/tor-messenger/signed/$VERSION/
+
+# Offline Steps End #
+
+- Back to the build machine: navigate to tools/update-responses/. Run
+ `./update_responses' to generate the update manifest.
+
+- Generate the checksums for the builds:
+
+ sha256sum `ls -I "*.zip" -I "*.txt"` > sha256sums-signed-build.txt
+
+- GPG sign the sha256sums-signed-build.txt file:
+
+ - Copy the sha256sums-signed-build.txt to a local machine
+
+ - gpg -abs sha256sums-signed-build.txt
+
+ - Upload the signature (*.asc) back to paganini signed/ directory.
+
+- At this stage, you have the code signed DMG and EXE, Linux builds, signed
+ MAR files, the update information, and the signed sha256sum of all files.
+
+Testing Updates
+===============
+
+Before we push the update to users, we should test them first to make sure
+that incremental (or complete updates) are working as intended. We do this by
+pushing the updates to the `update_2.test' directory instead of `update_2'.
+
+- Copy the `htdocs/release' directory from the last section to `aus2.torproject.org'
+ staticiforme.torproject.org:/srv/aus2-master.torproject.org/htdocs/tormesse…
+
+ ! Make sure the .htaccess file is copied as well.
+
+- Copy the contents* of the signed/ directory to dist.tormessenger.org/tormessenger/$VERSION
+ staticiforme.torproject.org:/srv/dist-master.torproject.org/htdocs/tormesse…
+
+ * - You can skip sha256sums-unsigned-build.txt since we don't use it.
+
+- ssh to `staticiforme.torproject.org:/srv/dist-master.torproject.org/htdocs/tormessenger'
+ - Run `ln -sfn $VERSION current'
+ This helps us ensure that the `current' directory always refers to the
+ latest release of Tor Messenger
+ - Exit
+
+- We need to finalize the changes. Run:
+ ssh staticiforme.torproject.org static-update-component dist.torproject.org && ssh staticiforme.torproject.org static-update-component aus2.torproject.org
+
+- Now test the updates on ALL platforms as it is possbile that updates may
+ work on one but fail on the other.
+
+ - Start Tor Messenger
+
+ - Open the preferences editor and copy the value for preference `app.update.url'
+
+ - Create a new string preference (Right click -> New -> String) and set
+ the name to `app.update.url.override'. Set the value copied from the
+ previous step REPLACING `update_2' with `update_2.test'. Your string
+ should be:
+
+ https://aus2.torproject.org/tormessenger/update_2.test/%CHANNEL%/%BUILD_TAR…
+
+ - Create a new boolean preference `app.update.log' and set it to `true'
+
+ - Force an update by going to the about screen
+
+ - Tor Messenger should update (incrementally) and then restart
+
+ - The update should be applied on restart. If not, it should complain and
+ that means something is broken. Since we set `app.update.log' to `true',
+ it's a good time to look at the error console
+
+If everything went on fine with the testing, move on to the next step.
+
+Finalizing Updates and Releasing
+================================
+
+- Publish the blog post on blog.torproject.org. The URL should follow the same
+ format as described in the `config.yml' file for $VERSION
+
+- ssh to `staticiforme.torproject.org:/srv/aus2-master.torproject.org/htdocs/tormessenger/update_2/release`
+
+- Copy the changes from the `test' directory:
+
+ cp -R ../../update_2.test/release/. .
+
+- The update is still not live. To finalize it, exit, and then run:
+
+ ssh staticiforme.torproject.org static-update-component aus2.torproject.org
+
+- The update is now live. Now is a good time to again test if the updates are
+ being properly pushed to the users! It may be a good idea to repeat the Tor
+ Messenger tests in the previous section. (Install older version, force
+ update, check.)
+
+- Finalize the release process by tagging the version in
+ `tor-messenger-build.git' (run the code below):
+
+ VERSION=`awk '/tormessenger_version/ {print $2}' rbm.conf | cut -d "'" -f2`
+ git tag -s v$VERSION -m "version $VERSION"
+ git push --tags
+
+- This completes the release process.
+
+After a Release
+===============
+
+- Bump up the version number in ChangeLog, rbm.conf,
+ tools/update-responses/config.yml for the next release
+
+- Increment the version number and update the links on
+ https://trac.torproject.org/projects/tor/wiki/doc/TorMessenger
+
+- Administer the comments on the blog and reply to them. Open relevant tickets
+ wherever necessary.
+
+Troubleshooting
+===============
+
+- If you want to update add-ons like ctypes-otr or tor-launcher, make sure to
+ bump the version number in their `install.rdf' file. Add-ons are only
+ updated if the version number is incremented.
+
+- Any changes you make on staticiforme.torproject.org have to be finalized
+ with the `static-update-component $DIR' command. So if you have made changes
+ to `dist.torproject.org', you have to run:
+
+ ssh staticiforme.torproject.org static-update-component dist.torproject.org
+
+- Make sure `app.update.log' is set to `true' before testing updates since you
+ will get logging information as the update is applied, and if it fails.
diff --git a/tools/update-responses/signmars.py b/tools/update-responses/signmars.py
index 24e8d8a..a79dfae 100644
--- a/tools/update-responses/signmars.py
+++ b/tools/update-responses/signmars.py
@@ -98,7 +98,7 @@ def sign_mars():
print err
sys.exit("Unable to run signmar to verify the signatures.")
out = out.split('\n')[0]
-
+
# FIXME: This is a very poor hack to check for signatures that
# currently works but will fail if the files are 10 or 20.
if "0" in out:
@@ -107,7 +107,7 @@ def sign_mars():
print " [signed] {0}".format(each)
already_signed.append(each)
- num_to_sign = len(mar_files)-len(already_signed)
+ num_to_sign = len(mar_files) - len(already_signed)
if not num_to_sign:
sys.exit("All MAR files are already signed.")
1
0

[sandboxed-tor-browser/master] Add setsid() to the tor seccomp whitelist.
by yawning@torproject.org 11 Jan '17
by yawning@torproject.org 11 Jan '17
11 Jan '17
commit 7f6bd55a87d98f005db80ea6233f422544b20a42
Author: Yawning Angel <yawning(a)schwanenlied.me>
Date: Wed Jan 11 03:26:20 2017 +0000
Add setsid() to the tor seccomp whitelist.
Bubblewrap commit d7fc532c42f0e9bf427923bab85433282b3e5117 adds a call
to this, after the seccomp filter's been installed.
---
data/tor-common-amd64.seccomp | 1 +
1 file changed, 1 insertion(+)
diff --git a/data/tor-common-amd64.seccomp b/data/tor-common-amd64.seccomp
index 59ce3e1..5bc0428 100644
--- a/data/tor-common-amd64.seccomp
+++ b/data/tor-common-amd64.seccomp
@@ -94,6 +94,7 @@ restart_syscall: 1
set_tid_address: 1
unshare: 1
rt_sigaction: 1
+setsid: 1
# XXX: This is only required for ASAN builds, so this should be included at
# runtime.
1
0
commit 96494aed10214744f9b193f5d8ab0c10e559af7a
Author: hiromipaw <hiro(a)torproject.org>
Date: Tue Jan 10 20:39:58 2017 +0100
Fix comm dir page title
---
about/en/jobs-comm-director.wml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/about/en/jobs-comm-director.wml b/about/en/jobs-comm-director.wml
index aeccac9..a30ac81 100644
--- a/about/en/jobs-comm-director.wml
+++ b/about/en/jobs-comm-director.wml
@@ -2,7 +2,7 @@
# Revision: $Revision$
# Translation-Priority: 3-low
-#include "head.wmi" TITLE="Tor Project: Jobs (core developer)" CHARSET="UTF-8"
+#include "head.wmi" TITLE="Tor Project: Jobs (Communications Director)" CHARSET="UTF-8"
<div id="content" class="clearfix">
<div id="breadcrumbs">
<a href="<page index>">Home » </a>
1
0

[torbutton/master] Bug 21091: Hide the "Check for Tor Browser Update..." menu entry when running under the sandbox.
by gk@torproject.org 10 Jan '17
by gk@torproject.org 10 Jan '17
10 Jan '17
commit dd927687ed22a2e8a8e880e92c6f5b8273c737c9
Author: Kathy Brade <brade(a)pearlcrescent.com>
Date: Mon Jan 9 11:53:31 2017 -0500
Bug 21091: Hide the "Check for Tor Browser Update..." menu entry when running under the sandbox.
If the `TOR_HIDE_UPDATE_CHECK_UI` env var is set, hide the "Check for
Tor Browser Update..." menu item and the separator that sits right above it.
---
src/chrome/content/popup.xul | 2 +-
src/chrome/content/torbutton.js | 11 +++++++++++
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/src/chrome/content/popup.xul b/src/chrome/content/popup.xul
index d015766..9447b70 100644
--- a/src/chrome/content/popup.xul
+++ b/src/chrome/content/popup.xul
@@ -44,7 +44,7 @@
label="&torbutton.context_menu.networksettings;"
accesskey="&torbutton.context_menu.networksettings.key;"
oncommand="torbutton_open_network_settings()"/>
- <menuseparator/>
+ <menuseparator id="torbutton-checkForUpdateSeparator"/>
<menuitem id="torbutton-checkForUpdate"
label="&torbutton.context_menu.downloadUpdate;"
accesskey="&torbutton.context_menu.downloadUpdate.key;"
diff --git a/src/chrome/content/torbutton.js b/src/chrome/content/torbutton.js
index c0fe710..dacc43e 100644
--- a/src/chrome/content/torbutton.js
+++ b/src/chrome/content/torbutton.js
@@ -1822,6 +1822,17 @@ function torbutton_check_protections()
else
document.getElementById("torbutton-networksettings").hidden = false;
+ // Bug 21091: check for the existence of an environment variable
+ // in order to toggle the visibility of the torbutton-checkForUpdate
+ // menuitem and its separator.
+ if (env.exists("TOR_HIDE_UPDATE_CHECK_UI")) {
+ document.getElementById("torbutton-checkForUpdateSeparator").hidden = true;
+ document.getElementById("torbutton-checkForUpdate").hidden = true;
+ } else {
+ document.getElementById("torbutton-checkForUpdateSeparator").hidden = false;
+ document.getElementById("torbutton-checkForUpdate").hidden = false;
+ }
+
var cookie_pref = m_tb_prefs.getBoolPref("extensions.torbutton.cookie_protections");
document.getElementById("torbutton-cookie-protector").disabled = !cookie_pref;
1
0
commit 8c7ecc5f5bbbfe902f646ba24ac9bec6f59d6445
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Tue Jan 10 12:31:16 2017 +0100
Update copyright.
---
src/main/java/org/torproject/onionoo/cron/Main.java | 2 +-
src/main/java/org/torproject/onionoo/docs/BandwidthDocument.java | 2 +-
src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java | 2 +-
src/main/java/org/torproject/onionoo/docs/ClientsDocument.java | 2 +-
src/main/java/org/torproject/onionoo/docs/ClientsGraphHistory.java | 2 +-
src/main/java/org/torproject/onionoo/docs/ClientsHistory.java | 2 +-
src/main/java/org/torproject/onionoo/docs/ClientsStatus.java | 2 +-
src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java | 2 +-
src/main/java/org/torproject/onionoo/docs/DetailsDocument.java | 2 +-
src/main/java/org/torproject/onionoo/docs/DetailsStatus.java | 2 +-
src/main/java/org/torproject/onionoo/docs/Document.java | 2 +-
src/main/java/org/torproject/onionoo/docs/DocumentStore.java | 2 +-
src/main/java/org/torproject/onionoo/docs/DocumentStoreFactory.java | 2 +-
src/main/java/org/torproject/onionoo/docs/GraphHistory.java | 2 +-
src/main/java/org/torproject/onionoo/docs/NodeStatus.java | 2 +-
src/main/java/org/torproject/onionoo/docs/SummaryDocument.java | 2 +-
src/main/java/org/torproject/onionoo/docs/UpdateStatus.java | 2 +-
src/main/java/org/torproject/onionoo/docs/UptimeDocument.java | 2 +-
src/main/java/org/torproject/onionoo/docs/UptimeHistory.java | 2 +-
src/main/java/org/torproject/onionoo/docs/UptimeStatus.java | 2 +-
src/main/java/org/torproject/onionoo/docs/WeightsDocument.java | 2 +-
src/main/java/org/torproject/onionoo/docs/WeightsStatus.java | 2 +-
src/main/java/org/torproject/onionoo/server/Counter.java | 2 +-
.../java/org/torproject/onionoo/server/HttpServletRequestWrapper.java | 2 +-
.../java/org/torproject/onionoo/server/HttpServletResponseWrapper.java | 2 +-
src/main/java/org/torproject/onionoo/server/IntegerDistribution.java | 2 +-
src/main/java/org/torproject/onionoo/server/MostFrequentString.java | 2 +-
src/main/java/org/torproject/onionoo/server/NodeIndex.java | 2 +-
src/main/java/org/torproject/onionoo/server/NodeIndexer.java | 2 +-
src/main/java/org/torproject/onionoo/server/NodeIndexerFactory.java | 2 +-
src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java | 2 +-
src/main/java/org/torproject/onionoo/server/RequestHandler.java | 2 +-
src/main/java/org/torproject/onionoo/server/ResourceServlet.java | 2 +-
src/main/java/org/torproject/onionoo/server/ResponseBuilder.java | 2 +-
src/main/java/org/torproject/onionoo/server/ServerMain.java | 2 +-
.../java/org/torproject/onionoo/updater/BandwidthStatusUpdater.java | 2 +-
src/main/java/org/torproject/onionoo/updater/ClientsStatusUpdater.java | 2 +-
src/main/java/org/torproject/onionoo/updater/DescriptorDownloader.java | 2 +-
src/main/java/org/torproject/onionoo/updater/DescriptorHistory.java | 2 +-
src/main/java/org/torproject/onionoo/updater/DescriptorListener.java | 2 +-
src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java | 2 +-
src/main/java/org/torproject/onionoo/updater/DescriptorSource.java | 2 +-
.../java/org/torproject/onionoo/updater/DescriptorSourceFactory.java | 2 +-
src/main/java/org/torproject/onionoo/updater/DescriptorType.java | 2 +-
src/main/java/org/torproject/onionoo/updater/LookupResult.java | 2 +-
src/main/java/org/torproject/onionoo/updater/LookupService.java | 2 +-
.../java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java | 2 +-
src/main/java/org/torproject/onionoo/updater/RdnsLookupRequest.java | 2 +-
src/main/java/org/torproject/onionoo/updater/RdnsLookupWorker.java | 2 +-
.../java/org/torproject/onionoo/updater/ReverseDomainNameResolver.java | 2 +-
src/main/java/org/torproject/onionoo/updater/StatusUpdateRunner.java | 2 +-
src/main/java/org/torproject/onionoo/updater/StatusUpdater.java | 2 +-
src/main/java/org/torproject/onionoo/updater/UptimeStatusUpdater.java | 2 +-
src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java | 2 +-
src/main/java/org/torproject/onionoo/util/FormattingUtils.java | 2 +-
src/main/java/org/torproject/onionoo/util/Time.java | 2 +-
src/main/java/org/torproject/onionoo/util/TimeFactory.java | 2 +-
.../java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java | 2 +-
src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java | 2 +-
src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java | 2 +-
src/main/java/org/torproject/onionoo/writer/DocumentWriter.java | 2 +-
src/main/java/org/torproject/onionoo/writer/DocumentWriterRunner.java | 2 +-
src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java | 2 +-
src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java | 2 +-
src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java | 2 +-
src/main/resources/bootstrap-development.sh | 2 +-
src/test/java/org/torproject/onionoo/docs/BandwidthStatusTest.java | 2 +-
src/test/java/org/torproject/onionoo/docs/DummyDocumentStore.java | 2 +-
src/test/java/org/torproject/onionoo/docs/NodeStatusTest.java | 2 +-
src/test/java/org/torproject/onionoo/docs/SummaryDocumentTest.java | 2 +-
src/test/java/org/torproject/onionoo/docs/UptimeStatusTest.java | 2 +-
src/test/java/org/torproject/onionoo/docs/WeightsStatusTest.java | 2 +-
src/test/java/org/torproject/onionoo/server/PerformanceMetricsTest.java | 2 +-
src/test/java/org/torproject/onionoo/server/ResourceServletTest.java | 2 +-
src/test/java/org/torproject/onionoo/updater/DummyBridgeStatus.java | 2 +-
src/test/java/org/torproject/onionoo/updater/DummyConsensus.java | 2 +-
src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java | 2 +-
src/test/java/org/torproject/onionoo/updater/DummyStatusEntry.java | 2 +-
src/test/java/org/torproject/onionoo/updater/LookupServiceTest.java | 2 +-
.../java/org/torproject/onionoo/updater/UptimeStatusUpdaterTest.java | 2 +-
src/test/java/org/torproject/onionoo/util/DummyTime.java | 2 +-
.../java/org/torproject/onionoo/writer/UptimeDocumentWriterTest.java | 2 +-
82 files changed, 82 insertions(+), 82 deletions(-)
diff --git a/src/main/java/org/torproject/onionoo/cron/Main.java b/src/main/java/org/torproject/onionoo/cron/Main.java
index 5b80934..685da35 100644
--- a/src/main/java/org/torproject/onionoo/cron/Main.java
+++ b/src/main/java/org/torproject/onionoo/cron/Main.java
@@ -1,4 +1,4 @@
-/* Copyright 2011--2016 The Tor Project
+/* Copyright 2011--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.cron;
diff --git a/src/main/java/org/torproject/onionoo/docs/BandwidthDocument.java b/src/main/java/org/torproject/onionoo/docs/BandwidthDocument.java
index 575b8a0..38f5f62 100644
--- a/src/main/java/org/torproject/onionoo/docs/BandwidthDocument.java
+++ b/src/main/java/org/torproject/onionoo/docs/BandwidthDocument.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java b/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
index ac7085f..580bfbd 100644
--- a/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/BandwidthStatus.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/ClientsDocument.java b/src/main/java/org/torproject/onionoo/docs/ClientsDocument.java
index f8b0c84..2cc69c0 100644
--- a/src/main/java/org/torproject/onionoo/docs/ClientsDocument.java
+++ b/src/main/java/org/torproject/onionoo/docs/ClientsDocument.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/ClientsGraphHistory.java b/src/main/java/org/torproject/onionoo/docs/ClientsGraphHistory.java
index 0826887..df538a9 100644
--- a/src/main/java/org/torproject/onionoo/docs/ClientsGraphHistory.java
+++ b/src/main/java/org/torproject/onionoo/docs/ClientsGraphHistory.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/ClientsHistory.java b/src/main/java/org/torproject/onionoo/docs/ClientsHistory.java
index e99c3ef..e1f0353 100644
--- a/src/main/java/org/torproject/onionoo/docs/ClientsHistory.java
+++ b/src/main/java/org/torproject/onionoo/docs/ClientsHistory.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java b/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java
index 45466ae..55bdc7b 100644
--- a/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/ClientsStatus.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java b/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java
index 1dc40c3..9721612 100644
--- a/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java
+++ b/src/main/java/org/torproject/onionoo/docs/DateTimeHelper.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/DetailsDocument.java b/src/main/java/org/torproject/onionoo/docs/DetailsDocument.java
index a9257af..97fc703 100644
--- a/src/main/java/org/torproject/onionoo/docs/DetailsDocument.java
+++ b/src/main/java/org/torproject/onionoo/docs/DetailsDocument.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java b/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java
index 7258054..bad3964 100644
--- a/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/DetailsStatus.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/Document.java b/src/main/java/org/torproject/onionoo/docs/Document.java
index f2f9714..355a543 100644
--- a/src/main/java/org/torproject/onionoo/docs/Document.java
+++ b/src/main/java/org/torproject/onionoo/docs/Document.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/DocumentStore.java b/src/main/java/org/torproject/onionoo/docs/DocumentStore.java
index e1be777..08fb984 100644
--- a/src/main/java/org/torproject/onionoo/docs/DocumentStore.java
+++ b/src/main/java/org/torproject/onionoo/docs/DocumentStore.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/DocumentStoreFactory.java b/src/main/java/org/torproject/onionoo/docs/DocumentStoreFactory.java
index 455a27f..8764d69 100644
--- a/src/main/java/org/torproject/onionoo/docs/DocumentStoreFactory.java
+++ b/src/main/java/org/torproject/onionoo/docs/DocumentStoreFactory.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/GraphHistory.java b/src/main/java/org/torproject/onionoo/docs/GraphHistory.java
index 5dde6a7..7d41780 100644
--- a/src/main/java/org/torproject/onionoo/docs/GraphHistory.java
+++ b/src/main/java/org/torproject/onionoo/docs/GraphHistory.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/NodeStatus.java b/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
index 7d595e4..a2b44f8 100644
--- a/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/NodeStatus.java
@@ -1,4 +1,4 @@
-/* Copyright 2011--2016 The Tor Project
+/* Copyright 2011--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java b/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
index ce8a22a..b7f62ad 100644
--- a/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
+++ b/src/main/java/org/torproject/onionoo/docs/SummaryDocument.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/UpdateStatus.java b/src/main/java/org/torproject/onionoo/docs/UpdateStatus.java
index 4223337..32461fc 100644
--- a/src/main/java/org/torproject/onionoo/docs/UpdateStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/UpdateStatus.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/UptimeDocument.java b/src/main/java/org/torproject/onionoo/docs/UptimeDocument.java
index 98884b6..c88b9ff 100644
--- a/src/main/java/org/torproject/onionoo/docs/UptimeDocument.java
+++ b/src/main/java/org/torproject/onionoo/docs/UptimeDocument.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java b/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
index 3cd0a0e..bcf0c6e 100644
--- a/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
+++ b/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
@@ -1,4 +1,4 @@
-/* Copyright 2016 The Tor Project
+/* Copyright 2016--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/UptimeStatus.java b/src/main/java/org/torproject/onionoo/docs/UptimeStatus.java
index b725acc..286b32f 100644
--- a/src/main/java/org/torproject/onionoo/docs/UptimeStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/UptimeStatus.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/WeightsDocument.java b/src/main/java/org/torproject/onionoo/docs/WeightsDocument.java
index 9b1c8ef..6d5c6a6 100644
--- a/src/main/java/org/torproject/onionoo/docs/WeightsDocument.java
+++ b/src/main/java/org/torproject/onionoo/docs/WeightsDocument.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java b/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java
index 50b8b35..5c18dee 100644
--- a/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java
+++ b/src/main/java/org/torproject/onionoo/docs/WeightsStatus.java
@@ -1,4 +1,4 @@
-/* Copyright 2016 The Tor Project
+/* Copyright 2016--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/main/java/org/torproject/onionoo/server/Counter.java b/src/main/java/org/torproject/onionoo/server/Counter.java
index 655a56c..6c53587 100644
--- a/src/main/java/org/torproject/onionoo/server/Counter.java
+++ b/src/main/java/org/torproject/onionoo/server/Counter.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/HttpServletRequestWrapper.java b/src/main/java/org/torproject/onionoo/server/HttpServletRequestWrapper.java
index e819a1a..8da8821 100644
--- a/src/main/java/org/torproject/onionoo/server/HttpServletRequestWrapper.java
+++ b/src/main/java/org/torproject/onionoo/server/HttpServletRequestWrapper.java
@@ -1,4 +1,4 @@
-/* Copyright 2011--2016 The Tor Project
+/* Copyright 2011--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/HttpServletResponseWrapper.java b/src/main/java/org/torproject/onionoo/server/HttpServletResponseWrapper.java
index d804c3a..c591106 100644
--- a/src/main/java/org/torproject/onionoo/server/HttpServletResponseWrapper.java
+++ b/src/main/java/org/torproject/onionoo/server/HttpServletResponseWrapper.java
@@ -1,4 +1,4 @@
-/* Copyright 2011--2016 The Tor Project
+/* Copyright 2011--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/IntegerDistribution.java b/src/main/java/org/torproject/onionoo/server/IntegerDistribution.java
index c9e3a29..adc3db2 100644
--- a/src/main/java/org/torproject/onionoo/server/IntegerDistribution.java
+++ b/src/main/java/org/torproject/onionoo/server/IntegerDistribution.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/MostFrequentString.java b/src/main/java/org/torproject/onionoo/server/MostFrequentString.java
index 12b5e04..3e8697e 100644
--- a/src/main/java/org/torproject/onionoo/server/MostFrequentString.java
+++ b/src/main/java/org/torproject/onionoo/server/MostFrequentString.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/NodeIndex.java b/src/main/java/org/torproject/onionoo/server/NodeIndex.java
index 7871690..9f9cf74 100644
--- a/src/main/java/org/torproject/onionoo/server/NodeIndex.java
+++ b/src/main/java/org/torproject/onionoo/server/NodeIndex.java
@@ -1,4 +1,4 @@
-/* Copyright 2016 The Tor Project
+/* Copyright 2016--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/NodeIndexer.java b/src/main/java/org/torproject/onionoo/server/NodeIndexer.java
index 99d1aee..b470323 100644
--- a/src/main/java/org/torproject/onionoo/server/NodeIndexer.java
+++ b/src/main/java/org/torproject/onionoo/server/NodeIndexer.java
@@ -1,4 +1,4 @@
-/* Copyright 2016 The Tor Project
+/* Copyright 2016--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/NodeIndexerFactory.java b/src/main/java/org/torproject/onionoo/server/NodeIndexerFactory.java
index b938c9e..5d93bf4 100644
--- a/src/main/java/org/torproject/onionoo/server/NodeIndexerFactory.java
+++ b/src/main/java/org/torproject/onionoo/server/NodeIndexerFactory.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java b/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java
index 7a621cf..1f52397 100644
--- a/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java
+++ b/src/main/java/org/torproject/onionoo/server/PerformanceMetrics.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/RequestHandler.java b/src/main/java/org/torproject/onionoo/server/RequestHandler.java
index 49b3b94..32af238 100644
--- a/src/main/java/org/torproject/onionoo/server/RequestHandler.java
+++ b/src/main/java/org/torproject/onionoo/server/RequestHandler.java
@@ -1,4 +1,4 @@
-/* Copyright 2011--2016 The Tor Project
+/* Copyright 2011--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/ResourceServlet.java b/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
index c1c5757..0e4c68f 100644
--- a/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
+++ b/src/main/java/org/torproject/onionoo/server/ResourceServlet.java
@@ -1,4 +1,4 @@
-/* Copyright 2011--2016 The Tor Project
+/* Copyright 2011--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
index cd0c633..4c13334 100644
--- a/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
+++ b/src/main/java/org/torproject/onionoo/server/ResponseBuilder.java
@@ -1,4 +1,4 @@
-/* Copyright 2011--2016 The Tor Project
+/* Copyright 2011--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/server/ServerMain.java b/src/main/java/org/torproject/onionoo/server/ServerMain.java
index fd4dc90..d712ba8 100644
--- a/src/main/java/org/torproject/onionoo/server/ServerMain.java
+++ b/src/main/java/org/torproject/onionoo/server/ServerMain.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/main/java/org/torproject/onionoo/updater/BandwidthStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/BandwidthStatusUpdater.java
index 3aa3dd1..d750358 100644
--- a/src/main/java/org/torproject/onionoo/updater/BandwidthStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/BandwidthStatusUpdater.java
@@ -1,4 +1,4 @@
-/* Copyright 2011--2016 The Tor Project
+/* Copyright 2011--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/ClientsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/ClientsStatusUpdater.java
index 28b8ea7..20971f8 100644
--- a/src/main/java/org/torproject/onionoo/updater/ClientsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/ClientsStatusUpdater.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorDownloader.java b/src/main/java/org/torproject/onionoo/updater/DescriptorDownloader.java
index 5822b77..d51bc20 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorDownloader.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorDownloader.java
@@ -1,4 +1,4 @@
-/* Copyright 2016 The Tor Project
+/* Copyright 2016--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorHistory.java b/src/main/java/org/torproject/onionoo/updater/DescriptorHistory.java
index 28eaec7..4cf7d81 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorHistory.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorHistory.java
@@ -1,4 +1,4 @@
-/* Copyright 2016 The Tor Project
+/* Copyright 2016--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorListener.java b/src/main/java/org/torproject/onionoo/updater/DescriptorListener.java
index 328fd6f..f655d19 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorListener.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorListener.java
@@ -1,4 +1,4 @@
-/* Copyright 2016 The Tor Project
+/* Copyright 2016--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java b/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java
index c17d498..27a046e 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorQueue.java
@@ -1,4 +1,4 @@
-/* Copyright 2016 The Tor Project
+/* Copyright 2016--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java b/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java
index c251142..79fe53b 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorSource.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorSourceFactory.java b/src/main/java/org/torproject/onionoo/updater/DescriptorSourceFactory.java
index 4974488..c1d093b 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorSourceFactory.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorSourceFactory.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/DescriptorType.java b/src/main/java/org/torproject/onionoo/updater/DescriptorType.java
index b7b6b8e..f9a266e 100644
--- a/src/main/java/org/torproject/onionoo/updater/DescriptorType.java
+++ b/src/main/java/org/torproject/onionoo/updater/DescriptorType.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/LookupResult.java b/src/main/java/org/torproject/onionoo/updater/LookupResult.java
index 930e2fb..94297c0 100644
--- a/src/main/java/org/torproject/onionoo/updater/LookupResult.java
+++ b/src/main/java/org/torproject/onionoo/updater/LookupResult.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/LookupService.java b/src/main/java/org/torproject/onionoo/updater/LookupService.java
index ec63751..fcef0bc 100644
--- a/src/main/java/org/torproject/onionoo/updater/LookupService.java
+++ b/src/main/java/org/torproject/onionoo/updater/LookupService.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
index d0e4529..202524d 100644
--- a/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/NodeDetailsStatusUpdater.java
@@ -1,4 +1,4 @@
-/* Copyright 2011--2016 The Tor Project
+/* Copyright 2011--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/RdnsLookupRequest.java b/src/main/java/org/torproject/onionoo/updater/RdnsLookupRequest.java
index 75ad315..3f2f561 100644
--- a/src/main/java/org/torproject/onionoo/updater/RdnsLookupRequest.java
+++ b/src/main/java/org/torproject/onionoo/updater/RdnsLookupRequest.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/RdnsLookupWorker.java b/src/main/java/org/torproject/onionoo/updater/RdnsLookupWorker.java
index 165507b..e490075 100644
--- a/src/main/java/org/torproject/onionoo/updater/RdnsLookupWorker.java
+++ b/src/main/java/org/torproject/onionoo/updater/RdnsLookupWorker.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/ReverseDomainNameResolver.java b/src/main/java/org/torproject/onionoo/updater/ReverseDomainNameResolver.java
index 3214c74..3c26975 100644
--- a/src/main/java/org/torproject/onionoo/updater/ReverseDomainNameResolver.java
+++ b/src/main/java/org/torproject/onionoo/updater/ReverseDomainNameResolver.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/StatusUpdateRunner.java b/src/main/java/org/torproject/onionoo/updater/StatusUpdateRunner.java
index 7aa1a5e..6c55c96 100644
--- a/src/main/java/org/torproject/onionoo/updater/StatusUpdateRunner.java
+++ b/src/main/java/org/torproject/onionoo/updater/StatusUpdateRunner.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/StatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/StatusUpdater.java
index f8474f4..bc5b610 100644
--- a/src/main/java/org/torproject/onionoo/updater/StatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/StatusUpdater.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/UptimeStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/UptimeStatusUpdater.java
index d4951b7..fb8139c 100644
--- a/src/main/java/org/torproject/onionoo/updater/UptimeStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/UptimeStatusUpdater.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java b/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java
index 2442a00..7ce1863 100644
--- a/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java
+++ b/src/main/java/org/torproject/onionoo/updater/WeightsStatusUpdater.java
@@ -1,4 +1,4 @@
-/* Copyright 2012--2016 The Tor Project
+/* Copyright 2012--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/main/java/org/torproject/onionoo/util/FormattingUtils.java b/src/main/java/org/torproject/onionoo/util/FormattingUtils.java
index fd83cf8..1c3aa55 100644
--- a/src/main/java/org/torproject/onionoo/util/FormattingUtils.java
+++ b/src/main/java/org/torproject/onionoo/util/FormattingUtils.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.util;
diff --git a/src/main/java/org/torproject/onionoo/util/Time.java b/src/main/java/org/torproject/onionoo/util/Time.java
index 45c2d7b..f06ceb6 100644
--- a/src/main/java/org/torproject/onionoo/util/Time.java
+++ b/src/main/java/org/torproject/onionoo/util/Time.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.util;
diff --git a/src/main/java/org/torproject/onionoo/util/TimeFactory.java b/src/main/java/org/torproject/onionoo/util/TimeFactory.java
index f0c8a98..68dcc98 100644
--- a/src/main/java/org/torproject/onionoo/util/TimeFactory.java
+++ b/src/main/java/org/torproject/onionoo/util/TimeFactory.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.util;
diff --git a/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java
index 25bca5e..84e42ce 100644
--- a/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/BandwidthDocumentWriter.java
@@ -1,4 +1,4 @@
-/* Copyright 2011--2016 The Tor Project
+/* Copyright 2011--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.writer;
diff --git a/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java
index 00389d0..868d5c1 100644
--- a/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/ClientsDocumentWriter.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.writer;
diff --git a/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java
index 1c515e8..5e3e175 100644
--- a/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/DetailsDocumentWriter.java
@@ -1,4 +1,4 @@
-/* Copyright 2016 The Tor Project
+/* Copyright 2016--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.writer;
diff --git a/src/main/java/org/torproject/onionoo/writer/DocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/DocumentWriter.java
index 3fe63b9..f68e962 100644
--- a/src/main/java/org/torproject/onionoo/writer/DocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/DocumentWriter.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.writer;
diff --git a/src/main/java/org/torproject/onionoo/writer/DocumentWriterRunner.java b/src/main/java/org/torproject/onionoo/writer/DocumentWriterRunner.java
index d9d1c47..9abc669 100644
--- a/src/main/java/org/torproject/onionoo/writer/DocumentWriterRunner.java
+++ b/src/main/java/org/torproject/onionoo/writer/DocumentWriterRunner.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.writer;
diff --git a/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java
index e9bb8f6..24c7e0c 100644
--- a/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/SummaryDocumentWriter.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.writer;
diff --git a/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java
index 502c351..42f5661 100644
--- a/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/UptimeDocumentWriter.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.writer;
diff --git a/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java b/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java
index 326fbda..35ef3ae 100644
--- a/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java
+++ b/src/main/java/org/torproject/onionoo/writer/WeightsDocumentWriter.java
@@ -1,4 +1,4 @@
-/* Copyright 2012--2016 The Tor Project
+/* Copyright 2012--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.writer;
diff --git a/src/main/resources/bootstrap-development.sh b/src/main/resources/bootstrap-development.sh
index 33a1a50..28fb975 100755
--- a/src/main/resources/bootstrap-development.sh
+++ b/src/main/resources/bootstrap-development.sh
@@ -1,6 +1,6 @@
#!/bin/sh
#
-# Copyright 2016 The Tor Project
+# Copyright 2016--2017 The Tor Project
# See LICENSE for licensing information
#
# Use for submodule initialization and checkout.
diff --git a/src/test/java/org/torproject/onionoo/docs/BandwidthStatusTest.java b/src/test/java/org/torproject/onionoo/docs/BandwidthStatusTest.java
index 84bd116..e327b64 100644
--- a/src/test/java/org/torproject/onionoo/docs/BandwidthStatusTest.java
+++ b/src/test/java/org/torproject/onionoo/docs/BandwidthStatusTest.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/test/java/org/torproject/onionoo/docs/DummyDocumentStore.java b/src/test/java/org/torproject/onionoo/docs/DummyDocumentStore.java
index bf4acb0..3c80cfa 100644
--- a/src/test/java/org/torproject/onionoo/docs/DummyDocumentStore.java
+++ b/src/test/java/org/torproject/onionoo/docs/DummyDocumentStore.java
@@ -1,4 +1,4 @@
-/* Copyright 2015--2016 The Tor Project
+/* Copyright 2015--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/test/java/org/torproject/onionoo/docs/NodeStatusTest.java b/src/test/java/org/torproject/onionoo/docs/NodeStatusTest.java
index f00ce0a..2e7c3a3 100644
--- a/src/test/java/org/torproject/onionoo/docs/NodeStatusTest.java
+++ b/src/test/java/org/torproject/onionoo/docs/NodeStatusTest.java
@@ -1,4 +1,4 @@
-/* Copyright 2015--2016 The Tor Project
+/* Copyright 2015--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/test/java/org/torproject/onionoo/docs/SummaryDocumentTest.java b/src/test/java/org/torproject/onionoo/docs/SummaryDocumentTest.java
index 1ee150f..359fa03 100644
--- a/src/test/java/org/torproject/onionoo/docs/SummaryDocumentTest.java
+++ b/src/test/java/org/torproject/onionoo/docs/SummaryDocumentTest.java
@@ -1,4 +1,4 @@
-/* Copyright 2015--2016 The Tor Project
+/* Copyright 2015--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/test/java/org/torproject/onionoo/docs/UptimeStatusTest.java b/src/test/java/org/torproject/onionoo/docs/UptimeStatusTest.java
index 1a8066d..b5fa157 100644
--- a/src/test/java/org/torproject/onionoo/docs/UptimeStatusTest.java
+++ b/src/test/java/org/torproject/onionoo/docs/UptimeStatusTest.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/test/java/org/torproject/onionoo/docs/WeightsStatusTest.java b/src/test/java/org/torproject/onionoo/docs/WeightsStatusTest.java
index 3dc82f8..b4a06d7 100644
--- a/src/test/java/org/torproject/onionoo/docs/WeightsStatusTest.java
+++ b/src/test/java/org/torproject/onionoo/docs/WeightsStatusTest.java
@@ -1,4 +1,4 @@
-/* Copyright 2016 The Tor Project
+/* Copyright 2016--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.docs;
diff --git a/src/test/java/org/torproject/onionoo/server/PerformanceMetricsTest.java b/src/test/java/org/torproject/onionoo/server/PerformanceMetricsTest.java
index c2c781b..f804409 100644
--- a/src/test/java/org/torproject/onionoo/server/PerformanceMetricsTest.java
+++ b/src/test/java/org/torproject/onionoo/server/PerformanceMetricsTest.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
index 93c3a34..9d47bd2 100644
--- a/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
+++ b/src/test/java/org/torproject/onionoo/server/ResourceServletTest.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.server;
diff --git a/src/test/java/org/torproject/onionoo/updater/DummyBridgeStatus.java b/src/test/java/org/torproject/onionoo/updater/DummyBridgeStatus.java
index 1e6990f..46f6371 100644
--- a/src/test/java/org/torproject/onionoo/updater/DummyBridgeStatus.java
+++ b/src/test/java/org/torproject/onionoo/updater/DummyBridgeStatus.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/test/java/org/torproject/onionoo/updater/DummyConsensus.java b/src/test/java/org/torproject/onionoo/updater/DummyConsensus.java
index 246916e..54d0161 100644
--- a/src/test/java/org/torproject/onionoo/updater/DummyConsensus.java
+++ b/src/test/java/org/torproject/onionoo/updater/DummyConsensus.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java b/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java
index 878ef43..990b011 100644
--- a/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java
+++ b/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/test/java/org/torproject/onionoo/updater/DummyStatusEntry.java b/src/test/java/org/torproject/onionoo/updater/DummyStatusEntry.java
index c60bded..da583b8 100644
--- a/src/test/java/org/torproject/onionoo/updater/DummyStatusEntry.java
+++ b/src/test/java/org/torproject/onionoo/updater/DummyStatusEntry.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/test/java/org/torproject/onionoo/updater/LookupServiceTest.java b/src/test/java/org/torproject/onionoo/updater/LookupServiceTest.java
index 7793e56..bcd8571 100644
--- a/src/test/java/org/torproject/onionoo/updater/LookupServiceTest.java
+++ b/src/test/java/org/torproject/onionoo/updater/LookupServiceTest.java
@@ -1,4 +1,4 @@
-/* Copyright 2013--2016 The Tor Project
+/* Copyright 2013--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/test/java/org/torproject/onionoo/updater/UptimeStatusUpdaterTest.java b/src/test/java/org/torproject/onionoo/updater/UptimeStatusUpdaterTest.java
index 37a1b8e..d890e2c 100644
--- a/src/test/java/org/torproject/onionoo/updater/UptimeStatusUpdaterTest.java
+++ b/src/test/java/org/torproject/onionoo/updater/UptimeStatusUpdaterTest.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.updater;
diff --git a/src/test/java/org/torproject/onionoo/util/DummyTime.java b/src/test/java/org/torproject/onionoo/util/DummyTime.java
index eacc200..54b419d 100644
--- a/src/test/java/org/torproject/onionoo/util/DummyTime.java
+++ b/src/test/java/org/torproject/onionoo/util/DummyTime.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.util;
diff --git a/src/test/java/org/torproject/onionoo/writer/UptimeDocumentWriterTest.java b/src/test/java/org/torproject/onionoo/writer/UptimeDocumentWriterTest.java
index 3661010..0c19a04 100644
--- a/src/test/java/org/torproject/onionoo/writer/UptimeDocumentWriterTest.java
+++ b/src/test/java/org/torproject/onionoo/writer/UptimeDocumentWriterTest.java
@@ -1,4 +1,4 @@
-/* Copyright 2014--2016 The Tor Project
+/* Copyright 2014--2017 The Tor Project
* See LICENSE for licensing information */
package org.torproject.onionoo.writer;
1
0