[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [onionoo/master] Replace addAll with parameterized constructor call.
commit c8c64e8833d1003219a7e396e63ca44fa9ef299e
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
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) {
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits