[tor-commits] [onionoo/master] Replace addAll with parameterized constructor call.
karsten at torproject.org
karsten at torproject.org
Mon Aug 27 12:34:52 UTC 2018
commit c8c64e8833d1003219a7e396e63ca44fa9ef299e
Author: Karsten Loesing <karsten.loesing at gmx.net>
Date: Mon Aug 20 16:24:40 2018 +0200
Replace addAll with parameterized constructor call.
---
src/main/java/org/torproject/onionoo/docs/UptimeHistory.java | 3 +--
.../java/org/torproject/onionoo/updater/DummyDescriptorSource.java | 4 ++--
2 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java b/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
index 8ddfc2b..ef73a1c 100644
--- a/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
+++ b/src/main/java/org/torproject/onionoo/docs/UptimeHistory.java
@@ -88,8 +88,7 @@ public class UptimeHistory implements Comparable<UptimeHistory> {
}
SortedSet<String> flags = null;
if (parts[0].equals("R")) {
- flags = new TreeSet<>();
- flags.addAll(Arrays.asList(parts).subList(3, parts.length));
+ flags = new TreeSet<>(Arrays.asList(parts).subList(3, parts.length));
}
return new UptimeHistory(relay, startMillis, uptimeHours, flags);
}
diff --git a/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java b/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java
index c985090..22ae477 100644
--- a/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java
+++ b/src/test/java/org/torproject/onionoo/updater/DummyDescriptorSource.java
@@ -52,8 +52,8 @@ public class DummyDescriptorSource extends DescriptorSource {
@Override
public void readDescriptors() {
- Set<DescriptorType> descriptorTypes = new HashSet<>();
- descriptorTypes.addAll(this.descriptorListeners.keySet());
+ Set<DescriptorType> descriptorTypes = new HashSet<>(
+ this.descriptorListeners.keySet());
for (DescriptorType descriptorType : descriptorTypes) {
boolean relay;
switch (descriptorType) {
More information about the tor-commits
mailing list