tor-commits
Threads by month
- ----- 2025 -----
- 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
August 2018
- 17 participants
- 2581 discussions

[metrics-lib/master] Use Map.putIfAbsent and Map.getOrDefault where possible.
by karsten@torproject.org 27 Aug '18
by karsten@torproject.org 27 Aug '18
27 Aug '18
commit 7c26323811d733643f9042611c55cdaeec4e3cc4
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Tue Aug 21 15:05:26 2018 +0200
Use Map.putIfAbsent and Map.getOrDefault where possible.
---
.../org/torproject/descriptor/impl/DescriptorImpl.java | 17 +++++------------
.../descriptor/impl/DescriptorReaderImpl.java | 3 +--
.../descriptor/impl/NetworkStatusEntryImpl.java | 4 +---
3 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/src/main/java/org/torproject/descriptor/impl/DescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/DescriptorImpl.java
index 1ae85d6..b6dbf74 100644
--- a/src/main/java/org/torproject/descriptor/impl/DescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/DescriptorImpl.java
@@ -279,11 +279,7 @@ public abstract class DescriptorImpl implements Descriptor {
this.firstKey = key;
}
lastKey = key;
- if (parsedKeys.containsKey(key)) {
- parsedKeys.put(key, parsedKeys.get(key) + 1);
- } else {
- parsedKeys.put(key, 1);
- }
+ parsedKeys.put(key, parsedKeys.getOrDefault(key, 0) + 1);
}
}
}
@@ -307,10 +303,7 @@ public abstract class DescriptorImpl implements Descriptor {
protected void checkExactlyOnceKeys(Set<Key> keys)
throws DescriptorParseException {
for (Key key : keys) {
- int contained = 0;
- if (this.parsedKeys.containsKey(key)) {
- contained = this.parsedKeys.get(key);
- }
+ int contained = this.parsedKeys.getOrDefault(key, 0);
if (contained != 1) {
throw new DescriptorParseException("Keyword '" + key.keyword + "' is "
+ "contained " + contained + " times, but must be contained "
@@ -332,10 +325,10 @@ public abstract class DescriptorImpl implements Descriptor {
protected void checkAtMostOnceKeys(Set<Key> keys)
throws DescriptorParseException {
for (Key key : keys) {
- if (this.parsedKeys.containsKey(key)
- && this.parsedKeys.get(key) > 1) {
+ int contained = this.parsedKeys.getOrDefault(key, 0);
+ if (contained > 1) {
throw new DescriptorParseException("Keyword '" + key.keyword + "' is "
- + "contained " + this.parsedKeys.get(key) + " times, "
+ + "contained " + contained + " times, "
+ "but must be contained at most once.");
}
}
diff --git a/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java b/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
index bbe467e..b8eb191 100644
--- a/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
@@ -229,8 +229,7 @@ public class DescriptorReaderImpl implements DescriptorReader {
try {
String absolutePath = file.getAbsolutePath();
long lastModifiedMillis = file.lastModified();
- if (this.excludedFilesBefore.containsKey(absolutePath)
- && this.excludedFilesBefore.get(absolutePath)
+ if (this.excludedFilesBefore.getOrDefault(absolutePath, 0L)
== lastModifiedMillis) {
this.excludedFilesAfter.put(absolutePath, lastModifiedMillis);
continue;
diff --git a/src/main/java/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java b/src/main/java/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java
index 9ebedbd..2ddaaa0 100644
--- a/src/main/java/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java
@@ -217,9 +217,7 @@ public class NetworkStatusEntryImpl implements NetworkStatusEntry {
if (pairs.containsKey("Unmeasured")) {
this.unmeasured = pairs.remove("Unmeasured") == 1L;
}
- if (!pairs.isEmpty()) {
- /* Ignore unknown key-value pair. */
- }
+ /* Ignore unknown key-value pair. */
}
private void parsePLine(String line, String[] parts)
1
0

27 Aug '18
commit 25998e1539c42d0628d799678af7f339dfdb190b
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Tue Aug 21 11:47:45 2018 +0200
Remove unnecessary return statements.
---
.../java/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java | 1 -
.../java/org/torproject/descriptor/impl/DescriptorReaderImpl.java | 1 -
.../java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java | 1 -
src/main/java/org/torproject/descriptor/impl/MicrodescriptorImpl.java | 1 -
.../java/org/torproject/descriptor/impl/ServerDescriptorImpl.java | 1 -
.../java/org/torproject/descriptor/DescriptorSourceFactoryTest.java | 4 +---
6 files changed, 1 insertion(+), 8 deletions(-)
diff --git a/src/main/java/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java b/src/main/java/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java
index 58fc872..80e126d 100644
--- a/src/main/java/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/BridgePoolAssignmentImpl.java
@@ -23,7 +23,6 @@ public class BridgePoolAssignmentImpl extends DescriptorImpl
this.checkExactlyOnceKeys(EnumSet.of(Key.BRIDGE_POOL_ASSIGNMENT));
this.checkFirstKey(Key.BRIDGE_POOL_ASSIGNMENT);
this.clearParsedKeys();
- return;
}
private void parseDescriptorBytes() throws DescriptorParseException {
diff --git a/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java b/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
index 46d17ef..bbe467e 100644
--- a/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/DescriptorReaderImpl.java
@@ -187,7 +187,6 @@ public class DescriptorReaderImpl implements DescriptorReader {
}
} catch (IOException | NumberFormatException e) {
log.warn("Trouble reading given history file {}.", historyFile, e);
- return;
}
}
diff --git a/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
index 7590d47..7053ced 100644
--- a/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
@@ -70,7 +70,6 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.checkKeysDependOn(bridgeStatsKeys, Key.BRIDGE_STATS_END);
this.checkFirstKey(Key.EXTRA_INFO);
this.clearParsedKeys();
- return;
}
private void parseDescriptorBytes() throws DescriptorParseException {
diff --git a/src/main/java/org/torproject/descriptor/impl/MicrodescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/MicrodescriptorImpl.java
index 44c25a2..dc9795c 100644
--- a/src/main/java/org/torproject/descriptor/impl/MicrodescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/MicrodescriptorImpl.java
@@ -30,7 +30,6 @@ public class MicrodescriptorImpl extends DescriptorImpl
this.checkAtMostOnceKeys(atMostOnceKeys);
this.checkFirstKey(Key.ONION_KEY);
this.clearParsedKeys();
- return;
}
private void parseDescriptorBytes() throws DescriptorParseException {
diff --git a/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java
index c06fb6e..3df90cc 100644
--- a/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java
@@ -49,7 +49,6 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
+ "'reject' must be contained at least once.");
}
this.clearParsedKeys();
- return;
}
private void parseDescriptorBytes() throws DescriptorParseException {
diff --git a/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java b/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java
index d9549e5..de906db 100644
--- a/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java
+++ b/src/test/java/org/torproject/descriptor/DescriptorSourceFactoryTest.java
@@ -64,9 +64,7 @@ public class DescriptorSourceFactoryTest {
retrieve.setAccessible(true);
retrieve.invoke(null, "unknown.property");
} catch (InvocationTargetException ite) {
- if (ite.getCause() instanceof RuntimeException) {
- return;
- } else {
+ if (!(ite.getCause() instanceof RuntimeException)) {
fail("Cause was " + ite.getCause()
+ ", but expected InvocationTargetException.");
}
1
0
commit c9dae3850634017ecf06aaddb2638a70b866b6bc
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Tue Aug 21 12:20:23 2018 +0200
Simplify a test case.
---
.../java/org/torproject/descriptor/log/LogDescriptorTest.java | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/test/java/org/torproject/descriptor/log/LogDescriptorTest.java b/src/test/java/org/torproject/descriptor/log/LogDescriptorTest.java
index 2e13a52..609f6e5 100644
--- a/src/test/java/org/torproject/descriptor/log/LogDescriptorTest.java
+++ b/src/test/java/org/torproject/descriptor/log/LogDescriptorTest.java
@@ -32,7 +32,6 @@ import java.nio.file.Files;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Iterator;
import java.util.List;
@RunWith(Parameterized.class)
@@ -104,11 +103,9 @@ public class LogDescriptorTest {
@Before
public void readAll() throws IOException {
createTemporaryFolderAndContents();
- Iterator<Descriptor> descs = this.reader
- .readDescriptors(this.indir).iterator();
- while (descs.hasNext()) {
- descs.next();
- }
+ this.reader.readDescriptors(this.indir).forEach(descriptor -> {
+ /* Nothing to do with read descriptors. */
+ });
}
protected List<Descriptor> retrieve() throws Exception {
1
0

27 Aug '18
commit a1b07be29685426e13911771b45210f0f6ae33e0
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Tue Aug 21 12:07:50 2018 +0200
Remove redundant string operation.
---
src/main/java/org/torproject/descriptor/impl/RelayDirectoryImpl.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/main/java/org/torproject/descriptor/impl/RelayDirectoryImpl.java b/src/main/java/org/torproject/descriptor/impl/RelayDirectoryImpl.java
index 5eb5b6f..6370e87 100644
--- a/src/main/java/org/torproject/descriptor/impl/RelayDirectoryImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/RelayDirectoryImpl.java
@@ -264,7 +264,7 @@ public class RelayDirectoryImpl extends DescriptorImpl
sb.append("-----BEGIN RSA PUBLIC KEY-----\n");
String keyString = partsNoOpt[1];
while (keyString.length() > 64) {
- sb.append(keyString.substring(0, 64)).append(NL);
+ sb.append(keyString, 0, 64).append(NL);
keyString = keyString.substring(64);
}
if (keyString.length() > 0) {
1
0

27 Aug '18
commit 4a1c02c61a9853fc93a087f51cbf020fe315447c
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Tue Aug 21 14:10:29 2018 +0200
Inline redundant local variables.
---
src/main/java/org/torproject/descriptor/impl/ParseHelper.java | 4 +---
.../descriptor/impl/RelayNetworkStatusConsensusImplTest.java | 9 +++------
2 files changed, 4 insertions(+), 9 deletions(-)
diff --git a/src/main/java/org/torproject/descriptor/impl/ParseHelper.java b/src/main/java/org/torproject/descriptor/impl/ParseHelper.java
index 514bea8..dcb365e 100644
--- a/src/main/java/org/torproject/descriptor/impl/ParseHelper.java
+++ b/src/main/java/org/torproject/descriptor/impl/ParseHelper.java
@@ -477,9 +477,7 @@ public class ParseHelper {
masterKeyEd25519, 0, masterKeyEd25519.length);
String masterKeyEd25519Base64
= Base64.encodeBase64String(masterKeyEd25519).replaceAll("=", "");
- String masterKeyEd25519Base64NoTrailingEqualSigns =
- masterKeyEd25519Base64.replaceAll("=", "");
- return masterKeyEd25519Base64NoTrailingEqualSigns;
+ return masterKeyEd25519Base64.replaceAll("=", "");
}
extensionStart += 4 + extensionLength;
}
diff --git a/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java b/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java
index 53d79c7..b4c7d8a 100644
--- a/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java
+++ b/src/test/java/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImplTest.java
@@ -141,9 +141,8 @@ public class RelayNetworkStatusConsensusImplTest {
sb.append(this.voteDigestLine).append("\n");
}
String dirSourceWithTrailingNewLine = sb.toString();
- String dirSource = dirSourceWithTrailingNewLine.substring(0,
+ return dirSourceWithTrailingNewLine.substring(0,
dirSourceWithTrailingNewLine.length() - 1);
- return dirSource;
}
}
@@ -299,9 +298,8 @@ public class RelayNetworkStatusConsensusImplTest {
sb.append(this.pLine).append("\n");
}
String statusEntryWithTrailingNewLine = sb.toString();
- String statusEntry = statusEntryWithTrailingNewLine.substring(0,
+ return statusEntryWithTrailingNewLine.substring(0,
statusEntryWithTrailingNewLine.length() - 1);
- return statusEntry;
}
}
@@ -339,7 +337,7 @@ public class RelayNetworkStatusConsensusImplTest {
}
private String buildDirectorySignature() {
- String directorySignature = "directory-signature " + identity + " "
+ return "directory-signature " + identity + " "
+ signingKey + "\n"
+ "-----BEGIN SIGNATURE-----\n"
+ "gE64+/4BH43v1+7jS9FK1tu2+94at8xhVSPn4O/PpOx7b0Yb+S1hac1QHAiS"
@@ -348,7 +346,6 @@ public class RelayNetworkStatusConsensusImplTest {
+ "P3JG\n"
+ "z89A+wrsN17I5490y66AEvws54BYZMbgRfp8HXn/0Ss=\n"
+ "-----END SIGNATURE-----";
- return directorySignature;
}
}
1
0
commit 0cb2f05ba4ee2d6cb4699739163200997232c8c9
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Tue Aug 21 12:22:41 2018 +0200
Replace if with switch.
---
.../torproject/descriptor/impl/TorperfResultImpl.java | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/src/main/java/org/torproject/descriptor/impl/TorperfResultImpl.java b/src/main/java/org/torproject/descriptor/impl/TorperfResultImpl.java
index 47de53f..4eb00ac 100644
--- a/src/main/java/org/torproject/descriptor/impl/TorperfResultImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/TorperfResultImpl.java
@@ -286,13 +286,16 @@ public class TorperfResultImpl extends DescriptorImpl
private void parseDidTimeout(String value, String keyValue, String line)
throws DescriptorParseException {
- if (value.equals("1")) {
- this.didTimeout = true;
- } else if (value.equals("0")) {
- this.didTimeout = false;
- } else {
- throw new DescriptorParseException("Illegal value in '" + keyValue
- + "' in line '" + line + "'.");
+ switch (value) {
+ case "1":
+ this.didTimeout = true;
+ break;
+ case "0":
+ this.didTimeout = false;
+ break;
+ default:
+ throw new DescriptorParseException("Illegal value in '" + keyValue
+ + "' in line '" + line + "'.");
}
}
1
0

[metrics-lib/master] Remove redundant modifiers from interface methods.
by karsten@torproject.org 27 Aug '18
by karsten@torproject.org 27 Aug '18
27 Aug '18
commit d9f295ecfbceb73c50dc07ea89528bcc4b3fbd7b
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Mon Aug 20 11:19:37 2018 +0200
Remove redundant modifiers from interface methods.
---
.../torproject/descriptor/BandwidthHistory.java | 8 +-
.../torproject/descriptor/BridgeNetworkStatus.java | 22 ++--
.../descriptor/BridgePoolAssignment.java | 4 +-
.../java/org/torproject/descriptor/Descriptor.java | 10 +-
.../torproject/descriptor/DescriptorCollector.java | 2 +-
.../torproject/descriptor/DescriptorParser.java | 2 +-
.../torproject/descriptor/DescriptorReader.java | 14 +--
.../org/torproject/descriptor/DirSourceEntry.java | 20 ++--
.../descriptor/DirectoryKeyCertificate.java | 22 ++--
.../torproject/descriptor/DirectorySignature.java | 8 +-
.../java/org/torproject/descriptor/ExitList.java | 16 +--
.../torproject/descriptor/ExtraInfoDescriptor.java | 132 ++++++++++-----------
.../org/torproject/descriptor/LogDescriptor.java | 14 +--
.../org/torproject/descriptor/Microdescriptor.java | 22 ++--
.../torproject/descriptor/NetworkStatusEntry.java | 38 +++---
.../org/torproject/descriptor/RelayDirectory.java | 18 +--
.../torproject/descriptor/RelayNetworkStatus.java | 34 +++---
.../descriptor/RelayNetworkStatusConsensus.java | 56 ++++-----
.../descriptor/RelayNetworkStatusVote.java | 104 ++++++++--------
.../torproject/descriptor/RouterStatusEntry.java | 8 +-
.../torproject/descriptor/ServerDescriptor.java | 88 +++++++-------
.../org/torproject/descriptor/TorperfResult.java | 60 +++++-----
.../descriptor/UnparseableDescriptor.java | 6 +-
.../torproject/descriptor/WebServerAccessLog.java | 28 ++---
.../descriptor/log/InternalWebServerAccessLog.java | 2 +-
25 files changed, 369 insertions(+), 369 deletions(-)
diff --git a/src/main/java/org/torproject/descriptor/BandwidthHistory.java b/src/main/java/org/torproject/descriptor/BandwidthHistory.java
index cc1e58f..0389fe9 100644
--- a/src/main/java/org/torproject/descriptor/BandwidthHistory.java
+++ b/src/main/java/org/torproject/descriptor/BandwidthHistory.java
@@ -22,7 +22,7 @@ public interface BandwidthHistory {
*
* @since 1.0.0
*/
- public String getLine();
+ String getLine();
/**
* Return the time in milliseconds since the epoch when the most recent
@@ -30,14 +30,14 @@ public interface BandwidthHistory {
*
* @since 1.0.0
*/
- public long getHistoryEndMillis();
+ long getHistoryEndMillis();
/**
* Return the interval length in seconds.
*
* @since 1.0.0
*/
- public long getIntervalLength();
+ long getIntervalLength();
/**
* Return the (possibly empty) bandwidth history with map keys being
@@ -47,6 +47,6 @@ public interface BandwidthHistory {
*
* @since 1.0.0
*/
- public SortedMap<Long, Long> getBandwidthValues();
+ SortedMap<Long, Long> getBandwidthValues();
}
diff --git a/src/main/java/org/torproject/descriptor/BridgeNetworkStatus.java b/src/main/java/org/torproject/descriptor/BridgeNetworkStatus.java
index 62f9edf..8afb827 100644
--- a/src/main/java/org/torproject/descriptor/BridgeNetworkStatus.java
+++ b/src/main/java/org/torproject/descriptor/BridgeNetworkStatus.java
@@ -31,7 +31,7 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public long getPublishedMillis();
+ long getPublishedMillis();
/**
* Return the minimum uptime in seconds that this authority requires
@@ -40,7 +40,7 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.1.0
*/
- public long getStableUptime();
+ long getStableUptime();
/**
* Return the minimum MTBF (mean time between failure) that this
@@ -49,7 +49,7 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.1.0
*/
- public long getStableMtbf();
+ long getStableMtbf();
/**
* Return the minimum bandwidth that this authority requires for
@@ -58,7 +58,7 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.1.0
*/
- public long getFastBandwidth();
+ long getFastBandwidth();
/**
* Return the minimum WFU (weighted fractional uptime) in percent that
@@ -67,7 +67,7 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.1.0
*/
- public double getGuardWfu();
+ double getGuardWfu();
/**
* Return the minimum weighted time in seconds that this authority
@@ -76,7 +76,7 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.1.0
*/
- public long getGuardTk();
+ long getGuardTk();
/**
* Return the minimum bandwidth that this authority requires for
@@ -85,7 +85,7 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.1.0
*/
- public long getGuardBandwidthIncludingExits();
+ long getGuardBandwidthIncludingExits();
/**
* Return the minimum bandwidth that this authority requires for
@@ -94,7 +94,7 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.1.0
*/
- public long getGuardBandwidthExcludingExits();
+ long getGuardBandwidthExcludingExits();
/**
* Return 1 if the authority has measured enough MTBF info to use the
@@ -104,7 +104,7 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.1.0
*/
- public int getEnoughMtbfInfo();
+ int getEnoughMtbfInfo();
/**
* Return 1 if the authority has enough measured bandwidths that it'll
@@ -114,7 +114,7 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.1.0
*/
- public int getIgnoringAdvertisedBws();
+ int getIgnoringAdvertisedBws();
/**
* Return status entries for each contained bridge, with map keys being
@@ -123,6 +123,6 @@ public interface BridgeNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, NetworkStatusEntry> getStatusEntries();
+ SortedMap<String, NetworkStatusEntry> getStatusEntries();
}
diff --git a/src/main/java/org/torproject/descriptor/BridgePoolAssignment.java b/src/main/java/org/torproject/descriptor/BridgePoolAssignment.java
index 4d15b81..f42ea15 100644
--- a/src/main/java/org/torproject/descriptor/BridgePoolAssignment.java
+++ b/src/main/java/org/torproject/descriptor/BridgePoolAssignment.java
@@ -31,7 +31,7 @@ public interface BridgePoolAssignment extends Descriptor {
*
* @since 1.0.0
*/
- public long getPublishedMillis();
+ long getPublishedMillis();
/**
* Return the entries contained in this bridge pool assignment list
@@ -42,6 +42,6 @@ public interface BridgePoolAssignment extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, String> getEntries();
+ SortedMap<String, String> getEntries();
}
diff --git a/src/main/java/org/torproject/descriptor/Descriptor.java b/src/main/java/org/torproject/descriptor/Descriptor.java
index da51ce2..d745dce 100644
--- a/src/main/java/org/torproject/descriptor/Descriptor.java
+++ b/src/main/java/org/torproject/descriptor/Descriptor.java
@@ -24,7 +24,7 @@ public interface Descriptor {
*
* @since 1.0.0
*/
- public byte[] getRawDescriptorBytes();
+ byte[] getRawDescriptorBytes();
/**
* Return the raw descriptor length in bytes.
@@ -34,7 +34,7 @@ public interface Descriptor {
*
* @since 1.9.0
*/
- public int getRawDescriptorLength();
+ int getRawDescriptorLength();
/**
* Return the (possibly empty) list of annotations in the format
@@ -46,7 +46,7 @@ public interface Descriptor {
*
* @since 1.0.0
*/
- public List<String> getAnnotations();
+ List<String> getAnnotations();
/**
* Return any unrecognized lines when parsing this descriptor, or an
@@ -58,7 +58,7 @@ public interface Descriptor {
*
* @since 1.0.0
*/
- public List<String> getUnrecognizedLines();
+ List<String> getUnrecognizedLines();
/**
* Return the file, tarball or plain file, that contained this descriptor, or
@@ -68,6 +68,6 @@ public interface Descriptor {
*
* @since 1.9.0
*/
- public File getDescriptorFile();
+ File getDescriptorFile();
}
diff --git a/src/main/java/org/torproject/descriptor/DescriptorCollector.java b/src/main/java/org/torproject/descriptor/DescriptorCollector.java
index f27d8fc..823a62d 100644
--- a/src/main/java/org/torproject/descriptor/DescriptorCollector.java
+++ b/src/main/java/org/torproject/descriptor/DescriptorCollector.java
@@ -57,7 +57,7 @@ public interface DescriptorCollector {
*
* @since 1.0.0
*/
- public void collectDescriptors(String collecTorBaseUrl,
+ void collectDescriptors(String collecTorBaseUrl,
String[] remoteDirectories, long minLastModified,
File localDirectory, boolean deleteExtraneousLocalFiles);
}
diff --git a/src/main/java/org/torproject/descriptor/DescriptorParser.java b/src/main/java/org/torproject/descriptor/DescriptorParser.java
index 064e3ab..159af8d 100644
--- a/src/main/java/org/torproject/descriptor/DescriptorParser.java
+++ b/src/main/java/org/torproject/descriptor/DescriptorParser.java
@@ -38,6 +38,6 @@ public interface DescriptorParser {
*
* @since 1.9.0
*/
- public Iterable<Descriptor> parseDescriptors(byte[] rawDescriptorBytes,
+ Iterable<Descriptor> parseDescriptors(byte[] rawDescriptorBytes,
File sourceFile, String fileName);
}
diff --git a/src/main/java/org/torproject/descriptor/DescriptorReader.java b/src/main/java/org/torproject/descriptor/DescriptorReader.java
index d41e6b4..7eab1e6 100644
--- a/src/main/java/org/torproject/descriptor/DescriptorReader.java
+++ b/src/main/java/org/torproject/descriptor/DescriptorReader.java
@@ -46,7 +46,7 @@ public interface DescriptorReader {
*
* @since 1.6.0
*/
- public void setHistoryFile(File historyFile);
+ void setHistoryFile(File historyFile);
/**
* Save a history file with file names and last modified timestamps of
@@ -59,7 +59,7 @@ public interface DescriptorReader {
*
* @since 1.6.0
*/
- public void saveHistoryFile(File historyFile);
+ void saveHistoryFile(File historyFile);
/**
* Exclude files if they haven't changed since the corresponding last
@@ -69,7 +69,7 @@ public interface DescriptorReader {
*
* @since 1.0.0
*/
- public void setExcludedFiles(SortedMap<String, Long> excludedFiles);
+ void setExcludedFiles(SortedMap<String, Long> excludedFiles);
/**
* Return files and last modified timestamps of files that exist in the
@@ -81,7 +81,7 @@ public interface DescriptorReader {
*
* @since 1.0.0
*/
- public SortedMap<String, Long> getExcludedFiles();
+ SortedMap<String, Long> getExcludedFiles();
/**
* Return files and last modified timestamps of files that exist in the
@@ -92,7 +92,7 @@ public interface DescriptorReader {
*
* @since 1.0.0
*/
- public SortedMap<String, Long> getParsedFiles();
+ SortedMap<String, Long> getParsedFiles();
/**
* Don't keep more than this number of descriptors in the queue (default:
@@ -102,7 +102,7 @@ public interface DescriptorReader {
*
* @since 1.9.0
*/
- public void setMaxDescriptorsInQueue(int maxDescriptorsInQueue);
+ void setMaxDescriptorsInQueue(int maxDescriptorsInQueue);
/**
* Read descriptors from the given descriptor file(s) and return the parsed
@@ -119,6 +119,6 @@ public interface DescriptorReader {
*
* @since 1.9.0
*/
- public Iterable<Descriptor> readDescriptors(File... descriptorFiles);
+ Iterable<Descriptor> readDescriptors(File... descriptorFiles);
}
diff --git a/src/main/java/org/torproject/descriptor/DirSourceEntry.java b/src/main/java/org/torproject/descriptor/DirSourceEntry.java
index 7540c2c..41f5c05 100644
--- a/src/main/java/org/torproject/descriptor/DirSourceEntry.java
+++ b/src/main/java/org/torproject/descriptor/DirSourceEntry.java
@@ -20,7 +20,7 @@ public interface DirSourceEntry {
*
* @since 1.0.0
*/
- public byte[] getDirSourceEntryBytes();
+ byte[] getDirSourceEntryBytes();
/**
* Return the authority's nickname consisting of 1 to 19 alphanumeric
@@ -28,7 +28,7 @@ public interface DirSourceEntry {
*
* @since 1.0.0
*/
- public String getNickname();
+ String getNickname();
/**
* Return a SHA-1 digest of the authority's long-term authority
@@ -37,21 +37,21 @@ public interface DirSourceEntry {
*
* @since 1.0.0
*/
- public String getIdentity();
+ String getIdentity();
/**
* Return the authority's hostname.
*
* @since 1.2.0
*/
- public String getHostname();
+ String getHostname();
/**
* Return the authority's primary IPv4 address in dotted-quad format.
*
* @since 1.0.0
*/
- public String getIp();
+ String getIp();
/**
* Return the TCP port where this authority accepts directory-related
@@ -59,7 +59,7 @@ public interface DirSourceEntry {
*
* @since 1.0.0
*/
- public int getDirPort();
+ int getDirPort();
/**
* Return the TCP port where this authority accepts TLS connections for
@@ -67,7 +67,7 @@ public interface DirSourceEntry {
*
* @since 1.0.0
*/
- public int getOrPort();
+ int getOrPort();
/**
* Return whether this directory source entry was created using a
@@ -75,7 +75,7 @@ public interface DirSourceEntry {
*
* @since 1.0.0
*/
- public boolean isLegacy();
+ boolean isLegacy();
/**
* Return the contact information for this authority, which may contain
@@ -83,7 +83,7 @@ public interface DirSourceEntry {
*
* @since 1.0.0
*/
- public String getContactLine();
+ String getContactLine();
/**
* Return the SHA-1 vote digest, encoded as 40 lower-case hexadecimal
@@ -91,6 +91,6 @@ public interface DirSourceEntry {
*
* @since 1.7.0
*/
- public String getVoteDigestSha1Hex();
+ String getVoteDigestSha1Hex();
}
diff --git a/src/main/java/org/torproject/descriptor/DirectoryKeyCertificate.java b/src/main/java/org/torproject/descriptor/DirectoryKeyCertificate.java
index 6a02ac3..3b44f9f 100644
--- a/src/main/java/org/torproject/descriptor/DirectoryKeyCertificate.java
+++ b/src/main/java/org/torproject/descriptor/DirectoryKeyCertificate.java
@@ -23,7 +23,7 @@ public interface DirectoryKeyCertificate extends Descriptor {
*
* @since 1.0.0
*/
- public int getDirKeyCertificateVersion();
+ int getDirKeyCertificateVersion();
/**
* Return the authority's primary IPv4 address in dotted-quad format,
@@ -31,7 +31,7 @@ public interface DirectoryKeyCertificate extends Descriptor {
*
* @since 1.0.0
*/
- public String getAddress();
+ String getAddress();
/**
* Return the TCP port where this authority accepts directory-related
@@ -39,7 +39,7 @@ public interface DirectoryKeyCertificate extends Descriptor {
*
* @since 1.0.0
*/
- public int getPort();
+ int getPort();
/**
* Return a SHA-1 digest of the authority's long-term authority
@@ -48,14 +48,14 @@ public interface DirectoryKeyCertificate extends Descriptor {
*
* @since 1.0.0
*/
- public String getFingerprint();
+ String getFingerprint();
/**
* Return the authority's identity key in PEM format.
*
* @since 1.0.0
*/
- public String getDirIdentityKey();
+ String getDirIdentityKey();
/**
* Return the time in milliseconds since the epoch when the authority's
@@ -63,7 +63,7 @@ public interface DirectoryKeyCertificate extends Descriptor {
*
* @since 1.0.0
*/
- public long getDirKeyPublishedMillis();
+ long getDirKeyPublishedMillis();
/**
* Return the time in milliseconds since the epoch after which the
@@ -71,14 +71,14 @@ public interface DirectoryKeyCertificate extends Descriptor {
*
* @since 1.0.0
*/
- public long getDirKeyExpiresMillis();
+ long getDirKeyExpiresMillis();
/**
* Return the authority's signing key in PEM format.
*
* @since 1.0.0
*/
- public String getDirSigningKey();
+ String getDirSigningKey();
/**
* Return the signature of the authority's identity key made using the
@@ -87,7 +87,7 @@ public interface DirectoryKeyCertificate extends Descriptor {
*
* @since 1.0.0
*/
- public String getDirKeyCrosscert();
+ String getDirKeyCrosscert();
/**
* Return the certificate signature from the initial item
@@ -96,7 +96,7 @@ public interface DirectoryKeyCertificate extends Descriptor {
*
* @since 1.0.0
*/
- public String getDirKeyCertification();
+ String getDirKeyCertification();
/**
* Return the SHA-1 certificate digest, encoded as 40 lower-case
@@ -104,6 +104,6 @@ public interface DirectoryKeyCertificate extends Descriptor {
*
* @since 1.7.0
*/
- public String getDigestSha1Hex();
+ String getDigestSha1Hex();
}
diff --git a/src/main/java/org/torproject/descriptor/DirectorySignature.java b/src/main/java/org/torproject/descriptor/DirectorySignature.java
index fb66faa..2522fd7 100644
--- a/src/main/java/org/torproject/descriptor/DirectorySignature.java
+++ b/src/main/java/org/torproject/descriptor/DirectorySignature.java
@@ -21,7 +21,7 @@ public interface DirectorySignature {
*
* @since 1.0.0
*/
- public String getAlgorithm();
+ String getAlgorithm();
/**
* Return the SHA-1 digest of the authority's long-term identity key in
@@ -30,7 +30,7 @@ public interface DirectorySignature {
*
* @since 1.0.0
*/
- public String getIdentity();
+ String getIdentity();
/**
* Return the SHA-1 digest of the authority's medium-term signing key
@@ -39,7 +39,7 @@ public interface DirectorySignature {
*
* @since 1.7.0
*/
- public String getSigningKeyDigestSha1Hex();
+ String getSigningKeyDigestSha1Hex();
/**
* Return the directory signature string made with the authority's
@@ -47,6 +47,6 @@ public interface DirectorySignature {
*
* @since 1.0.0
*/
- public String getSignature();
+ String getSignature();
}
diff --git a/src/main/java/org/torproject/descriptor/ExitList.java b/src/main/java/org/torproject/descriptor/ExitList.java
index e549da8..a631f3c 100644
--- a/src/main/java/org/torproject/descriptor/ExitList.java
+++ b/src/main/java/org/torproject/descriptor/ExitList.java
@@ -19,14 +19,14 @@ public interface ExitList extends Descriptor {
*
* @since 1.0.0
*/
- public static final String EOL = "\n";
+ String EOL = "\n";
/**
* Exit list entry containing results from a single exit scan.
*
* @since 1.1.0
*/
- public interface Entry {
+ interface Entry {
/**
* Return the scanned relay's fingerprint, which is a SHA-1 digest of
@@ -35,7 +35,7 @@ public interface ExitList extends Descriptor {
*
* @since 1.1.0
*/
- public String getFingerprint();
+ String getFingerprint();
/**
* Return the time in milliseconds since the epoch when the scanned
@@ -43,7 +43,7 @@ public interface ExitList extends Descriptor {
*
* @since 1.1.0
*/
- public long getPublishedMillis();
+ long getPublishedMillis();
/**
* Return the time in milliseconds since the epoch when the network
@@ -51,7 +51,7 @@ public interface ExitList extends Descriptor {
*
* @since 1.1.0
*/
- public long getLastStatusMillis();
+ long getLastStatusMillis();
/**
* Return the IP addresses that were determined in the scan with map
@@ -60,7 +60,7 @@ public interface ExitList extends Descriptor {
*
* @since 1.1.0
*/
- public Map<String, Long> getExitAddresses();
+ Map<String, Long> getExitAddresses();
}
/**
@@ -69,13 +69,13 @@ public interface ExitList extends Descriptor {
*
* @since 1.0.0
*/
- public long getDownloadedMillis();
+ long getDownloadedMillis();
/**
* Return the unordered set of exit scan results.
*
* @since 1.1.0
*/
- public Set<ExitList.Entry> getEntries();
+ Set<ExitList.Entry> getEntries();
}
diff --git a/src/main/java/org/torproject/descriptor/ExtraInfoDescriptor.java b/src/main/java/org/torproject/descriptor/ExtraInfoDescriptor.java
index b668eff..1ffb418 100644
--- a/src/main/java/org/torproject/descriptor/ExtraInfoDescriptor.java
+++ b/src/main/java/org/torproject/descriptor/ExtraInfoDescriptor.java
@@ -50,7 +50,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public String getDigestSha1Hex();
+ String getDigestSha1Hex();
/**
* Return the SHA-256 descriptor digest, encoded as 43 base64
@@ -59,7 +59,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public String getDigestSha256Base64();
+ String getDigestSha256Base64();
/**
* Return the server's nickname consisting of 1 to 19 alphanumeric
@@ -67,7 +67,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getNickname();
+ String getNickname();
/**
* Return a SHA-1 digest of the server's public identity key, encoded
@@ -76,7 +76,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getFingerprint();
+ String getFingerprint();
/**
* Return the time in milliseconds since the epoch when this descriptor
@@ -84,7 +84,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getPublishedMillis();
+ long getPublishedMillis();
/**
* Return the server's history of read bytes, or null if the descriptor
@@ -94,7 +94,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public BandwidthHistory getReadHistory();
+ BandwidthHistory getReadHistory();
/**
* Return the server's history of written bytes, or null if the
@@ -104,7 +104,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public BandwidthHistory getWriteHistory();
+ BandwidthHistory getWriteHistory();
/**
* Return a SHA-1 digest of the GeoIP database file used by this server
@@ -114,7 +114,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public String getGeoipDbDigestSha1Hex();
+ String getGeoipDbDigestSha1Hex();
/**
* Return a SHA-1 digest of the GeoIPv6 database file used by this
@@ -124,7 +124,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public String getGeoip6DbDigestSha1Hex();
+ String getGeoip6DbDigestSha1Hex();
/**
* Return the time in milliseconds since the epoch when the included
@@ -133,7 +133,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getDirreqStatsEndMillis();
+ long getDirreqStatsEndMillis();
/**
* Return the interval length of the included directory request
@@ -141,7 +141,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getDirreqStatsIntervalLength();
+ long getDirreqStatsIntervalLength();
/**
* Return statistics on unique IP addresses requesting v2 network
@@ -152,7 +152,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getDirreqV2Ips();
+ SortedMap<String, Integer> getDirreqV2Ips();
/**
* Return statistics on unique IP addresses requesting v3 network
@@ -162,7 +162,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getDirreqV3Ips();
+ SortedMap<String, Integer> getDirreqV3Ips();
/**
* Return statistics on directory requests for v2 network statuses with
@@ -173,7 +173,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getDirreqV2Reqs();
+ SortedMap<String, Integer> getDirreqV2Reqs();
/**
* Return statistics on directory requests for v3 network status
@@ -183,7 +183,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getDirreqV3Reqs();
+ SortedMap<String, Integer> getDirreqV3Reqs();
/**
* Return the share of requests for v2 network statuses that the server
@@ -192,7 +192,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public double getDirreqV2Share();
+ double getDirreqV2Share();
/**
* Return the share of requests for v3 network status consensuses of
@@ -202,7 +202,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public double getDirreqV3Share();
+ double getDirreqV3Share();
/**
* Return statistics on responses to directory requests for v2 network
@@ -213,7 +213,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getDirreqV2Resp();
+ SortedMap<String, Integer> getDirreqV2Resp();
/**
* Return statistics on responses to directory requests for v3 network
@@ -223,7 +223,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getDirreqV3Resp();
+ SortedMap<String, Integer> getDirreqV3Resp();
/**
* Return statistics on directory requests for v2 network statuses to
@@ -234,7 +234,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getDirreqV2DirectDl();
+ SortedMap<String, Integer> getDirreqV2DirectDl();
/**
* Return statistics on directory requests for v3 network status
@@ -244,7 +244,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getDirreqV3DirectDl();
+ SortedMap<String, Integer> getDirreqV3DirectDl();
/**
* Return statistics on directory requests for v2 network statuses
@@ -254,7 +254,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getDirreqV2TunneledDl();
+ SortedMap<String, Integer> getDirreqV2TunneledDl();
/**
* Return statistics on directory requests for v3 network status
@@ -264,7 +264,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getDirreqV3TunneledDl();
+ SortedMap<String, Integer> getDirreqV3TunneledDl();
/**
* Return the directory request read history contained in this
@@ -272,7 +272,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public BandwidthHistory getDirreqReadHistory();
+ BandwidthHistory getDirreqReadHistory();
/**
* Return the directory request write history contained in this
@@ -280,7 +280,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public BandwidthHistory getDirreqWriteHistory();
+ BandwidthHistory getDirreqWriteHistory();
/**
* Return the time in milliseconds since the epoch when the included
@@ -289,7 +289,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getEntryStatsEndMillis();
+ long getEntryStatsEndMillis();
/**
* Return the interval length of the included entry statistics in
@@ -297,7 +297,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getEntryStatsIntervalLength();
+ long getEntryStatsIntervalLength();
/**
* Return statistics on client IP addresses with map keys being country
@@ -307,7 +307,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getEntryIps();
+ SortedMap<String, Integer> getEntryIps();
/**
* Return the time in milliseconds since the epoch when the included
@@ -316,7 +316,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getCellStatsEndMillis();
+ long getCellStatsEndMillis();
/**
* Return the interval length of the included cell statistics in
@@ -324,7 +324,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getCellStatsIntervalLength();
+ long getCellStatsIntervalLength();
/**
* Return the mean number of processed cells per circuit by circuit
@@ -333,7 +333,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<Integer> getCellProcessedCells();
+ List<Integer> getCellProcessedCells();
/**
* Return the mean number of cells contained in circuit queues by
@@ -343,7 +343,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<Double> getCellQueuedCells();
+ List<Double> getCellQueuedCells();
/**
* Return the mean times in milliseconds that cells spend in circuit
@@ -353,7 +353,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<Integer> getCellTimeInQueue();
+ List<Integer> getCellTimeInQueue();
/**
* Return the mean number of circuits included in any of the cell
@@ -361,7 +361,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getCellCircuitsPerDecile();
+ int getCellCircuitsPerDecile();
/**
* Return the time in milliseconds since the epoch when the included
@@ -370,7 +370,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getConnBiDirectStatsEndMillis();
+ long getConnBiDirectStatsEndMillis();
/**
* Return the interval length of the included statistics on
@@ -379,7 +379,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getConnBiDirectStatsIntervalLength();
+ long getConnBiDirectStatsIntervalLength();
/**
* Return the number of connections on which this server read and wrote
@@ -388,7 +388,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getConnBiDirectBelow();
+ int getConnBiDirectBelow();
/**
* Return the number of connections on which this server read and wrote
@@ -398,7 +398,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getConnBiDirectRead();
+ int getConnBiDirectRead();
/**
* Return the number of connections on which this server read and wrote
@@ -408,7 +408,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getConnBiDirectWrite();
+ int getConnBiDirectWrite();
/**
* Return the number of connections on which this server read and wrote
@@ -417,7 +417,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getConnBiDirectBoth();
+ int getConnBiDirectBoth();
/**
* Return the time in milliseconds since the epoch when the included
@@ -426,7 +426,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getExitStatsEndMillis();
+ long getExitStatsEndMillis();
/**
* Return the interval length of the included exit statistics in
@@ -434,7 +434,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getExitStatsIntervalLength();
+ long getExitStatsIntervalLength();
/**
* Return statistics on KiB written to streams exiting the Tor network
@@ -444,7 +444,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Long> getExitKibibytesWritten();
+ SortedMap<String, Long> getExitKibibytesWritten();
/**
* Return statistics on KiB read from streams exiting the Tor network
@@ -454,7 +454,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Long> getExitKibibytesRead();
+ SortedMap<String, Long> getExitKibibytesRead();
/**
* Return statistics on opened streams exiting the Tor network by
@@ -465,7 +465,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Long> getExitStreamsOpened();
+ SortedMap<String, Long> getExitStreamsOpened();
/**
* Return the time in milliseconds since the epoch when the included
@@ -474,7 +474,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getGeoipStartTimeMillis();
+ long getGeoipStartTimeMillis();
/**
* Return statistics on the origin of client IP addresses with map keys
@@ -486,7 +486,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getGeoipClientOrigins();
+ SortedMap<String, Integer> getGeoipClientOrigins();
/**
* Return the time in milliseconds since the epoch when the included
@@ -495,7 +495,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getBridgeStatsEndMillis();
+ long getBridgeStatsEndMillis();
/**
* Return the interval length of the included bridge statistics in
@@ -503,7 +503,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getBridgeStatsIntervalLength();
+ long getBridgeStatsIntervalLength();
/**
* Return statistics on bridge client IP addresses by country with map
@@ -513,7 +513,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getBridgeIps();
+ SortedMap<String, Integer> getBridgeIps();
/**
* Return statistics on bridge client IP addresses by IP version with
@@ -524,7 +524,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getBridgeIpVersions();
+ SortedMap<String, Integer> getBridgeIpVersions();
/**
* Return statistics on bridge client IP addresses by transport with
@@ -537,7 +537,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getBridgeIpTransports();
+ SortedMap<String, Integer> getBridgeIpTransports();
/**
* Return the (possibly empty) list of pluggable transports supported
@@ -545,7 +545,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getTransports();
+ List<String> getTransports();
/**
* Return the time in milliseconds since the epoch when the included
@@ -554,7 +554,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public long getHidservStatsEndMillis();
+ long getHidservStatsEndMillis();
/**
* Return the interval length of the included hidden-service statistics
@@ -562,7 +562,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public long getHidservStatsIntervalLength();
+ long getHidservStatsIntervalLength();
/**
* Return the approximate number of RELAY cells seen in either
@@ -571,7 +571,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public Double getHidservRendRelayedCells();
+ Double getHidservRendRelayedCells();
/**
* Return the obfuscation parameters applied to the original
@@ -581,7 +581,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public Map<String, Double> getHidservRendRelayedCellsParameters();
+ Map<String, Double> getHidservRendRelayedCellsParameters();
/**
* Return the approximate number of unique hidden-service identities
@@ -590,7 +590,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public Double getHidservDirOnionsSeen();
+ Double getHidservDirOnionsSeen();
/**
* Return the obfuscation parameters applied to the original
@@ -600,7 +600,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public Map<String, Double> getHidservDirOnionsSeenParameters();
+ Map<String, Double> getHidservDirOnionsSeenParameters();
/**
* Return the time in milliseconds since the epoch when the included
@@ -608,7 +608,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public long getPaddingCountsStatsEndMillis();
+ long getPaddingCountsStatsEndMillis();
/**
* Return the interval length of the included padding-counts statistics in
@@ -616,7 +616,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public long getPaddingCountsStatsIntervalLength();
+ long getPaddingCountsStatsIntervalLength();
/**
* Return padding-counts statistics, or <code>null</code> if no such
@@ -624,7 +624,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public Map<String, Long> getPaddingCounts();
+ Map<String, Long> getPaddingCounts();
/**
* Return the RSA-1024 signature of the PKCS1-padded descriptor digest,
@@ -634,7 +634,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getRouterSignature();
+ String getRouterSignature();
/**
* Return the Ed25519 certificate in PEM format, or null if the
@@ -642,7 +642,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getIdentityEd25519();
+ String getIdentityEd25519();
/**
* Return the Ed25519 master key, encoded as 43 base64 characters
@@ -654,7 +654,7 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getMasterKeyEd25519();
+ String getMasterKeyEd25519();
/**
* Return the Ed25519 signature of the SHA-256 digest of the entire
@@ -665,6 +665,6 @@ public interface ExtraInfoDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getRouterSignatureEd25519();
+ String getRouterSignatureEd25519();
}
diff --git a/src/main/java/org/torproject/descriptor/LogDescriptor.java b/src/main/java/org/torproject/descriptor/LogDescriptor.java
index 8dd8460..a8448f6 100644
--- a/src/main/java/org/torproject/descriptor/LogDescriptor.java
+++ b/src/main/java/org/torproject/descriptor/LogDescriptor.java
@@ -36,14 +36,14 @@ public interface LogDescriptor extends Descriptor {
* @since 2.2.0
*/
@Override
- public byte[] getRawDescriptorBytes();
+ byte[] getRawDescriptorBytes();
/**
* Returns the decompressed raw descriptor bytes of the log as stream.
*
* @since 2.2.0
*/
- public InputStream decompressedByteStream() throws DescriptorParseException;
+ InputStream decompressedByteStream() throws DescriptorParseException;
/**
* Returns annotations found in the log file, which may be an empty List if a
@@ -52,7 +52,7 @@ public interface LogDescriptor extends Descriptor {
* @since 2.2.0
*/
@Override
- public List<String> getAnnotations();
+ List<String> getAnnotations();
/**
* Returns unrecognized lines encountered while parsing the log, which may be
@@ -62,7 +62,7 @@ public interface LogDescriptor extends Descriptor {
* @since 2.2.0
*/
@Override
- public List<String> getUnrecognizedLines();
+ List<String> getUnrecognizedLines();
/**
* Returns a stream of all parseable log lines.
@@ -70,13 +70,13 @@ public interface LogDescriptor extends Descriptor {
*
* @since 2.2.0
*/
- public Stream<? extends Line> logLines() throws DescriptorParseException;
+ Stream<? extends Line> logLines() throws DescriptorParseException;
/** Base interface for accessing log lines. */
- public interface Line {
+ interface Line {
/** Returns a log line string. */
- public String toLogString();
+ String toLogString();
}
}
diff --git a/src/main/java/org/torproject/descriptor/Microdescriptor.java b/src/main/java/org/torproject/descriptor/Microdescriptor.java
index 5490eba..8a33a3b 100644
--- a/src/main/java/org/torproject/descriptor/Microdescriptor.java
+++ b/src/main/java/org/torproject/descriptor/Microdescriptor.java
@@ -30,7 +30,7 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public String getDigestSha256Base64();
+ String getDigestSha256Base64();
/**
* Return the RSA-1024 public key in PEM format used to encrypt CREATE
@@ -39,7 +39,7 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getOnionKey();
+ String getOnionKey();
/**
* Return the curve25519 public key, encoded as 43 base64 characters
@@ -49,7 +49,7 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getNtorOnionKey();
+ String getNtorOnionKey();
/**
* Return IP addresses and TCP ports where this server accepts TLS
@@ -62,7 +62,7 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getOrAddresses();
+ List<String> getOrAddresses();
/**
* Return nicknames, $-prefixed identity fingerprints, or tuples of the
@@ -72,7 +72,7 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getFamilyEntries();
+ List<String> getFamilyEntries();
/**
* Return the default policy, {@code "accept"} or {@code "reject"}, of
@@ -82,7 +82,7 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getDefaultPolicy();
+ String getDefaultPolicy();
/**
* Return the port list of the IPv4 exit-policy summary, or null if the
@@ -91,7 +91,7 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getPortList();
+ String getPortList();
/**
* Return the default policy, {@code "accept"} or {@code "reject"}, of
@@ -101,7 +101,7 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getIpv6DefaultPolicy();
+ String getIpv6DefaultPolicy();
/**
* Return the port list of the IPv6 exit-policy summary, or null if the
@@ -110,7 +110,7 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getIpv6PortList();
+ String getIpv6PortList();
/**
* Return a SHA-1 digest of the server's RSA-1024 identity key, encoded
@@ -120,7 +120,7 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getRsa1024Identity();
+ String getRsa1024Identity();
/**
* Return a SHA-256 digest of the server's Ed25519 identity key,
@@ -130,6 +130,6 @@ public interface Microdescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getEd25519Identity();
+ String getEd25519Identity();
}
diff --git a/src/main/java/org/torproject/descriptor/NetworkStatusEntry.java b/src/main/java/org/torproject/descriptor/NetworkStatusEntry.java
index 81efde0..e602a04 100644
--- a/src/main/java/org/torproject/descriptor/NetworkStatusEntry.java
+++ b/src/main/java/org/torproject/descriptor/NetworkStatusEntry.java
@@ -30,7 +30,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public byte[] getStatusEntryBytes();
+ byte[] getStatusEntryBytes();
/**
* Return the server nickname consisting of 1 to 19 alphanumeric
@@ -38,7 +38,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public String getNickname();
+ String getNickname();
/**
* Return a SHA-1 digest of the server's identity key, encoded as 40
@@ -46,7 +46,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public String getFingerprint();
+ String getFingerprint();
/**
* Return the SHA-1 digest of the server descriptor, or null if the
@@ -55,7 +55,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public String getDescriptor();
+ String getDescriptor();
/**
* Return the time in milliseconds since the epoch when this descriptor
@@ -63,14 +63,14 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public long getPublishedMillis();
+ long getPublishedMillis();
/**
* Return the server's primary IPv4 address in dotted-quad format.
*
* @since 1.0.0
*/
- public String getAddress();
+ String getAddress();
/**
* Return the TCP port where this server accepts TLS connections for
@@ -78,7 +78,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public int getOrPort();
+ int getOrPort();
/**
* Return the TCP port where this server accepts directory-related HTTP
@@ -86,7 +86,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public int getDirPort();
+ int getDirPort();
/**
* Return the (possibly empty) set of microdescriptor digests, encoded as 43
@@ -95,7 +95,7 @@ public interface NetworkStatusEntry {
*
* @since 1.7.0
*/
- public Set<String> getMicrodescriptorDigestsSha256Base64();
+ Set<String> getMicrodescriptorDigestsSha256Base64();
/**
* Return additional IP addresses and TCP ports where this server
@@ -105,7 +105,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public List<String> getOrAddresses();
+ List<String> getOrAddresses();
/**
* Return the relay flags assigned to this server, or null if the
@@ -113,7 +113,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public SortedSet<String> getFlags();
+ SortedSet<String> getFlags();
/**
* Return the Tor software version, or null if the status entry didn't
@@ -121,7 +121,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public String getVersion();
+ String getVersion();
/**
* Return the version numbers of all protocols supported by this server, or
@@ -129,7 +129,7 @@ public interface NetworkStatusEntry {
*
* @since 1.6.0
*/
- public SortedMap<String, SortedSet<Long>> getProtocols();
+ SortedMap<String, SortedSet<Long>> getProtocols();
/**
* Return the bandwidth weight of this server or -1 if the status entry
@@ -137,7 +137,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public long getBandwidth();
+ long getBandwidth();
/**
* Return the measured bandwidth or -1 if the status entry either
@@ -146,7 +146,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public long getMeasured();
+ long getMeasured();
/**
* Return whether the status entry is yet unmeasured by the bandwidth
@@ -154,7 +154,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public boolean getUnmeasured();
+ boolean getUnmeasured();
/**
* Return the default policy of the port summary, which can be either
@@ -163,7 +163,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public String getDefaultPolicy();
+ String getDefaultPolicy();
/**
* Return the list of ports or port intervals of the exit port summary,
@@ -171,7 +171,7 @@ public interface NetworkStatusEntry {
*
* @since 1.0.0
*/
- public String getPortList();
+ String getPortList();
/**
* Return the server's Ed25519 master key, encoded as 43 base64
@@ -181,6 +181,6 @@ public interface NetworkStatusEntry {
*
* @since 1.1.0
*/
- public String getMasterKeyEd25519();
+ String getMasterKeyEd25519();
}
diff --git a/src/main/java/org/torproject/descriptor/RelayDirectory.java b/src/main/java/org/torproject/descriptor/RelayDirectory.java
index 3e00ebb..e2a5dca 100644
--- a/src/main/java/org/torproject/descriptor/RelayDirectory.java
+++ b/src/main/java/org/torproject/descriptor/RelayDirectory.java
@@ -35,7 +35,7 @@ public interface RelayDirectory extends Descriptor {
*
* @since 1.0.0
*/
- public long getPublishedMillis();
+ long getPublishedMillis();
/**
* Return the RSA-1024 public key in PEM format used by this authority
@@ -44,14 +44,14 @@ public interface RelayDirectory extends Descriptor {
*
* @since 1.0.0
*/
- public String getDirSigningKey();
+ String getDirSigningKey();
/**
* Return recommended Tor versions.
*
* @since 1.0.0
*/
- public List<String> getRecommendedSoftware();
+ List<String> getRecommendedSoftware();
/**
* Return the directory signature string made with the authority's
@@ -59,14 +59,14 @@ public interface RelayDirectory extends Descriptor {
*
* @since 1.0.0
*/
- public String getDirectorySignature();
+ String getDirectorySignature();
/**
* Return router status entries, one for each contained relay.
*
* @since 1.0.0
*/
- public List<RouterStatusEntry> getRouterStatusEntries();
+ List<RouterStatusEntry> getRouterStatusEntries();
/**
* Return a list of server descriptors contained in the signed
@@ -74,7 +74,7 @@ public interface RelayDirectory extends Descriptor {
*
* @since 1.0.0
*/
- public List<ServerDescriptor> getServerDescriptors();
+ List<ServerDescriptor> getServerDescriptors();
/**
* Return a (very likely empty) list of exceptions from parsing the
@@ -82,7 +82,7 @@ public interface RelayDirectory extends Descriptor {
*
* @since 1.0.0
*/
- public List<Exception> getServerDescriptorParseExceptions();
+ List<Exception> getServerDescriptorParseExceptions();
/**
* Return the directory nickname consisting of 1 to 19 alphanumeric
@@ -90,7 +90,7 @@ public interface RelayDirectory extends Descriptor {
*
* @since 1.0.0
*/
- public String getNickname();
+ String getNickname();
/**
* Return the SHA-1 directory digest, encoded as 40 lower-case
@@ -99,6 +99,6 @@ public interface RelayDirectory extends Descriptor {
*
* @since 1.7.0
*/
- public String getDigestSha1Hex();
+ String getDigestSha1Hex();
}
diff --git a/src/main/java/org/torproject/descriptor/RelayNetworkStatus.java b/src/main/java/org/torproject/descriptor/RelayNetworkStatus.java
index 5080282..90f050b 100644
--- a/src/main/java/org/torproject/descriptor/RelayNetworkStatus.java
+++ b/src/main/java/org/torproject/descriptor/RelayNetworkStatus.java
@@ -36,14 +36,14 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public int getNetworkStatusVersion();
+ int getNetworkStatusVersion();
/**
* Return the authority's hostname.
*
* @since 1.0.0
*/
- public String getHostname();
+ String getHostname();
/**
* Return the authority's primary IPv4 address in dotted-quad format,
@@ -51,7 +51,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public String getAddress();
+ String getAddress();
/**
* Return the TCP port where this authority accepts directory-related
@@ -60,7 +60,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public int getDirport();
+ int getDirport();
/**
* Return a SHA-1 digest of the authority's public identity key,
@@ -69,7 +69,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public String getFingerprint();
+ String getFingerprint();
/**
* Return the contact information for this authority, which may contain
@@ -77,7 +77,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public String getContactLine();
+ String getContactLine();
/**
* Return the RSA-1024 public key in PEM format used by this authority
@@ -85,7 +85,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public String getDirSigningKey();
+ String getDirSigningKey();
/**
* Return recommended Tor versions for server usage, or null if the
@@ -93,7 +93,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getRecommendedServerVersions();
+ List<String> getRecommendedServerVersions();
/**
* Return recommended Tor versions for client usage, or null if the
@@ -101,7 +101,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getRecommendedClientVersions();
+ List<String> getRecommendedClientVersions();
/**
* Return the time in milliseconds since the epoch when this descriptor
@@ -109,7 +109,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public long getPublishedMillis();
+ long getPublishedMillis();
/**
* Return the set of flags that this directory assigns to relays, or
@@ -117,7 +117,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public SortedSet<String> getDirOptions();
+ SortedSet<String> getDirOptions();
/**
* Return status entries for each contained server, with map keys being
@@ -126,7 +126,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, NetworkStatusEntry> getStatusEntries();
+ SortedMap<String, NetworkStatusEntry> getStatusEntries();
/**
* Return whether a status entry with the given relay fingerprint
@@ -136,7 +136,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public boolean containsStatusEntry(String fingerprint);
+ boolean containsStatusEntry(String fingerprint);
/**
* Return a status entry by relay fingerprint (SHA-1 digest of the
@@ -146,7 +146,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public NetworkStatusEntry getStatusEntry(String fingerprint);
+ NetworkStatusEntry getStatusEntry(String fingerprint);
/**
* Return the authority's nickname consisting of 1 to 19 alphanumeric
@@ -154,7 +154,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public String getNickname();
+ String getNickname();
/**
* Return the directory signature string made with the authority's
@@ -162,7 +162,7 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.0.0
*/
- public String getDirectorySignature();
+ String getDirectorySignature();
/**
* Return the SHA-1 status digest, encoded as 40 lower-case hexadecimal
@@ -171,6 +171,6 @@ public interface RelayNetworkStatus extends Descriptor {
*
* @since 1.7.0
*/
- public String getDigestSha1Hex();
+ String getDigestSha1Hex();
}
diff --git a/src/main/java/org/torproject/descriptor/RelayNetworkStatusConsensus.java b/src/main/java/org/torproject/descriptor/RelayNetworkStatusConsensus.java
index 9885172..e03f40b 100644
--- a/src/main/java/org/torproject/descriptor/RelayNetworkStatusConsensus.java
+++ b/src/main/java/org/torproject/descriptor/RelayNetworkStatusConsensus.java
@@ -32,7 +32,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public int getNetworkStatusVersion();
+ int getNetworkStatusVersion();
/**
* Return the consensus flavor name, which denotes the variant of the
@@ -42,7 +42,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public String getConsensusFlavor();
+ String getConsensusFlavor();
/**
* Return the consensus method number of this descriptor, which is the
@@ -52,7 +52,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public int getConsensusMethod();
+ int getConsensusMethod();
/**
* Return the time in milliseconds since the epoch at which this
@@ -60,7 +60,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public long getValidAfterMillis();
+ long getValidAfterMillis();
/**
* Return the time in milliseconds since the epoch until which this
@@ -68,7 +68,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public long getFreshUntilMillis();
+ long getFreshUntilMillis();
/**
* Return the time in milliseconds since the epoch until which this
@@ -76,7 +76,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public long getValidUntilMillis();
+ long getValidUntilMillis();
/**
* Return the number of seconds that the directory authorities will
@@ -85,7 +85,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public long getVoteSeconds();
+ long getVoteSeconds();
/**
* Return the number of seconds that the directory authorities will
@@ -94,7 +94,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public long getDistSeconds();
+ long getDistSeconds();
/**
* Return recommended Tor versions for server usage, or null if the
@@ -102,7 +102,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getRecommendedServerVersions();
+ List<String> getRecommendedServerVersions();
/**
* Return recommended Tor versions for client usage, or null if the
@@ -110,7 +110,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getRecommendedClientVersions();
+ List<String> getRecommendedClientVersions();
/**
* Return the version numbers of all protocols that clients should support,
@@ -119,7 +119,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.6.0
*/
- public SortedMap<String, SortedSet<Long>> getRecommendedClientProtocols();
+ SortedMap<String, SortedSet<Long>> getRecommendedClientProtocols();
/**
* Return the version numbers of all protocols that relays should support,
@@ -128,7 +128,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.6.0
*/
- public SortedMap<String, SortedSet<Long>> getRecommendedRelayProtocols();
+ SortedMap<String, SortedSet<Long>> getRecommendedRelayProtocols();
/**
* Return the version numbers of all protocols that clients must support,
@@ -137,7 +137,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.6.0
*/
- public SortedMap<String, SortedSet<Long>> getRequiredClientProtocols();
+ SortedMap<String, SortedSet<Long>> getRequiredClientProtocols();
/**
* Return the version numbers of all protocols that relays must support,
@@ -146,7 +146,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.6.0
*/
- public SortedMap<String, SortedSet<Long>> getRequiredRelayProtocols();
+ SortedMap<String, SortedSet<Long>> getRequiredRelayProtocols();
/**
* Return a list of software packages and their versions together with a
@@ -157,7 +157,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.3.0
*/
- public List<String> getPackageLines();
+ List<String> getPackageLines();
/**
* Return known relay flags in this descriptor that were contained in
@@ -166,7 +166,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public SortedSet<String> getKnownFlags();
+ SortedSet<String> getKnownFlags();
/**
* Return consensus parameters contained in this descriptor with map
@@ -176,7 +176,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getConsensusParams();
+ SortedMap<String, Integer> getConsensusParams();
/**
* Return the number of commits used to generate the second-to-last shared
@@ -185,7 +185,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.6.0
*/
- public int getSharedRandPreviousNumReveals();
+ int getSharedRandPreviousNumReveals();
/**
* Return the second-to-last shared random value, encoded in base64, or null
@@ -193,7 +193,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.6.0
*/
- public String getSharedRandPreviousValue();
+ String getSharedRandPreviousValue();
/**
* Return the number of commits used to generate the latest shared random
@@ -202,7 +202,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.6.0
*/
- public int getSharedRandCurrentNumReveals();
+ int getSharedRandCurrentNumReveals();
/**
* Return the latest shared random value, encoded in base64, or null if the
@@ -210,7 +210,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.6.0
*/
- public String getSharedRandCurrentValue();
+ String getSharedRandCurrentValue();
/**
* Return directory source entries for each directory authority that
@@ -220,7 +220,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, DirSourceEntry> getDirSourceEntries();
+ SortedMap<String, DirSourceEntry> getDirSourceEntries();
/**
* Return status entries for each contained server, with map keys being
@@ -229,7 +229,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, NetworkStatusEntry> getStatusEntries();
+ SortedMap<String, NetworkStatusEntry> getStatusEntries();
/**
* Return whether a status entry with the given relay fingerprint
@@ -239,7 +239,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public boolean containsStatusEntry(String fingerprint);
+ boolean containsStatusEntry(String fingerprint);
/**
* Return a status entry by relay fingerprint (SHA-1 digest of the
@@ -249,14 +249,14 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public NetworkStatusEntry getStatusEntry(String fingerprint);
+ NetworkStatusEntry getStatusEntry(String fingerprint);
/**
* Return the list of signatures contained in this consensus.
*
* @since 1.3.0
*/
- public List<DirectorySignature> getSignatures();
+ List<DirectorySignature> getSignatures();
/**
* Return optional weights to be applied to router bandwidths during
@@ -266,7 +266,7 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getBandwidthWeights();
+ SortedMap<String, Integer> getBandwidthWeights();
/**
* Return the SHA-1 digest of this consensus, encoded as 40 lower-case
@@ -275,6 +275,6 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
*
* @since 1.7.0
*/
- public String getDigestSha1Hex();
+ String getDigestSha1Hex();
}
diff --git a/src/main/java/org/torproject/descriptor/RelayNetworkStatusVote.java b/src/main/java/org/torproject/descriptor/RelayNetworkStatusVote.java
index d14b39e..a507d8c 100644
--- a/src/main/java/org/torproject/descriptor/RelayNetworkStatusVote.java
+++ b/src/main/java/org/torproject/descriptor/RelayNetworkStatusVote.java
@@ -27,7 +27,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public int getNetworkStatusVersion();
+ int getNetworkStatusVersion();
/**
* Return the list of consensus method numbers supported by this
@@ -36,7 +36,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public List<Integer> getConsensusMethods();
+ List<Integer> getConsensusMethods();
/**
* Return the time in milliseconds since the epoch when this descriptor
@@ -44,7 +44,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getPublishedMillis();
+ long getPublishedMillis();
/**
* Return the time in milliseconds since the epoch at which the
@@ -52,7 +52,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getValidAfterMillis();
+ long getValidAfterMillis();
/**
* Return the time in milliseconds since the epoch until which the
@@ -60,7 +60,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getFreshUntilMillis();
+ long getFreshUntilMillis();
/**
* Return the time in milliseconds since the epoch until which the
@@ -68,7 +68,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getValidUntilMillis();
+ long getValidUntilMillis();
/**
* Return the number of seconds that the directory authorities will
@@ -77,7 +77,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getVoteSeconds();
+ long getVoteSeconds();
/**
* Return the number of seconds that the directory authorities will
@@ -86,7 +86,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getDistSeconds();
+ long getDistSeconds();
/**
* Return recommended Tor versions for server usage, or null if the
@@ -94,7 +94,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getRecommendedServerVersions();
+ List<String> getRecommendedServerVersions();
/**
* Return recommended Tor versions for client usage, or null if the
@@ -102,7 +102,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getRecommendedClientVersions();
+ List<String> getRecommendedClientVersions();
/**
* Return the version numbers of all protocols that clients should support,
@@ -110,7 +110,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.6.0
*/
- public SortedMap<String, SortedSet<Long>> getRecommendedClientProtocols();
+ SortedMap<String, SortedSet<Long>> getRecommendedClientProtocols();
/**
* Return the version numbers of all protocols that relays should support,
@@ -118,7 +118,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.6.0
*/
- public SortedMap<String, SortedSet<Long>> getRecommendedRelayProtocols();
+ SortedMap<String, SortedSet<Long>> getRecommendedRelayProtocols();
/**
* Return the version numbers of all protocols that clients must support,
@@ -126,7 +126,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.6.0
*/
- public SortedMap<String, SortedSet<Long>> getRequiredClientProtocols();
+ SortedMap<String, SortedSet<Long>> getRequiredClientProtocols();
/**
* Return the version numbers of all protocols that relays must support,
@@ -134,7 +134,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.6.0
*/
- public SortedMap<String, SortedSet<Long>> getRequiredRelayProtocols();
+ SortedMap<String, SortedSet<Long>> getRequiredRelayProtocols();
/**
* Return a list of software packages and their versions together with a
@@ -144,14 +144,14 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.3.0
*/
- public List<String> getPackageLines();
+ List<String> getPackageLines();
/**
* Return known relay flags by this authority.
*
* @since 1.0.0
*/
- public SortedSet<String> getKnownFlags();
+ SortedSet<String> getKnownFlags();
/**
* Return the minimum uptime in seconds that this authority requires
@@ -160,7 +160,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getStableUptime();
+ long getStableUptime();
/**
* Return the minimum MTBF (mean time between failure) that this
@@ -169,7 +169,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getStableMtbf();
+ long getStableMtbf();
/**
* Return the minimum bandwidth that this authority requires for
@@ -178,7 +178,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getFastBandwidth();
+ long getFastBandwidth();
/**
* Return the minimum WFU (weighted fractional uptime) in percent that
@@ -187,7 +187,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public double getGuardWfu();
+ double getGuardWfu();
/**
* Return the minimum weighted time in seconds that this authority
@@ -196,7 +196,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getGuardTk();
+ long getGuardTk();
/**
* Return the minimum bandwidth that this authority requires for
@@ -205,7 +205,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getGuardBandwidthIncludingExits();
+ long getGuardBandwidthIncludingExits();
/**
* Return the minimum bandwidth that this authority requires for
@@ -214,7 +214,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getGuardBandwidthExcludingExits();
+ long getGuardBandwidthExcludingExits();
/**
* Return 1 if the authority has measured enough MTBF info to use the
@@ -224,7 +224,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public int getEnoughMtbfInfo();
+ int getEnoughMtbfInfo();
/**
* Return 1 if the authority has enough measured bandwidths that it'll
@@ -234,7 +234,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.1.0
*/
- public int getIgnoringAdvertisedBws();
+ int getIgnoringAdvertisedBws();
/**
* Return consensus parameters contained in this descriptor with map
@@ -244,7 +244,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, Integer> getConsensusParams();
+ SortedMap<String, Integer> getConsensusParams();
/**
* Return the authority's nickname consisting of 1 to 19 alphanumeric
@@ -252,7 +252,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public String getNickname();
+ String getNickname();
/**
* Return a SHA-1 digest of the authority's long-term authority
@@ -261,14 +261,14 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public String getIdentity();
+ String getIdentity();
/**
* Return the authority's hostname.
*
* @since 1.2.0
*/
- public String getHostname();
+ String getHostname();
/**
* Return the authority's primary IPv4 address in dotted-quad format,
@@ -276,7 +276,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public String getAddress();
+ String getAddress();
/**
* Return the TCP port where this authority accepts directory-related
@@ -285,7 +285,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public int getDirport();
+ int getDirport();
/**
* Return the TCP port where this authority accepts TLS connections for
@@ -294,7 +294,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public int getOrport();
+ int getOrport();
/**
* Return the contact information for this authority, which may contain
@@ -303,7 +303,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public String getContactLine();
+ String getContactLine();
/**
* Return whether this directory authority supports and can participate in
@@ -311,7 +311,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.6.0
*/
- public boolean isSharedRandParticipate();
+ boolean isSharedRandParticipate();
/**
* Return all currently known directory authority commit lines for the shared
@@ -325,7 +325,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.6.0
*/
- public List<String> getSharedRandCommitLines();
+ List<String> getSharedRandCommitLines();
/**
* Return the number of commits used to generate the second-to-last shared
@@ -334,7 +334,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.6.0
*/
- public int getSharedRandPreviousNumReveals();
+ int getSharedRandPreviousNumReveals();
/**
* Return the second-to-last shared random value, encoded in base64, or null
@@ -342,7 +342,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.6.0
*/
- public String getSharedRandPreviousValue();
+ String getSharedRandPreviousValue();
/**
* Return the number of commits used to generate the latest shared random
@@ -350,7 +350,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.6.0
*/
- public int getSharedRandCurrentNumReveals();
+ int getSharedRandCurrentNumReveals();
/**
* Return the latest shared random value, encoded in base64, or null if this
@@ -358,7 +358,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.6.0
*/
- public String getSharedRandCurrentValue();
+ String getSharedRandCurrentValue();
/**
* Return the version of the directory key certificate used by this
@@ -366,7 +366,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public int getDirKeyCertificateVersion();
+ int getDirKeyCertificateVersion();
/**
* Return the SHA-1 digest for an obsolete authority identity key still
@@ -375,14 +375,14 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public String getLegacyDirKey();
+ String getLegacyDirKey();
/**
* Return the authority's identity key in PEM format.
*
* @since 1.2.0
*/
- public String getDirIdentityKey();
+ String getDirIdentityKey();
/**
* Return the time in milliseconds since the epoch when the authority's
@@ -390,7 +390,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getDirKeyPublishedMillis();
+ long getDirKeyPublishedMillis();
/**
* Return the time in milliseconds since the epoch after which the
@@ -398,14 +398,14 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public long getDirKeyExpiresMillis();
+ long getDirKeyExpiresMillis();
/**
* Return the authority's signing key in PEM format.
*
* @since 1.2.0
*/
- public String getDirSigningKey();
+ String getDirSigningKey();
/**
* Return the signature of the authority's identity key made using the
@@ -414,7 +414,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.2.0
*/
- public String getDirKeyCrosscert();
+ String getDirKeyCrosscert();
/**
* Return the certificate signature from the initial item
@@ -423,7 +423,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.2.0
*/
- public String getDirKeyCertification();
+ String getDirKeyCertification();
/**
* Return status entries for each contained server, with map keys being
@@ -432,7 +432,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<String, NetworkStatusEntry> getStatusEntries();
+ SortedMap<String, NetworkStatusEntry> getStatusEntries();
/**
* Return whether a status entry with the given relay fingerprint
@@ -442,7 +442,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public boolean containsStatusEntry(String fingerprint);
+ boolean containsStatusEntry(String fingerprint);
/**
* Return a status entry by relay fingerprint (SHA-1 digest of the
@@ -452,7 +452,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.0.0
*/
- public NetworkStatusEntry getStatusEntry(String fingerprint);
+ NetworkStatusEntry getStatusEntry(String fingerprint);
/**
* Return a list of signatures contained in this vote, which is
@@ -461,7 +461,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.3.0
*/
- public List<DirectorySignature> getSignatures();
+ List<DirectorySignature> getSignatures();
/**
* Return the SHA-1 digest of this vote, encoded as 40 lower-case hexadecimal
@@ -469,6 +469,6 @@ public interface RelayNetworkStatusVote extends Descriptor {
*
* @since 1.7.0
*/
- public String getDigestSha1Hex();
+ String getDigestSha1Hex();
}
diff --git a/src/main/java/org/torproject/descriptor/RouterStatusEntry.java b/src/main/java/org/torproject/descriptor/RouterStatusEntry.java
index a41b4bd..8b96c52 100644
--- a/src/main/java/org/torproject/descriptor/RouterStatusEntry.java
+++ b/src/main/java/org/torproject/descriptor/RouterStatusEntry.java
@@ -24,7 +24,7 @@ public interface RouterStatusEntry {
*
* @since 1.0.0
*/
- public String getNickname();
+ String getNickname();
/**
* Return a SHA-1 digest of the relay's identity key, encoded as 40
@@ -32,20 +32,20 @@ public interface RouterStatusEntry {
*
* @since 1.0.0
*/
- public String getFingerprint();
+ String getFingerprint();
/**
* Return whether the relay is verified.
*
* @since 1.0.0
*/
- public boolean isVerified();
+ boolean isVerified();
/**
* Return whether the relay is live.
*
* @since 1.0.0
*/
- public boolean isLive();
+ boolean isLive();
}
diff --git a/src/main/java/org/torproject/descriptor/ServerDescriptor.java b/src/main/java/org/torproject/descriptor/ServerDescriptor.java
index 1b91ec8..1867a01 100644
--- a/src/main/java/org/torproject/descriptor/ServerDescriptor.java
+++ b/src/main/java/org/torproject/descriptor/ServerDescriptor.java
@@ -53,7 +53,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public String getDigestSha1Hex();
+ String getDigestSha1Hex();
/**
* Return the SHA-256 descriptor digest, encoded as 43 base64
@@ -62,7 +62,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public String getDigestSha256Base64();
+ String getDigestSha256Base64();
/**
* Return the server's nickname consisting of 1 to 19 alphanumeric
@@ -70,14 +70,14 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getNickname();
+ String getNickname();
/**
* Return the server's primary IPv4 address in dotted-quad format.
*
* @since 1.0.0
*/
- public String getAddress();
+ String getAddress();
/**
* Return the TCP port where this server accepts TLS connections for
@@ -86,7 +86,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getOrPort();
+ int getOrPort();
/**
* Return the TCP port where this server accepts SOCKS connections,
@@ -94,7 +94,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getSocksPort();
+ int getSocksPort();
/**
* Return the TCP port where this server accepts directory-related HTTP
@@ -102,7 +102,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getDirPort();
+ int getDirPort();
/**
* Return IP addresses and TCP ports where this server accepts TLS
@@ -115,7 +115,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getOrAddresses();
+ List<String> getOrAddresses();
/**
* Return the average bandwidth in bytes per second that the server is
@@ -123,7 +123,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getBandwidthRate();
+ int getBandwidthRate();
/**
* Return the burst bandwidth in bytes per second that the server is
@@ -131,7 +131,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getBandwidthBurst();
+ int getBandwidthBurst();
/**
* Return the observed bandwidth in bytes per second as an estimate of
@@ -141,7 +141,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public int getBandwidthObserved();
+ int getBandwidthObserved();
/**
* Return a human-readable string describing the Tor software version
@@ -151,7 +151,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getPlatform();
+ String getPlatform();
/**
* Return the version numbers of all protocols supported by this server, or
@@ -159,7 +159,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.6.0
*/
- public SortedMap<String, SortedSet<Long>> getProtocols();
+ SortedMap<String, SortedSet<Long>> getProtocols();
/**
* Return the time in milliseconds since the epoch when this descriptor
@@ -167,7 +167,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public long getPublishedMillis();
+ long getPublishedMillis();
/**
* Return a SHA-1 digest of the server's public identity key, encoded
@@ -178,7 +178,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getFingerprint();
+ String getFingerprint();
/**
* Return whether the server was hibernating when this descriptor was
@@ -186,7 +186,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public boolean isHibernating();
+ boolean isHibernating();
/**
* Return the number of seconds that the server process has been
@@ -196,7 +196,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public Long getUptime();
+ Long getUptime();
/**
* Return the RSA-1024 public key in PEM format used to encrypt CREATE
@@ -205,7 +205,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getOnionKey();
+ String getOnionKey();
/**
* Return the RSA-1024 public key in PEM format used by this server as
@@ -214,7 +214,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getSigningKey();
+ String getSigningKey();
/**
* Return the server's exit policy consisting of one or more accept or
@@ -223,7 +223,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getExitPolicyLines();
+ List<String> getExitPolicyLines();
/**
* Return the RSA-1024 signature of the PKCS1-padded descriptor digest,
@@ -233,7 +233,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getRouterSignature();
+ String getRouterSignature();
/**
* Return the contact information for this server, which may contain
@@ -242,7 +242,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getContact();
+ String getContact();
/**
* Return nicknames, $-prefixed identity fingerprints, or tuples of the
@@ -252,7 +252,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getFamilyEntries();
+ List<String> getFamilyEntries();
/**
* Return the server's history of read bytes, or null if the descriptor
@@ -263,7 +263,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public BandwidthHistory getReadHistory();
+ BandwidthHistory getReadHistory();
/**
* Return the server's history of written bytes, or null if the
@@ -274,7 +274,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public BandwidthHistory getWriteHistory();
+ BandwidthHistory getWriteHistory();
/**
* Return true if the server uses the enhanced DNS logic, or false if
@@ -284,7 +284,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public boolean getUsesEnhancedDnsLogic();
+ boolean getUsesEnhancedDnsLogic();
/**
* Return whether this server is a directory cache that provides
@@ -292,7 +292,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public boolean getCachesExtraInfo();
+ boolean getCachesExtraInfo();
/**
* Return the SHA-1 digest of the server's extra-info descriptor,
@@ -301,7 +301,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public String getExtraInfoDigestSha1Hex();
+ String getExtraInfoDigestSha1Hex();
/**
* Return the SHA-256 digest of the server's extra-info descriptor,
@@ -311,7 +311,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.7.0
*/
- public String getExtraInfoDigestSha256Base64();
+ String getExtraInfoDigestSha256Base64();
/**
* Return the list of hidden service descriptor version numbers that
@@ -323,14 +323,14 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<Integer> getHiddenServiceDirVersions();
+ List<Integer> getHiddenServiceDirVersions();
/**
* Return whether this server stores and serves hidden service descriptors.
*
* @since 2.3.0
*/
- public boolean isHiddenServiceDir();
+ boolean isHiddenServiceDir();
/**
* Return the list of link protocol versions that this server
@@ -338,7 +338,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<Integer> getLinkProtocolVersions();
+ List<Integer> getLinkProtocolVersions();
/**
* Return the list of circuit protocol versions that this server
@@ -346,7 +346,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public List<Integer> getCircuitProtocolVersions();
+ List<Integer> getCircuitProtocolVersions();
/**
* Return whether this server allows single-hop circuits to make exit
@@ -354,7 +354,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public boolean getAllowSingleHopExits();
+ boolean getAllowSingleHopExits();
/**
* Return the default policy, {@code "accept"} or {@code "reject"}, of
@@ -364,7 +364,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getIpv6DefaultPolicy();
+ String getIpv6DefaultPolicy();
/**
* Return the port list of the IPv6 exit-policy summary, or null if the
@@ -373,14 +373,14 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.0.0
*/
- public String getIpv6PortList();
+ String getIpv6PortList();
/**
* Return the curve25519 public key, encoded as 43 base64 characters
* without padding characters, that is used for the ntor circuit
* extended handshake, or null if the descriptor didn't contain an
* ntor-onion-key line. */
- public String getNtorOnionKey();
+ String getNtorOnionKey();
/**
* Return the Ed25519 certificate in PEM format, or null if the
@@ -388,7 +388,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getIdentityEd25519();
+ String getIdentityEd25519();
/**
* Return the Ed25519 master key, encoded as 43 base64 characters
@@ -400,7 +400,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getMasterKeyEd25519();
+ String getMasterKeyEd25519();
/**
* Return the Ed25519 signature of the SHA-256 digest of the entire
@@ -411,7 +411,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getRouterSignatureEd25519();
+ String getRouterSignatureEd25519();
/**
* Return an RSA-1024 signature in PEM format, generated using the
@@ -422,7 +422,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getOnionKeyCrosscert();
+ String getOnionKeyCrosscert();
/**
* Return an Ed25519 signature in PEM format, generated using the
@@ -433,7 +433,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public String getNtorOnionKeyCrosscert();
+ String getNtorOnionKeyCrosscert();
/**
* Return the sign of the Ed25519 public key corresponding to the ntor
@@ -442,7 +442,7 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.1.0
*/
- public int getNtorOnionKeyCrosscertSign();
+ int getNtorOnionKeyCrosscertSign();
/**
* Return whether the server accepts "tunneled" directory requests using
@@ -450,6 +450,6 @@ public interface ServerDescriptor extends Descriptor {
*
* @since 1.3.0
*/
- public boolean getTunnelledDirServer();
+ boolean getTunnelledDirServer();
}
diff --git a/src/main/java/org/torproject/descriptor/TorperfResult.java b/src/main/java/org/torproject/descriptor/TorperfResult.java
index f66dbde..c92ae78 100644
--- a/src/main/java/org/torproject/descriptor/TorperfResult.java
+++ b/src/main/java/org/torproject/descriptor/TorperfResult.java
@@ -25,21 +25,21 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.2.0
*/
- public SortedMap<String, String> getUnrecognizedKeys();
+ SortedMap<String, String> getUnrecognizedKeys();
/**
* Return the configured name of the data source.
*
* @since 1.0.0
*/
- public String getSource();
+ String getSource();
/**
* Return the configured file size in bytes.
*
* @since 1.0.0
*/
- public int getFileSize();
+ int getFileSize();
/**
* Return the time in milliseconds since the epoch when the connection
@@ -47,7 +47,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getStartMillis();
+ long getStartMillis();
/**
* Return the time in milliseconds since the epoch when the socket was
@@ -55,7 +55,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getSocketMillis();
+ long getSocketMillis();
/**
* Return the time in milliseconds since the epoch when the socket was
@@ -63,7 +63,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getConnectMillis();
+ long getConnectMillis();
/**
* Return the time in milliseconds since the epoch when SOCKS 5
@@ -71,7 +71,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getNegotiateMillis();
+ long getNegotiateMillis();
/**
* Return the time in milliseconds since the epoch when the SOCKS
@@ -79,7 +79,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getRequestMillis();
+ long getRequestMillis();
/**
* Return the time in milliseconds since the epoch when the SOCKS
@@ -87,7 +87,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getResponseMillis();
+ long getResponseMillis();
/**
* Return the time in milliseconds since the epoch when the HTTP
@@ -95,7 +95,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getDataRequestMillis();
+ long getDataRequestMillis();
/**
* Return the time in milliseconds since the epoch when the first
@@ -103,7 +103,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getDataResponseMillis();
+ long getDataResponseMillis();
/**
* Return the time in milliseconds since the epoch when the payload was
@@ -111,21 +111,21 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getDataCompleteMillis();
+ long getDataCompleteMillis();
/**
* Return the total number of bytes written.
*
* @since 1.0.0
*/
- public int getWriteBytes();
+ int getWriteBytes();
/**
* Return the total number of bytes read.
*
* @since 1.0.0
*/
- public int getReadBytes();
+ int getReadBytes();
/**
* Return whether the request timed out (as opposed to failing), or
@@ -133,7 +133,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public Boolean didTimeout();
+ Boolean didTimeout();
/**
* Return the times in milliseconds since the epoch when {@code x%} of
@@ -142,7 +142,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public SortedMap<Integer, Long> getDataPercentiles();
+ SortedMap<Integer, Long> getDataPercentiles();
/**
* Return the time in milliseconds since the epoch when the circuit was
@@ -151,7 +151,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getLaunchMillis();
+ long getLaunchMillis();
/**
* Return the time in milliseconds since the epoch when the circuit was
@@ -159,7 +159,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getUsedAtMillis();
+ long getUsedAtMillis();
/**
* Return a list of fingerprints of the relays in the circuit, or null
@@ -167,7 +167,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public List<String> getPath();
+ List<String> getPath();
/**
* Return a list of times in milliseconds since the epoch when circuit
@@ -176,7 +176,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public List<Long> getBuildTimes();
+ List<Long> getBuildTimes();
/**
* Return the circuit build timeout that the Tor client used when
@@ -185,7 +185,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public long getTimeout();
+ long getTimeout();
/**
* Return the circuit build time quantile that the Tor client uses to
@@ -194,7 +194,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public double getQuantile();
+ double getQuantile();
/**
* Return the identifier of the circuit used for this measurement, or
@@ -202,7 +202,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public int getCircId();
+ int getCircId();
/**
* Return the identifier of the stream used for this measurement, or -1
@@ -210,7 +210,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.0.0
*/
- public int getUsedBy();
+ int getUsedBy();
/**
* Return the hostname, IP address, and port that the TGen client used to
@@ -221,7 +221,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.7.0
*/
- public String getEndpointLocal();
+ String getEndpointLocal();
/**
* Return the hostname, IP address, and port that the TGen client used to
@@ -232,7 +232,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.7.0
*/
- public String getEndpointProxy();
+ String getEndpointProxy();
/**
* Return the hostname, IP address, and port that the TGen client used to
@@ -243,7 +243,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.7.0
*/
- public String getEndpointRemote();
+ String getEndpointRemote();
/**
* Return the client machine hostname, which may be <code>"(NULL)"</code> if
@@ -252,7 +252,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.7.0
*/
- public String getHostnameLocal();
+ String getHostnameLocal();
/**
* Return the server machine hostname, which may be <code>"(NULL)"</code> if
@@ -261,7 +261,7 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.7.0
*/
- public String getHostnameRemote();
+ String getHostnameRemote();
/**
* Return the public IP address of the OnionPerf host obtained by connecting
@@ -272,6 +272,6 @@ public interface TorperfResult extends Descriptor {
*
* @since 1.7.0
*/
- public String getSourceAddress();
+ String getSourceAddress();
}
diff --git a/src/main/java/org/torproject/descriptor/UnparseableDescriptor.java b/src/main/java/org/torproject/descriptor/UnparseableDescriptor.java
index b4dc103..691df29 100644
--- a/src/main/java/org/torproject/descriptor/UnparseableDescriptor.java
+++ b/src/main/java/org/torproject/descriptor/UnparseableDescriptor.java
@@ -22,7 +22,7 @@ public interface UnparseableDescriptor extends Descriptor {
*
* @since 1.9.0
*/
- public DescriptorParseException getDescriptorParseException();
+ DescriptorParseException getDescriptorParseException();
/**
* Will always throw an {@code UnsupportedOperationException}.
@@ -30,7 +30,7 @@ public interface UnparseableDescriptor extends Descriptor {
* @since 1.9.0
*/
@Override
- public List<String> getAnnotations();
+ List<String> getAnnotations();
/**
* Will always throw an {@code UnsupportedOperationException}.
@@ -38,7 +38,7 @@ public interface UnparseableDescriptor extends Descriptor {
* @since 1.9.0
*/
@Override
- public List<String> getUnrecognizedLines();
+ List<String> getUnrecognizedLines();
}
diff --git a/src/main/java/org/torproject/descriptor/WebServerAccessLog.java b/src/main/java/org/torproject/descriptor/WebServerAccessLog.java
index a24b9cd..ac50b15 100644
--- a/src/main/java/org/torproject/descriptor/WebServerAccessLog.java
+++ b/src/main/java/org/torproject/descriptor/WebServerAccessLog.java
@@ -31,7 +31,7 @@ public interface WebServerAccessLog extends LogDescriptor {
*
* @since 2.2.0
*/
- public LocalDate getLogDate();
+ LocalDate getLogDate();
/**
* Returns the hostname of the physical host writing this log file, which is
@@ -42,7 +42,7 @@ public interface WebServerAccessLog extends LogDescriptor {
*
* @since 2.2.0
*/
- public String getPhysicalHost();
+ String getPhysicalHost();
/**
* Returns the hostname of the virtual host that this log file was written
@@ -53,7 +53,7 @@ public interface WebServerAccessLog extends LogDescriptor {
*
* @since 2.2.0
*/
- public String getVirtualHost();
+ String getVirtualHost();
/**
* Returns at most three unrecognized lines encountered while parsing the log.
@@ -61,7 +61,7 @@ public interface WebServerAccessLog extends LogDescriptor {
* @since 2.2.0
*/
@Override
- public List<String> getUnrecognizedLines();
+ List<String> getUnrecognizedLines();
/**
* Returns a stream of all valid log lines.
@@ -69,7 +69,7 @@ public interface WebServerAccessLog extends LogDescriptor {
* @since 2.3.0
*/
@Override
- public Stream<WebServerAccessLog.Line> logLines()
+ Stream<WebServerAccessLog.Line> logLines()
throws DescriptorParseException;
/**
@@ -78,31 +78,31 @@ public interface WebServerAccessLog extends LogDescriptor {
*
* @since 2.2.0
*/
- public interface Line extends LogDescriptor.Line {
+ interface Line extends LogDescriptor.Line {
/** Returns the IP address of the requesting host. */
- public String getIp();
+ String getIp();
/** Returns the HTTP method, e.g., GET. */
- public Method getMethod();
+ Method getMethod();
/** Returns the protocol and version, e.g., HTTP/1.1. */
- public String getProtocol();
+ String getProtocol();
/** Returns the requested resource. */
- public String getRequest();
+ String getRequest();
/** Returns the size of the response in bytes, if available. */
- public Optional<Integer> getSize();
+ Optional<Integer> getSize();
/** Returns the final status code, e.g., 200. */
- public int getResponse();
+ int getResponse();
/** Returns the date when the request was received. */
- public LocalDate getDate();
+ LocalDate getDate();
/** True, if this is a valid web server access log line. */
- public boolean isValid();
+ boolean isValid();
}
}
diff --git a/src/main/java/org/torproject/descriptor/log/InternalWebServerAccessLog.java b/src/main/java/org/torproject/descriptor/log/InternalWebServerAccessLog.java
index 540f25d..0c96e06 100644
--- a/src/main/java/org/torproject/descriptor/log/InternalWebServerAccessLog.java
+++ b/src/main/java/org/torproject/descriptor/log/InternalWebServerAccessLog.java
@@ -11,7 +11,7 @@ package org.torproject.descriptor.log;
public interface InternalWebServerAccessLog extends InternalLogDescriptor {
/** The log's name should include this string. */
- public static final String MARKER = "access.log";
+ String MARKER = "access.log";
}
1
0
commit 908d155c40943d3971fa3427f715790653770a52
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Fri Aug 17 09:06:45 2018 +0200
Update to latest metrics-base.
---
src/build | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/build b/src/build
index 23c6e0b..08514a3 160000
--- a/src/build
+++ b/src/build
@@ -1 +1 @@
-Subproject commit 23c6e0be5fab9463f137615053ef412e4da2315e
+Subproject commit 08514a32afefbeef848b80f9a338ee840c282604
1
0
commit 8b89bd0676e989b0073fdb6ec392c5342adf1eb5
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Mon Aug 20 12:03:05 2018 +0200
Remove unused parameters.
---
.../descriptor/impl/BandwidthHistoryImpl.java | 2 +-
.../impl/DirectoryKeyCertificateImpl.java | 22 +--
.../descriptor/impl/ExtraInfoDescriptorImpl.java | 210 ++++++++++-----------
.../descriptor/impl/NetworkStatusEntryImpl.java | 8 +-
.../descriptor/impl/RelayDirectoryImpl.java | 36 ++--
.../descriptor/impl/RelayNetworkStatusImpl.java | 16 +-
.../impl/RelayNetworkStatusVoteImpl.java | 36 ++--
.../descriptor/impl/ServerDescriptorImpl.java | 157 ++++++++-------
.../descriptor/impl/TorperfResultImpl.java | 28 +--
9 files changed, 254 insertions(+), 261 deletions(-)
diff --git a/src/main/java/org/torproject/descriptor/impl/BandwidthHistoryImpl.java b/src/main/java/org/torproject/descriptor/impl/BandwidthHistoryImpl.java
index 79c185d..ec6de2d 100644
--- a/src/main/java/org/torproject/descriptor/impl/BandwidthHistoryImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/BandwidthHistoryImpl.java
@@ -11,7 +11,7 @@ import java.util.TreeMap;
public class BandwidthHistoryImpl implements BandwidthHistory {
- protected BandwidthHistoryImpl(String line, String lineNoOpt,
+ protected BandwidthHistoryImpl(String line,
String[] partsNoOpt) throws DescriptorParseException {
boolean isValid = false;
this.line = line;
diff --git a/src/main/java/org/torproject/descriptor/impl/DirectoryKeyCertificateImpl.java b/src/main/java/org/torproject/descriptor/impl/DirectoryKeyCertificateImpl.java
index cdc9d44..a9268ce 100644
--- a/src/main/java/org/torproject/descriptor/impl/DirectoryKeyCertificateImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/DirectoryKeyCertificateImpl.java
@@ -45,7 +45,7 @@ public class DirectoryKeyCertificateImpl extends DescriptorImpl
Key key = Key.get(parts[0]);
switch (key) {
case DIR_KEY_CERTIFICATE_VERSION:
- this.parseDirKeyCertificateVersionLine(line, parts);
+ this.parseDirKeyCertificateVersionLine(line);
break;
case DIR_ADDRESS:
this.parseDirAddressLine(line, parts);
@@ -54,7 +54,7 @@ public class DirectoryKeyCertificateImpl extends DescriptorImpl
this.parseFingerprintLine(line, parts);
break;
case DIR_IDENTITY_KEY:
- this.parseDirIdentityKeyLine(line, parts);
+ this.parseDirIdentityKeyLine(line);
nextCrypto = key;
break;
case DIR_KEY_PUBLISHED:
@@ -64,15 +64,15 @@ public class DirectoryKeyCertificateImpl extends DescriptorImpl
this.parseDirKeyExpiresLine(line, parts);
break;
case DIR_SIGNING_KEY:
- this.parseDirSigningKeyLine(line, parts);
+ this.parseDirSigningKeyLine(line);
nextCrypto = key;
break;
case DIR_KEY_CROSSCERT:
- this.parseDirKeyCrosscertLine(line, parts);
+ this.parseDirKeyCrosscertLine(line);
nextCrypto = key;
break;
case DIR_KEY_CERTIFICATION:
- this.parseDirKeyCertificationLine(line, parts);
+ this.parseDirKeyCertificationLine(line);
nextCrypto = key;
break;
case CRYPTO_BEGIN:
@@ -115,8 +115,8 @@ public class DirectoryKeyCertificateImpl extends DescriptorImpl
}
}
- private void parseDirKeyCertificateVersionLine(String line,
- String[] parts) throws DescriptorParseException {
+ private void parseDirKeyCertificateVersionLine(String line)
+ throws DescriptorParseException {
if (!line.equals(Key.DIR_KEY_CERTIFICATE_VERSION.keyword + SP + "3")) {
throw new DescriptorParseException("Illegal directory key "
+ "certificate version number in line '" + line + "'.");
@@ -145,7 +145,7 @@ public class DirectoryKeyCertificateImpl extends DescriptorImpl
parts[1]);
}
- private void parseDirIdentityKeyLine(String line, String[] parts)
+ private void parseDirIdentityKeyLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.DIR_IDENTITY_KEY.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -164,21 +164,21 @@ public class DirectoryKeyCertificateImpl extends DescriptorImpl
parts, 1, 2);
}
- private void parseDirSigningKeyLine(String line, String[] parts)
+ private void parseDirSigningKeyLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.DIR_SIGNING_KEY.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parseDirKeyCrosscertLine(String line, String[] parts)
+ private void parseDirKeyCrosscertLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.DIR_KEY_CROSSCERT.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parseDirKeyCertificationLine(String line, String[] parts)
+ private void parseDirKeyCertificationLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.DIR_KEY_CERTIFICATION.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
diff --git a/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
index 99ea13e..d0e3d7e 100644
--- a/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
@@ -86,158 +86,158 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
Key key = Key.get(partsNoOpt[0]);
switch (key) {
case EXTRA_INFO:
- this.parseExtraInfoLine(line, lineNoOpt, partsNoOpt);
+ this.parseExtraInfoLine(line, partsNoOpt);
break;
case PUBLISHED:
- this.parsePublishedLine(line, lineNoOpt, partsNoOpt);
+ this.parsePublishedLine(line, partsNoOpt);
break;
case READ_HISTORY:
- this.parseReadHistoryLine(line, lineNoOpt, partsNoOpt);
+ this.parseReadHistoryLine(line, partsNoOpt);
break;
case WRITE_HISTORY:
- this.parseWriteHistoryLine(line, lineNoOpt, partsNoOpt);
+ this.parseWriteHistoryLine(line, partsNoOpt);
break;
case GEOIP_DB_DIGEST:
- this.parseGeoipDbDigestLine(line, lineNoOpt, partsNoOpt);
+ this.parseGeoipDbDigestLine(line, partsNoOpt);
break;
case GEOIP6_DB_DIGEST:
- this.parseGeoip6DbDigestLine(line, lineNoOpt, partsNoOpt);
+ this.parseGeoip6DbDigestLine(line, partsNoOpt);
break;
case GEOIP_START_TIME:
- this.parseGeoipStartTimeLine(line, lineNoOpt, partsNoOpt);
+ this.parseGeoipStartTimeLine(line, partsNoOpt);
break;
case GEOIP_CLIENT_ORIGINS:
- this.parseGeoipClientOriginsLine(line, lineNoOpt, partsNoOpt);
+ this.parseGeoipClientOriginsLine(line, partsNoOpt);
break;
case DIRREQ_STATS_END:
- this.parseDirreqStatsEndLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqStatsEndLine(line, partsNoOpt);
break;
case DIRREQ_V2_IPS:
- this.parseDirreqV2IpsLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV2IpsLine(line, partsNoOpt);
break;
case DIRREQ_V3_IPS:
- this.parseDirreqV3IpsLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV3IpsLine(line, partsNoOpt);
break;
case DIRREQ_V2_REQS:
- this.parseDirreqV2ReqsLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV2ReqsLine(line, partsNoOpt);
break;
case DIRREQ_V3_REQS:
- this.parseDirreqV3ReqsLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV3ReqsLine(line, partsNoOpt);
break;
case DIRREQ_V2_SHARE:
- this.parseDirreqV2ShareLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV2ShareLine(line, partsNoOpt);
break;
case DIRREQ_V3_SHARE:
- this.parseDirreqV3ShareLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV3ShareLine(line, partsNoOpt);
break;
case DIRREQ_V2_RESP:
- this.parseDirreqV2RespLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV2RespLine(line, partsNoOpt);
break;
case DIRREQ_V3_RESP:
- this.parseDirreqV3RespLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV3RespLine(line, partsNoOpt);
break;
case DIRREQ_V2_DIRECT_DL:
- this.parseDirreqV2DirectDlLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV2DirectDlLine(line, partsNoOpt);
break;
case DIRREQ_V3_DIRECT_DL:
- this.parseDirreqV3DirectDlLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV3DirectDlLine(line, partsNoOpt);
break;
case DIRREQ_V2_TUNNELED_DL:
- this.parseDirreqV2TunneledDlLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV2TunneledDlLine(line, partsNoOpt);
break;
case DIRREQ_V3_TUNNELED_DL:
- this.parseDirreqV3TunneledDlLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqV3TunneledDlLine(line, partsNoOpt);
break;
case DIRREQ_READ_HISTORY:
- this.parseDirreqReadHistoryLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqReadHistoryLine(line, partsNoOpt);
break;
case DIRREQ_WRITE_HISTORY:
- this.parseDirreqWriteHistoryLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirreqWriteHistoryLine(line, partsNoOpt);
break;
case ENTRY_STATS_END:
- this.parseEntryStatsEndLine(line, lineNoOpt, partsNoOpt);
+ this.parseEntryStatsEndLine(line, partsNoOpt);
break;
case ENTRY_IPS:
- this.parseEntryIpsLine(line, lineNoOpt, partsNoOpt);
+ this.parseEntryIpsLine(line, partsNoOpt);
break;
case CELL_STATS_END:
- this.parseCellStatsEndLine(line, lineNoOpt, partsNoOpt);
+ this.parseCellStatsEndLine(line, partsNoOpt);
break;
case CELL_PROCESSED_CELLS:
- this.parseCellProcessedCellsLine(line, lineNoOpt, partsNoOpt);
+ this.parseCellProcessedCellsLine(line, partsNoOpt);
break;
case CELL_QUEUED_CELLS:
- this.parseCellQueuedCellsLine(line, lineNoOpt, partsNoOpt);
+ this.parseCellQueuedCellsLine(line, partsNoOpt);
break;
case CELL_TIME_IN_QUEUE:
- this.parseCellTimeInQueueLine(line, lineNoOpt, partsNoOpt);
+ this.parseCellTimeInQueueLine(line, partsNoOpt);
break;
case CELL_CIRCUITS_PER_DECILE:
- this.parseCellCircuitsPerDecileLine(line, lineNoOpt,
+ this.parseCellCircuitsPerDecileLine(line,
partsNoOpt);
break;
case CONN_BI_DIRECT:
- this.parseConnBiDirectLine(line, lineNoOpt, partsNoOpt);
+ this.parseConnBiDirectLine(line, partsNoOpt);
break;
case EXIT_STATS_END:
- this.parseExitStatsEndLine(line, lineNoOpt, partsNoOpt);
+ this.parseExitStatsEndLine(line, partsNoOpt);
break;
case EXIT_KIBIBYTES_WRITTEN:
- this.parseExitKibibytesWrittenLine(line, lineNoOpt, partsNoOpt);
+ this.parseExitKibibytesWrittenLine(line, partsNoOpt);
break;
case EXIT_KIBIBYTES_READ:
- this.parseExitKibibytesReadLine(line, lineNoOpt, partsNoOpt);
+ this.parseExitKibibytesReadLine(line, partsNoOpt);
break;
case EXIT_STREAMS_OPENED:
- this.parseExitStreamsOpenedLine(line, lineNoOpt, partsNoOpt);
+ this.parseExitStreamsOpenedLine(line, partsNoOpt);
break;
case BRIDGE_STATS_END:
- this.parseBridgeStatsEndLine(line, lineNoOpt, partsNoOpt);
+ this.parseBridgeStatsEndLine(line, partsNoOpt);
break;
case BRIDGE_IPS:
- this.parseBridgeStatsIpsLine(line, lineNoOpt, partsNoOpt);
+ this.parseBridgeStatsIpsLine(line, partsNoOpt);
break;
case BRIDGE_IP_VERSIONS:
- this.parseBridgeIpVersionsLine(line, lineNoOpt, partsNoOpt);
+ this.parseBridgeIpVersionsLine(line, partsNoOpt);
break;
case BRIDGE_IP_TRANSPORTS:
- this.parseBridgeIpTransportsLine(line, lineNoOpt, partsNoOpt);
+ this.parseBridgeIpTransportsLine(line, partsNoOpt);
break;
case TRANSPORT:
- this.parseTransportLine(line, lineNoOpt, partsNoOpt);
+ this.parseTransportLine(line, partsNoOpt);
break;
case HIDSERV_STATS_END:
- this.parseHidservStatsEndLine(line, lineNoOpt, partsNoOpt);
+ this.parseHidservStatsEndLine(line, partsNoOpt);
break;
case HIDSERV_REND_RELAYED_CELLS:
- this.parseHidservRendRelayedCellsLine(line, lineNoOpt,
+ this.parseHidservRendRelayedCellsLine(line,
partsNoOpt);
break;
case HIDSERV_DIR_ONIONS_SEEN:
- this.parseHidservDirOnionsSeenLine(line, lineNoOpt, partsNoOpt);
+ this.parseHidservDirOnionsSeenLine(line, partsNoOpt);
break;
case PADDING_COUNTS:
- this.parsePaddingCountsLine(line, lineNoOpt, partsNoOpt);
+ this.parsePaddingCountsLine(line, partsNoOpt);
break;
case IDENTITY_ED25519:
- this.parseIdentityEd25519Line(line, lineNoOpt, partsNoOpt);
+ this.parseIdentityEd25519Line(line, partsNoOpt);
nextCrypto = key;
break;
case MASTER_KEY_ED25519:
- this.parseMasterKeyEd25519Line(line, lineNoOpt, partsNoOpt);
+ this.parseMasterKeyEd25519Line(line, partsNoOpt);
break;
case ROUTER_SIG_ED25519:
- this.parseRouterSigEd25519Line(line, lineNoOpt, partsNoOpt);
+ this.parseRouterSigEd25519Line(line, partsNoOpt);
break;
case ROUTER_SIGNATURE:
- this.parseRouterSignatureLine(line, lineNoOpt, partsNoOpt);
+ this.parseRouterSignatureLine(line, lineNoOpt);
nextCrypto = key;
break;
case ROUTER_DIGEST:
- this.parseRouterDigestLine(line, lineNoOpt, partsNoOpt);
+ this.parseRouterDigestLine(line, partsNoOpt);
break;
case ROUTER_DIGEST_SHA256:
- this.parseRouterDigestSha256Line(line, lineNoOpt, partsNoOpt);
+ this.parseRouterDigestSha256Line(line, partsNoOpt);
break;
case CRYPTO_BEGIN:
cryptoLines = new ArrayList<>();
@@ -281,7 +281,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
}
}
- private void parseExtraInfoLine(String line, String lineNoOpt,
+ private void parseExtraInfoLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 3) {
throw new DescriptorParseException("Illegal line '" + line
@@ -292,25 +292,25 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
partsNoOpt[2]);
}
- private void parsePublishedLine(String line, String lineNoOpt,
+ private void parsePublishedLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.publishedMillis = ParseHelper.parseTimestampAtIndex(line,
partsNoOpt, 1, 2);
}
- private void parseReadHistoryLine(String line, String lineNoOpt,
+ private void parseReadHistoryLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
- this.readHistory = new BandwidthHistoryImpl(line, lineNoOpt,
+ this.readHistory = new BandwidthHistoryImpl(line,
partsNoOpt);
}
- private void parseWriteHistoryLine(String line, String lineNoOpt,
+ private void parseWriteHistoryLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
- this.writeHistory = new BandwidthHistoryImpl(line, lineNoOpt,
+ this.writeHistory = new BandwidthHistoryImpl(line,
partsNoOpt);
}
- private void parseGeoipDbDigestLine(String line, String lineNoOpt,
+ private void parseGeoipDbDigestLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length < 2) {
throw new DescriptorParseException("Illegal line '" + line
@@ -320,7 +320,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
partsNoOpt[1]);
}
- private void parseGeoip6DbDigestLine(String line, String lineNoOpt,
+ private void parseGeoip6DbDigestLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length < 2) {
throw new DescriptorParseException("Illegal line '" + line
@@ -330,7 +330,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
partsNoOpt[1]);
}
- private void parseGeoipStartTimeLine(String line, String lineNoOpt,
+ private void parseGeoipStartTimeLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length < 3) {
throw new DescriptorParseException("Illegal line '" + line
@@ -340,14 +340,14 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
partsNoOpt, 1, 2);
}
- private void parseGeoipClientOriginsLine(String line, String lineNoOpt,
+ private void parseGeoipClientOriginsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.geoipClientOrigins =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 2);
}
- private void parseDirreqStatsEndLine(String line, String lineNoOpt,
+ private void parseDirreqStatsEndLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
long[] parsedStatsEndData = this.parseStatsEndLine(line, partsNoOpt,
5);
@@ -373,38 +373,38 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
return result;
}
- private void parseDirreqV2IpsLine(String line, String lineNoOpt,
+ private void parseDirreqV2IpsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV2Ips = ParseHelper.parseCommaSeparatedKeyIntegerValueList(
line, partsNoOpt, 1, 2);
}
- private void parseDirreqV3IpsLine(String line, String lineNoOpt,
+ private void parseDirreqV3IpsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV3Ips = ParseHelper.parseCommaSeparatedKeyIntegerValueList(
line, partsNoOpt, 1, 2);
}
- private void parseDirreqV2ReqsLine(String line, String lineNoOpt,
+ private void parseDirreqV2ReqsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV2Reqs =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 2);
}
- private void parseDirreqV3ReqsLine(String line, String lineNoOpt,
+ private void parseDirreqV3ReqsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV3Reqs =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 2);
}
- private void parseDirreqV2ShareLine(String line, String lineNoOpt,
+ private void parseDirreqV2ShareLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV2Share = this.parseShareLine(line, partsNoOpt);
}
- private void parseDirreqV3ShareLine(String line, String lineNoOpt,
+ private void parseDirreqV3ShareLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV3Share = this.parseShareLine(line, partsNoOpt);
}
@@ -428,61 +428,61 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
return share;
}
- private void parseDirreqV2RespLine(String line, String lineNoOpt,
+ private void parseDirreqV2RespLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV2Resp =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 0);
}
- private void parseDirreqV3RespLine(String line, String lineNoOpt,
+ private void parseDirreqV3RespLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV3Resp =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 0);
}
- private void parseDirreqV2DirectDlLine(String line, String lineNoOpt,
+ private void parseDirreqV2DirectDlLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV2DirectDl =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 0);
}
- private void parseDirreqV3DirectDlLine(String line, String lineNoOpt,
+ private void parseDirreqV3DirectDlLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV3DirectDl =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 0);
}
- private void parseDirreqV2TunneledDlLine(String line, String lineNoOpt,
+ private void parseDirreqV2TunneledDlLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV2TunneledDl =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 0);
}
- private void parseDirreqV3TunneledDlLine(String line, String lineNoOpt,
+ private void parseDirreqV3TunneledDlLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.dirreqV3TunneledDl =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(
line,partsNoOpt, 1, 0);
}
- private void parseDirreqReadHistoryLine(String line, String lineNoOpt,
+ private void parseDirreqReadHistoryLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
- this.dirreqReadHistory = new BandwidthHistoryImpl(line, lineNoOpt,
+ this.dirreqReadHistory = new BandwidthHistoryImpl(line,
partsNoOpt);
}
- private void parseDirreqWriteHistoryLine(String line, String lineNoOpt,
+ private void parseDirreqWriteHistoryLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
- this.dirreqWriteHistory = new BandwidthHistoryImpl(line, lineNoOpt,
+ this.dirreqWriteHistory = new BandwidthHistoryImpl(line,
partsNoOpt);
}
- private void parseEntryStatsEndLine(String line, String lineNoOpt,
+ private void parseEntryStatsEndLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
long[] parsedStatsEndData = this.parseStatsEndLine(line, partsNoOpt,
5);
@@ -490,13 +490,13 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.entryStatsIntervalLength = parsedStatsEndData[1];
}
- private void parseEntryIpsLine(String line, String lineNoOpt,
+ private void parseEntryIpsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.entryIps = ParseHelper.parseCommaSeparatedKeyIntegerValueList(
line, partsNoOpt, 1, 2);
}
- private void parseCellStatsEndLine(String line, String lineNoOpt,
+ private void parseCellStatsEndLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
long[] parsedStatsEndData = this.parseStatsEndLine(line, partsNoOpt,
5);
@@ -504,7 +504,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.cellStatsIntervalLength = parsedStatsEndData[1];
}
- private void parseCellProcessedCellsLine(String line, String lineNoOpt,
+ private void parseCellProcessedCellsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.cellProcessedCells = ParseHelper
.parseCommaSeparatedIntegerValueList(line, partsNoOpt, 1);
@@ -514,7 +514,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
}
}
- private void parseCellQueuedCellsLine(String line, String lineNoOpt,
+ private void parseCellQueuedCellsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.cellQueuedCells = ParseHelper.parseCommaSeparatedDoubleValueList(
line, partsNoOpt, 1);
@@ -524,7 +524,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
}
}
- private void parseCellTimeInQueueLine(String line, String lineNoOpt,
+ private void parseCellTimeInQueueLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.cellTimeInQueue = ParseHelper
.parseCommaSeparatedIntegerValueList(line, partsNoOpt, 1);
@@ -535,7 +535,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
}
private void parseCellCircuitsPerDecileLine(String line,
- String lineNoOpt, String[] partsNoOpt)
+ String[] partsNoOpt)
throws DescriptorParseException {
int circuits = -1;
if (partsNoOpt.length >= 2) {
@@ -551,7 +551,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.cellCircuitsPerDecile = circuits;
}
- private void parseConnBiDirectLine(String line, String lineNoOpt,
+ private void parseConnBiDirectLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
long[] parsedStatsEndData = this.parseStatsEndLine(line, partsNoOpt,
6);
@@ -569,7 +569,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.connBiDirectBoth = parsedConnBiDirectStats[3];
}
- private void parseExitStatsEndLine(String line, String lineNoOpt,
+ private void parseExitStatsEndLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
long[] parsedStatsEndData = this.parseStatsEndLine(line, partsNoOpt,
5);
@@ -578,7 +578,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
}
private void parseExitKibibytesWrittenLine(String line,
- String lineNoOpt, String[] partsNoOpt)
+ String[] partsNoOpt)
throws DescriptorParseException {
this.exitKibibytesWritten = this.sortByPorts(ParseHelper
.parseCommaSeparatedKeyLongValueList(line, partsNoOpt, 1, 0));
@@ -586,7 +586,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.verifyBytesOrStreams(line, this.exitKibibytesWritten.values());
}
- private void parseExitKibibytesReadLine(String line, String lineNoOpt,
+ private void parseExitKibibytesReadLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.exitKibibytesRead = this.sortByPorts(ParseHelper
.parseCommaSeparatedKeyLongValueList(line, partsNoOpt, 1, 0));
@@ -594,7 +594,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.verifyBytesOrStreams(line, this.exitKibibytesRead.values());
}
- private void parseExitStreamsOpenedLine(String line, String lineNoOpt,
+ private void parseExitStreamsOpenedLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.exitStreamsOpened = this.sortByPorts(ParseHelper
.parseCommaSeparatedKeyLongValueList(line, partsNoOpt, 1, 0));
@@ -667,7 +667,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
}
}
- private void parseBridgeStatsEndLine(String line, String lineNoOpt,
+ private void parseBridgeStatsEndLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
long[] parsedStatsEndData = this.parseStatsEndLine(line, partsNoOpt,
5);
@@ -675,28 +675,28 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.bridgeStatsIntervalLength = parsedStatsEndData[1];
}
- private void parseBridgeStatsIpsLine(String line, String lineNoOpt,
+ private void parseBridgeStatsIpsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.bridgeIps =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 2);
}
- private void parseBridgeIpVersionsLine(String line, String lineNoOpt,
+ private void parseBridgeIpVersionsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.bridgeIpVersions =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 2);
}
- private void parseBridgeIpTransportsLine(String line, String lineNoOpt,
+ private void parseBridgeIpTransportsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.bridgeIpTransports =
ParseHelper.parseCommaSeparatedKeyIntegerValueList(line,
partsNoOpt, 1, 0);
}
- private void parseTransportLine(String line, String lineNoOpt,
+ private void parseTransportLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length < 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -704,7 +704,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.transports.add(partsNoOpt[1]);
}
- private void parseHidservStatsEndLine(String line, String lineNoOpt,
+ private void parseHidservStatsEndLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
long[] parsedStatsEndData = this.parseStatsEndLine(line, partsNoOpt,
5);
@@ -713,7 +713,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
}
private void parseHidservRendRelayedCellsLine(String line,
- String lineNoOpt, String[] partsNoOpt)
+ String[] partsNoOpt)
throws DescriptorParseException {
if (partsNoOpt.length < 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -729,7 +729,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
}
private void parseHidservDirOnionsSeenLine(String line,
- String lineNoOpt, String[] partsNoOpt)
+ String[] partsNoOpt)
throws DescriptorParseException {
if (partsNoOpt.length < 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -744,7 +744,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
partsNoOpt, 2);
}
- private void parsePaddingCountsLine(String line, String lineNoOpt,
+ private void parsePaddingCountsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
long[] parsedStatsEndData = this.parseStatsEndLine(line, partsNoOpt,
6);
@@ -754,14 +754,14 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
line, partsNoOpt, 5);
}
- private void parseRouterSignatureLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseRouterSignatureLine(String line, String lineNoOpt)
+ throws DescriptorParseException {
if (!lineNoOpt.equals("router-signature")) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parseRouterDigestLine(String line, String lineNoOpt,
+ private void parseRouterDigestLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -770,7 +770,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
partsNoOpt[1]));
}
- private void parseIdentityEd25519Line(String line, String lineNoOpt,
+ private void parseIdentityEd25519Line(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 1) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -790,7 +790,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.masterKeyEd25519 = masterKeyEd25519FromIdentityEd25519;
}
- private void parseMasterKeyEd25519Line(String line, String lineNoOpt,
+ private void parseMasterKeyEd25519Line(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -804,7 +804,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.masterKeyEd25519 = masterKeyEd25519FromMasterKeyEd25519Line;
}
- private void parseRouterSigEd25519Line(String line, String lineNoOpt,
+ private void parseRouterSigEd25519Line(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -812,7 +812,7 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
this.routerSignatureEd25519 = partsNoOpt[1];
}
- private void parseRouterDigestSha256Line(String line, String lineNoOpt,
+ private void parseRouterDigestSha256Line(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
diff --git a/src/main/java/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java b/src/main/java/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java
index f869918..4472875 100644
--- a/src/main/java/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/NetworkStatusEntryImpl.java
@@ -95,10 +95,10 @@ public class NetworkStatusEntryImpl implements NetworkStatusEntry {
this.parseALine(line, parts);
break;
case S:
- this.parseSLine(line, parts);
+ this.parseSLine(parts);
break;
case V:
- this.parseVLine(line, parts);
+ this.parseVLine(line);
break;
case PR:
this.parsePrLine(line, parts);
@@ -164,7 +164,7 @@ public class NetworkStatusEntryImpl implements NetworkStatusEntry {
private static Map<Integer, String> flagStrings = new HashMap<>();
- private void parseSLine(String line, String[] parts)
+ private void parseSLine(String[] parts)
throws DescriptorParseException {
this.parsedAtMostOnceKey(Key.S);
BitSet flags = new BitSet(flagIndexes.size());
@@ -179,7 +179,7 @@ public class NetworkStatusEntryImpl implements NetworkStatusEntry {
this.flags = flags;
}
- private void parseVLine(String line, String[] parts)
+ private void parseVLine(String line)
throws DescriptorParseException {
this.parsedAtMostOnceKey(Key.V);
String noOptLine = line;
diff --git a/src/main/java/org/torproject/descriptor/impl/RelayDirectoryImpl.java b/src/main/java/org/torproject/descriptor/impl/RelayDirectoryImpl.java
index 4c457f8..590b7ab 100644
--- a/src/main/java/org/torproject/descriptor/impl/RelayDirectoryImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/RelayDirectoryImpl.java
@@ -97,7 +97,7 @@ public class RelayDirectoryImpl extends DescriptorImpl
Key key = Key.get(partsNoOpt[0]);
switch (key) {
case SIGNED_DIRECTORY:
- this.parseSignedDirectoryLine(line, lineNoOpt, partsNoOpt);
+ this.parseSignedDirectoryLine(line, lineNoOpt);
break;
case PUBLISHED:
if (publishedLine != null) {
@@ -109,11 +109,11 @@ public class RelayDirectoryImpl extends DescriptorImpl
}
break;
case DIR_SIGNING_KEY:
- this.parseDirSigningKeyLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirSigningKeyLine(line, partsNoOpt);
nextCrypto = key;
break;
case RECOMMENDED_SOFTWARE:
- this.parseRecommendedSoftwareLine(line, lineNoOpt, partsNoOpt);
+ this.parseRecommendedSoftwareLine(line, partsNoOpt);
break;
case RUNNING_ROUTERS:
runningRoutersLine = line;
@@ -157,7 +157,7 @@ public class RelayDirectoryImpl extends DescriptorImpl
? publishedLine.substring(Key.OPT.keyword.length() + 1)
: publishedLine;
String[] publishedPartsNoOpt = publishedLineNoOpt.split("[ \t]+");
- this.parsePublishedLine(publishedLine, publishedLineNoOpt,
+ this.parsePublishedLine(publishedLine,
publishedPartsNoOpt);
}
if (routerStatusLine != null) {
@@ -167,7 +167,7 @@ public class RelayDirectoryImpl extends DescriptorImpl
: routerStatusLine;
String[] routerStatusPartsNoOpt =
routerStatusLineNoOpt.split("[ \t]+");
- this.parseRouterStatusLine(routerStatusLine, routerStatusLineNoOpt,
+ this.parseRouterStatusLine(
routerStatusPartsNoOpt);
} else if (runningRoutersLine != null) {
String runningRoutersLineNoOpt =
@@ -176,8 +176,8 @@ public class RelayDirectoryImpl extends DescriptorImpl
: runningRoutersLine;
String[] runningRoutersPartsNoOpt =
runningRoutersLineNoOpt.split("[ \t]+");
- this.parseRunningRoutersLine(runningRoutersLine,
- runningRoutersLineNoOpt, runningRoutersPartsNoOpt);
+ this.parseRunningRoutersLine(
+ runningRoutersPartsNoOpt);
} else {
throw new DescriptorParseException("Either running-routers or "
+ "router-status line must be given.");
@@ -208,7 +208,7 @@ public class RelayDirectoryImpl extends DescriptorImpl
Key key = Key.get(partsNoOpt[0]);
switch (key) {
case DIRECTORY_SIGNATURE:
- this.parseDirectorySignatureLine(line, lineNoOpt, partsNoOpt);
+ this.parseDirectorySignatureLine(line, partsNoOpt);
nextCrypto = key;
break;
case CRYPTO_BEGIN:
@@ -240,20 +240,20 @@ public class RelayDirectoryImpl extends DescriptorImpl
}
}
- private void parseSignedDirectoryLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseSignedDirectoryLine(String line, String lineNoOpt)
+ throws DescriptorParseException {
if (!lineNoOpt.equals(Key.SIGNED_DIRECTORY.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parsePublishedLine(String line, String lineNoOpt,
+ private void parsePublishedLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.publishedMillis = ParseHelper.parseTimestampAtIndex(line,
partsNoOpt, 1, 2);
}
- private void parseDirSigningKeyLine(String line, String lineNoOpt,
+ private void parseDirSigningKeyLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length > 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -276,7 +276,7 @@ public class RelayDirectoryImpl extends DescriptorImpl
}
}
- private void parseRecommendedSoftwareLine(String line, String lineNoOpt,
+ private void parseRecommendedSoftwareLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
List<String> result = new ArrayList<>();
if (partsNoOpt.length > 2) {
@@ -296,8 +296,8 @@ public class RelayDirectoryImpl extends DescriptorImpl
this.recommendedSoftware = result;
}
- private void parseRunningRoutersLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseRunningRoutersLine(String[] partsNoOpt)
+ throws DescriptorParseException {
for (int i = 1; i < partsNoOpt.length; i++) {
String part = partsNoOpt[i];
String debugLine = "running-routers [...] " + part + " [...]";
@@ -322,8 +322,8 @@ public class RelayDirectoryImpl extends DescriptorImpl
}
}
- private void parseRouterStatusLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseRouterStatusLine(String[] partsNoOpt)
+ throws DescriptorParseException {
for (int i = 1; i < partsNoOpt.length; i++) {
String part = partsNoOpt[i];
String debugLine = "router-status [...] " + part + " [...]";
@@ -372,7 +372,7 @@ public class RelayDirectoryImpl extends DescriptorImpl
}
}
- private void parseDirectorySignatureLine(String line, String lineNoOpt,
+ private void parseDirectorySignatureLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length < 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
diff --git a/src/main/java/org/torproject/descriptor/impl/RelayNetworkStatusImpl.java b/src/main/java/org/torproject/descriptor/impl/RelayNetworkStatusImpl.java
index 6158a54..a531395 100644
--- a/src/main/java/org/torproject/descriptor/impl/RelayNetworkStatusImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/RelayNetworkStatusImpl.java
@@ -49,7 +49,7 @@ public class RelayNetworkStatusImpl extends NetworkStatusImpl
Key key = Key.get(parts[0]);
switch (key) {
case NETWORK_STATUS_VERSION:
- this.parseNetworkStatusVersionLine(line, parts);
+ this.parseNetworkStatusVersionLine(line);
break;
case DIR_SOURCE:
this.parseDirSourceLine(line, parts);
@@ -58,10 +58,10 @@ public class RelayNetworkStatusImpl extends NetworkStatusImpl
this.parseFingerprintLine(line, parts);
break;
case CONTACT:
- this.parseContactLine(line, parts);
+ this.parseContactLine(line);
break;
case DIR_SIGNING_KEY:
- this.parseDirSigningKeyLine(line, parts);
+ this.parseDirSigningKeyLine(line);
nextCrypto = key;
break;
case CLIENT_VERSIONS:
@@ -74,7 +74,7 @@ public class RelayNetworkStatusImpl extends NetworkStatusImpl
this.parsePublishedLine(line, parts);
break;
case DIR_OPTIONS:
- this.parseDirOptionsLine(line, parts);
+ this.parseDirOptionsLine(parts);
break;
case CRYPTO_BEGIN:
crypto = new StringBuilder();
@@ -154,7 +154,7 @@ public class RelayNetworkStatusImpl extends NetworkStatusImpl
}
}
- private void parseNetworkStatusVersionLine(String line, String[] parts)
+ private void parseNetworkStatusVersionLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.NETWORK_STATUS_VERSION.keyword + SP + "2")) {
throw new DescriptorParseException("Illegal network status version "
@@ -188,7 +188,7 @@ public class RelayNetworkStatusImpl extends NetworkStatusImpl
parts[1]);
}
- private void parseContactLine(String line, String[] parts)
+ private void parseContactLine(String line)
throws DescriptorParseException {
if (line.length() > Key.CONTACT.keyword.length() + 1) {
this.contactLine = line.substring(Key.CONTACT.keyword.length() + 1);
@@ -197,7 +197,7 @@ public class RelayNetworkStatusImpl extends NetworkStatusImpl
}
}
- private void parseDirSigningKeyLine(String line, String[] parts)
+ private void parseDirSigningKeyLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.DIR_SIGNING_KEY.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -222,7 +222,7 @@ public class RelayNetworkStatusImpl extends NetworkStatusImpl
1, 2);
}
- private void parseDirOptionsLine(String line, String[] parts)
+ private void parseDirOptionsLine(String[] parts)
throws DescriptorParseException {
String[] dirOptions = new String[parts.length - 1];
for (int i = 1; i < parts.length; i++) {
diff --git a/src/main/java/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java b/src/main/java/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java
index bc87c66..3373eaa 100644
--- a/src/main/java/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java
@@ -75,7 +75,7 @@ public class RelayNetworkStatusVoteImpl extends NetworkStatusImpl
Key key = Key.get(parts[0]);
switch (key) {
case NETWORK_STATUS_VERSION:
- this.parseNetworkStatusVersionLine(line, parts);
+ this.parseNetworkStatusVersionLine(line);
break;
case VOTE_STATUS:
this.parseVoteStatusLine(line, parts);
@@ -132,13 +132,13 @@ public class RelayNetworkStatusVoteImpl extends NetworkStatusImpl
this.parseDirSourceLine(line, parts);
break;
case CONTACT:
- this.parseContactLine(line, parts);
+ this.parseContactLine(line);
break;
case SHARED_RAND_PARTICIPATE:
this.parseSharedRandParticipateLine(line, parts);
break;
case SHARED_RAND_COMMIT:
- this.parseSharedRandCommitLine(line, parts);
+ this.parseSharedRandCommitLine(line);
break;
case SHARED_RAND_PREVIOUS_VALUE:
this.parseSharedRandPreviousValueLine(line, parts);
@@ -150,7 +150,8 @@ public class RelayNetworkStatusVoteImpl extends NetworkStatusImpl
this.parseDirKeyCertificateVersionLine(line, parts);
break;
case DIR_ADDRESS:
- this.parseDirAddressLine(line, parts);
+ /* Nothing new to learn here. Also, this line hasn't been observed
+ * "in the wild" yet. Maybe it's just an urban legend. */
break;
case FINGERPRINT:
this.parseFingerprintLine(line, parts);
@@ -165,19 +166,19 @@ public class RelayNetworkStatusVoteImpl extends NetworkStatusImpl
this.parseDirKeyExpiresLine(line, parts);
break;
case DIR_IDENTITY_KEY:
- this.parseDirIdentityKeyLine(line, parts);
+ this.parseDirIdentityKeyLine(line);
nextCrypto = key;
break;
case DIR_SIGNING_KEY:
- this.parseDirSigningKeyLine(line, parts);
+ this.parseDirSigningKeyLine(line);
nextCrypto = key;
break;
case DIR_KEY_CROSSCERT:
- this.parseDirKeyCrosscertLine(line, parts);
+ this.parseDirKeyCrosscertLine(line);
nextCrypto = key;
break;
case DIR_KEY_CERTIFICATION:
- this.parseDirKeyCertificationLine(line, parts);
+ this.parseDirKeyCertificationLine(line);
nextCrypto = key;
break;
case CRYPTO_BEGIN:
@@ -220,7 +221,7 @@ public class RelayNetworkStatusVoteImpl extends NetworkStatusImpl
}
}
- private void parseNetworkStatusVersionLine(String line, String[] parts)
+ private void parseNetworkStatusVersionLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.NETWORK_STATUS_VERSION.keyword + SP + "3")) {
throw new DescriptorParseException("Illegal network status version "
@@ -435,7 +436,7 @@ public class RelayNetworkStatusVoteImpl extends NetworkStatusImpl
this.orPort = ParseHelper.parsePort(line, parts[6]);
}
- private void parseContactLine(String line, String[] parts)
+ private void parseContactLine(String line)
throws DescriptorParseException {
if (line.length() > Key.CONTACT.keyword.length() + 1) {
this.contactLine = line.substring(Key.CONTACT.keyword.length() + 1);
@@ -453,7 +454,7 @@ public class RelayNetworkStatusVoteImpl extends NetworkStatusImpl
this.sharedRandParticipate = true;
}
- private void parseSharedRandCommitLine(String line, String[] parts)
+ private void parseSharedRandCommitLine(String line)
throws DescriptorParseException {
if (this.sharedRandCommitLines == null) {
this.sharedRandCommitLines = new ArrayList<>();
@@ -509,11 +510,6 @@ public class RelayNetworkStatusVoteImpl extends NetworkStatusImpl
}
}
- private void parseDirAddressLine(String line, String[] parts) {
- /* Nothing new to learn here. Also, this line hasn't been observed
- * "in the wild" yet. Maybe it's just an urban legend. */
- }
-
private void parseFingerprintLine(String line, String[] parts)
throws DescriptorParseException {
/* Nothing new to learn here. We already know the fingerprint from
@@ -547,28 +543,28 @@ public class RelayNetworkStatusVoteImpl extends NetworkStatusImpl
parts, 1, 2);
}
- private void parseDirIdentityKeyLine(String line, String[] parts)
+ private void parseDirIdentityKeyLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.DIR_IDENTITY_KEY.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parseDirSigningKeyLine(String line, String[] parts)
+ private void parseDirSigningKeyLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.DIR_SIGNING_KEY.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parseDirKeyCrosscertLine(String line, String[] parts)
+ private void parseDirKeyCrosscertLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.DIR_KEY_CROSSCERT.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parseDirKeyCertificationLine(String line, String[] parts)
+ private void parseDirKeyCertificationLine(String line)
throws DescriptorParseException {
if (!line.equals(Key.DIR_KEY_CERTIFICATION.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
diff --git a/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java
index 9c9d47a..e3b2a17 100644
--- a/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/ServerDescriptorImpl.java
@@ -67,38 +67,38 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
Key key = Key.get(partsNoOpt[0]);
switch (key) {
case ROUTER:
- this.parseRouterLine(line, lineNoOpt, partsNoOpt);
+ this.parseRouterLine(line, partsNoOpt);
break;
case OR_ADDRESS:
- this.parseOrAddressLine(line, lineNoOpt, partsNoOpt);
+ this.parseOrAddressLine(line, partsNoOpt);
break;
case BANDWIDTH:
- this.parseBandwidthLine(line, lineNoOpt, partsNoOpt);
+ this.parseBandwidthLine(line, partsNoOpt);
break;
case PLATFORM:
- this.parsePlatformLine(line, lineNoOpt, partsNoOpt);
+ this.parsePlatformLine(lineNoOpt);
break;
case PROTO:
this.parseProtoLine(line, lineNoOpt, partsNoOpt);
break;
case PUBLISHED:
- this.parsePublishedLine(line, lineNoOpt, partsNoOpt);
+ this.parsePublishedLine(line, partsNoOpt);
break;
case FINGERPRINT:
- this.parseFingerprintLine(line, lineNoOpt, partsNoOpt);
+ this.parseFingerprintLine(line, lineNoOpt);
break;
case HIBERNATING:
- this.parseHibernatingLine(line, lineNoOpt, partsNoOpt);
+ this.parseHibernatingLine(line, partsNoOpt);
break;
case UPTIME:
- this.parseUptimeLine(line, lineNoOpt, partsNoOpt);
+ this.parseUptimeLine(line, partsNoOpt);
break;
case ONION_KEY:
- this.parseOnionKeyLine(line, lineNoOpt, partsNoOpt);
+ this.parseOnionKeyLine(line, lineNoOpt);
nextCrypto = key;
break;
case SIGNING_KEY:
- this.parseSigningKeyLine(line, lineNoOpt, partsNoOpt);
+ this.parseSigningKeyLine(line, lineNoOpt);
nextCrypto = key;
break;
case ACCEPT:
@@ -108,74 +108,74 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.parseRejectLine(line, lineNoOpt, partsNoOpt);
break;
case ROUTER_SIGNATURE:
- this.parseRouterSignatureLine(line, lineNoOpt, partsNoOpt);
+ this.parseRouterSignatureLine(line, lineNoOpt);
nextCrypto = key;
break;
case CONTACT:
- this.parseContactLine(line, lineNoOpt, partsNoOpt);
+ this.parseContactLine(lineNoOpt);
break;
case FAMILY:
- this.parseFamilyLine(line, lineNoOpt, partsNoOpt);
+ this.parseFamilyLine(line, partsNoOpt);
break;
case READ_HISTORY:
- this.parseReadHistoryLine(line, lineNoOpt, partsNoOpt);
+ this.parseReadHistoryLine(line, partsNoOpt);
break;
case WRITE_HISTORY:
- this.parseWriteHistoryLine(line, lineNoOpt, partsNoOpt);
+ this.parseWriteHistoryLine(line, partsNoOpt);
break;
case EVENTDNS:
- this.parseEventdnsLine(line, lineNoOpt, partsNoOpt);
+ this.parseEventdnsLine(line, partsNoOpt);
break;
case CACHES_EXTRA_INFO:
- this.parseCachesExtraInfoLine(line, lineNoOpt, partsNoOpt);
+ this.parseCachesExtraInfoLine(line, lineNoOpt);
break;
case EXTRA_INFO_DIGEST:
- this.parseExtraInfoDigestLine(line, lineNoOpt, partsNoOpt);
+ this.parseExtraInfoDigestLine(line, partsNoOpt);
break;
case HIDDEN_SERVICE_DIR:
- this.parseHiddenServiceDirLine(line, lineNoOpt, partsNoOpt);
+ this.parseHiddenServiceDirLine();
break;
case PROTOCOLS:
- this.parseProtocolsLine(line, lineNoOpt, partsNoOpt);
+ this.parseProtocolsLine(line, partsNoOpt);
break;
case ALLOW_SINGLE_HOP_EXITS:
- this.parseAllowSingleHopExitsLine(line, lineNoOpt, partsNoOpt);
+ this.parseAllowSingleHopExitsLine(line, lineNoOpt);
break;
case DIRCACHEPORT:
- this.parseDircacheportLine(line, lineNoOpt, partsNoOpt);
+ this.parseDircacheportLine(line, partsNoOpt);
break;
case ROUTER_DIGEST:
- this.parseRouterDigestLine(line, lineNoOpt, partsNoOpt);
+ this.parseRouterDigestLine(line, partsNoOpt);
break;
case ROUTER_DIGEST_SHA256:
- this.parseRouterDigestSha256Line(line, lineNoOpt, partsNoOpt);
+ this.parseRouterDigestSha256Line(line, partsNoOpt);
break;
case IPV6_POLICY:
- this.parseIpv6PolicyLine(line, lineNoOpt, partsNoOpt);
+ this.parseIpv6PolicyLine(line, partsNoOpt);
break;
case NTOR_ONION_KEY:
- this.parseNtorOnionKeyLine(line, lineNoOpt, partsNoOpt);
+ this.parseNtorOnionKeyLine(line, partsNoOpt);
break;
case IDENTITY_ED25519:
- this.parseIdentityEd25519Line(line, lineNoOpt, partsNoOpt);
+ this.parseIdentityEd25519Line(line, partsNoOpt);
nextCrypto = key;
break;
case MASTER_KEY_ED25519:
- this.parseMasterKeyEd25519Line(line, lineNoOpt, partsNoOpt);
+ this.parseMasterKeyEd25519Line(line, partsNoOpt);
break;
case ROUTER_SIG_ED25519:
- this.parseRouterSigEd25519Line(line, lineNoOpt, partsNoOpt);
+ this.parseRouterSigEd25519Line(line, partsNoOpt);
break;
case ONION_KEY_CROSSCERT:
- this.parseOnionKeyCrosscert(line, lineNoOpt, partsNoOpt);
+ this.parseOnionKeyCrosscert(line, partsNoOpt);
nextCrypto = key;
break;
case NTOR_ONION_KEY_CROSSCERT:
- this.parseNtorOnionKeyCrosscert(line, lineNoOpt, partsNoOpt);
+ this.parseNtorOnionKeyCrosscert(line, partsNoOpt);
nextCrypto = key;
break;
case TUNNELLED_DIR_SERVER:
- this.parseTunnelledDirServerLine(line, lineNoOpt, partsNoOpt);
+ this.parseTunnelledDirServerLine(line, lineNoOpt);
break;
case CRYPTO_BEGIN:
cryptoLines = new ArrayList<>();
@@ -232,7 +232,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
}
}
- private void parseRouterLine(String line, String lineNoOpt,
+ private void parseRouterLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 6) {
throw new DescriptorParseException("Illegal line '" + line
@@ -245,7 +245,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.dirPort = ParseHelper.parsePort(line, partsNoOpt[5]);
}
- private void parseOrAddressLine(String line, String lineNoOpt,
+ private void parseOrAddressLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Wrong number of values in line "
@@ -255,7 +255,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.orAddresses.add(partsNoOpt[1]);
}
- private void parseBandwidthLine(String line, String lineNoOpt,
+ private void parseBandwidthLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length < 3 || partsNoOpt.length > 4) {
throw new DescriptorParseException("Wrong number of values in line "
@@ -286,8 +286,8 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
}
}
- private void parsePlatformLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parsePlatformLine(String lineNoOpt)
+ throws DescriptorParseException {
if (lineNoOpt.length() > Key.PLATFORM.keyword.length() + 1) {
this.platform = lineNoOpt.substring(Key.PLATFORM.keyword.length() + 1);
} else {
@@ -301,14 +301,14 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
partsNoOpt);
}
- private void parsePublishedLine(String line, String lineNoOpt,
+ private void parsePublishedLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
this.publishedMillis = ParseHelper.parseTimestampAtIndex(line,
partsNoOpt, 1, 2);
}
- private void parseFingerprintLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseFingerprintLine(String line, String lineNoOpt)
+ throws DescriptorParseException {
if (lineNoOpt.length() != Key.FINGERPRINT.keyword.length() + 5 * 10) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
@@ -317,7 +317,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
.replaceAll(SP, ""));
}
- private void parseHibernatingLine(String line, String lineNoOpt,
+ private void parseHibernatingLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -325,7 +325,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.hibernating = ParseHelper.parseBoolean(partsNoOpt[1], line);
}
- private void parseUptimeLine(String line, String lineNoOpt,
+ private void parseUptimeLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Wrong number of values in line "
@@ -344,15 +344,15 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
}
}
- private void parseOnionKeyLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseOnionKeyLine(String line, String lineNoOpt)
+ throws DescriptorParseException {
if (!lineNoOpt.equals(Key.ONION_KEY.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parseSigningKeyLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseSigningKeyLine(String line, String lineNoOpt)
+ throws DescriptorParseException {
if (!lineNoOpt.equals(Key.SIGNING_KEY.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
@@ -377,15 +377,15 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.exitPolicyLines.add(lineNoOpt);
}
- private void parseRouterSignatureLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseRouterSignatureLine(String line, String lineNoOpt)
+ throws DescriptorParseException {
if (!lineNoOpt.equals(Key.ROUTER_SIGNATURE.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parseContactLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseContactLine(String lineNoOpt)
+ throws DescriptorParseException {
if (lineNoOpt.length() > Key.CONTACT.keyword.length() + 1) {
this.contact = lineNoOpt.substring(Key.CONTACT.keyword.length() + 1);
} else {
@@ -393,7 +393,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
}
}
- private void parseFamilyLine(String line, String lineNoOpt,
+ private void parseFamilyLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
String[] familyEntries = new String[partsNoOpt.length - 1];
for (int i = 1; i < partsNoOpt.length; i++) {
@@ -420,19 +420,17 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.familyEntries = familyEntries;
}
- private void parseReadHistoryLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
- this.readHistory = new BandwidthHistoryImpl(line, lineNoOpt,
- partsNoOpt);
+ private void parseReadHistoryLine(String line, String[] partsNoOpt)
+ throws DescriptorParseException {
+ this.readHistory = new BandwidthHistoryImpl(line, partsNoOpt);
}
- private void parseWriteHistoryLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
- this.writeHistory = new BandwidthHistoryImpl(line, lineNoOpt,
- partsNoOpt);
+ private void parseWriteHistoryLine(String line, String[] partsNoOpt)
+ throws DescriptorParseException {
+ this.writeHistory = new BandwidthHistoryImpl(line, partsNoOpt);
}
- private void parseEventdnsLine(String line, String lineNoOpt,
+ private void parseEventdnsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -441,15 +439,15 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
line);
}
- private void parseCachesExtraInfoLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseCachesExtraInfoLine(String line, String lineNoOpt)
+ throws DescriptorParseException {
if (!lineNoOpt.equals(Key.CACHES_EXTRA_INFO.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
this.cachesExtraInfo = true;
}
- private void parseExtraInfoDigestLine(String line, String lineNoOpt,
+ private void parseExtraInfoDigestLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length < 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -462,12 +460,11 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
}
}
- private void parseHiddenServiceDirLine(String line, String lineNoOpt,
- String[] partsNoOpt) {
+ private void parseHiddenServiceDirLine() {
this.hiddenServiceDir = true;
}
- private void parseProtocolsLine(String line, String lineNoOpt,
+ private void parseProtocolsLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
int linkIndex = -1;
int circuitIndex = -1;
@@ -505,15 +502,15 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
}
}
- private void parseAllowSingleHopExitsLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseAllowSingleHopExitsLine(String line, String lineNoOpt)
+ throws DescriptorParseException {
if (!lineNoOpt.equals(Key.ALLOW_SINGLE_HOP_EXITS.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
this.allowSingleHopExits = true;
}
- private void parseDircacheportLine(String line, String lineNoOpt,
+ private void parseDircacheportLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
/* The dircacheport line was only contained in server descriptors
* published by Tor 0.0.8 and before. It's only specified in old
@@ -528,7 +525,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.dirPort = ParseHelper.parsePort(line, partsNoOpt[1]);
}
- private void parseRouterDigestLine(String line, String lineNoOpt,
+ private void parseRouterDigestLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -537,7 +534,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
line, partsNoOpt[1]));
}
- private void parseIpv6PolicyLine(String line, String lineNoOpt,
+ private void parseIpv6PolicyLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
boolean isValid = true;
if (partsNoOpt.length != 3) {
@@ -566,7 +563,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
}
}
- private void parseNtorOnionKeyLine(String line, String lineNoOpt,
+ private void parseNtorOnionKeyLine(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -574,21 +571,21 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.ntorOnionKey = partsNoOpt[1].replaceAll("=", "");
}
- private void parseIdentityEd25519Line(String line, String lineNoOpt,
+ private void parseIdentityEd25519Line(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 1) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parseOnionKeyCrosscert(String line, String lineNoOpt,
+ private void parseOnionKeyCrosscert(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 1) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
}
- private void parseNtorOnionKeyCrosscert(String line, String lineNoOpt,
+ private void parseNtorOnionKeyCrosscert(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -600,8 +597,8 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
}
}
- private void parseTunnelledDirServerLine(String line, String lineNoOpt,
- String[] partsNoOpt) throws DescriptorParseException {
+ private void parseTunnelledDirServerLine(String line, String lineNoOpt)
+ throws DescriptorParseException {
if (!lineNoOpt.equals(Key.TUNNELLED_DIR_SERVER.keyword)) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
}
@@ -621,7 +618,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.masterKeyEd25519 = masterKeyEd25519FromIdentityEd25519;
}
- private void parseMasterKeyEd25519Line(String line, String lineNoOpt,
+ private void parseMasterKeyEd25519Line(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -635,7 +632,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.masterKeyEd25519 = masterKeyEd25519FromMasterKeyEd25519Line;
}
- private void parseRouterSigEd25519Line(String line, String lineNoOpt,
+ private void parseRouterSigEd25519Line(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
@@ -643,7 +640,7 @@ public abstract class ServerDescriptorImpl extends DescriptorImpl
this.routerSignatureEd25519 = partsNoOpt[1];
}
- private void parseRouterDigestSha256Line(String line, String lineNoOpt,
+ private void parseRouterDigestSha256Line(String line,
String[] partsNoOpt) throws DescriptorParseException {
if (partsNoOpt.length != 2) {
throw new DescriptorParseException("Illegal line '" + line + "'.");
diff --git a/src/main/java/org/torproject/descriptor/impl/TorperfResultImpl.java b/src/main/java/org/torproject/descriptor/impl/TorperfResultImpl.java
index d61afec..de436b5 100644
--- a/src/main/java/org/torproject/descriptor/impl/TorperfResultImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/TorperfResultImpl.java
@@ -86,7 +86,7 @@ public class TorperfResultImpl extends DescriptorImpl
String value = keyValueParts[1];
switch (key) {
case "SOURCE":
- this.parseSource(value, keyValue, line);
+ this.parseSource(value);
break;
case "FILESIZE":
this.parseFileSize(value, keyValue, line);
@@ -152,22 +152,22 @@ public class TorperfResultImpl extends DescriptorImpl
this.parseUsedBy(value, keyValue, line);
break;
case "ENDPOINTLOCAL":
- this.parseEndpointLocal(value, keyValue, line);
+ this.parseEndpointLocal(value);
break;
case "ENDPOINTPROXY":
- this.parseEndpointProxy(value, keyValue, line);
+ this.parseEndpointProxy(value);
break;
case "ENDPOINTREMOTE":
- this.parseEndpointRemote(value, keyValue, line);
+ this.parseEndpointRemote(value);
break;
case "HOSTNAMELOCAL":
- this.parseHostnameLocal(value, keyValue, line);
+ this.parseHostnameLocal(value);
break;
case "HOSTNAMEREMOTE":
- this.parseHostnameRemote(value, keyValue, line);
+ this.parseHostnameRemote(value);
break;
case "SOURCEADDRESS":
- this.parseSourceAddress(value, keyValue, line);
+ this.parseSourceAddress(value);
break;
default:
if (key.startsWith("DATAPERC")) {
@@ -216,7 +216,7 @@ public class TorperfResultImpl extends DescriptorImpl
}
}
- private void parseSource(String value, String keyValue, String line)
+ private void parseSource(String value)
throws DescriptorParseException {
this.source = value;
}
@@ -378,27 +378,27 @@ public class TorperfResultImpl extends DescriptorImpl
this.usedBy = this.parseInt(value, keyValue, line);
}
- private void parseEndpointLocal(String value, String keyValue, String line) {
+ private void parseEndpointLocal(String value) {
this.endpointLocal = value;
}
- private void parseEndpointProxy(String value, String keyValue, String line) {
+ private void parseEndpointProxy(String value) {
this.endpointProxy = value;
}
- private void parseEndpointRemote(String value, String keyValue, String line) {
+ private void parseEndpointRemote(String value) {
this.endpointRemote = value;
}
- private void parseHostnameLocal(String value, String keyValue, String line) {
+ private void parseHostnameLocal(String value) {
this.hostnameLocal = value;
}
- private void parseHostnameRemote(String value, String keyValue, String line) {
+ private void parseHostnameRemote(String value) {
this.hostnameRemote = value;
}
- private void parseSourceAddress(String value, String keyValue, String line) {
+ private void parseSourceAddress(String value) {
this.sourceAddress = value;
}
1
0

27 Aug '18
commit ad0c33015c8ca141d99645d03a92822e369496b7
Author: Karsten Loesing <karsten.loesing(a)gmx.net>
Date: Mon Aug 20 12:34:09 2018 +0200
Replace Comparator with lambda.
---
.../descriptor/impl/ExtraInfoDescriptorImpl.java | 35 ++++++++--------------
1 file changed, 13 insertions(+), 22 deletions(-)
diff --git a/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java b/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
index ade341b..7590d47 100644
--- a/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
+++ b/src/main/java/org/torproject/descriptor/impl/ExtraInfoDescriptorImpl.java
@@ -11,7 +11,6 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
-import java.util.Comparator;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
@@ -605,28 +604,20 @@ public abstract class ExtraInfoDescriptorImpl extends DescriptorImpl
private SortedMap<String, Long> sortByPorts(
SortedMap<String, Long> naturalOrder) {
SortedMap<String, Long> byPortNumber =
- new TreeMap<>(new Comparator<String>() {
- public int compare(String arg0, String arg1) {
- int port0 = 0;
- int port1 = 0;
- try {
- port1 = Integer.parseInt(arg1);
- } catch (NumberFormatException e) {
- return -1;
- }
- try {
- port0 = Integer.parseInt(arg0);
- } catch (NumberFormatException e) {
- return 1;
- }
- if (port0 < port1) {
- return -1;
- } else if (port0 > port1) {
- return 1;
- } else {
- return 0;
- }
+ new TreeMap<>((arg0, arg1) -> {
+ int port0;
+ int port1;
+ try {
+ port1 = Integer.parseInt(arg1);
+ } catch (NumberFormatException e) {
+ return -1;
+ }
+ try {
+ port0 = Integer.parseInt(arg0);
+ } catch (NumberFormatException e) {
+ return 1;
}
+ return Integer.compare(port0, port1);
}
);
byPortNumber.putAll(naturalOrder);
1
0