[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [metrics-lib/master] Don't attempt to sort Tor versions alphanumerically.



commit 0c889f51401d9f324fc5ca4e385f6a6e65992349
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Thu Dec 15 09:29:42 2011 +0100

    Don't attempt to sort Tor versions alphanumerically.
    
    Spotted by Sebastian.
---
 .../descriptor/RelayNetworkStatusConsensus.java    |    4 ++--
 .../descriptor/RelayNetworkStatusVote.java         |    4 ++--
 .../impl/RelayNetworkStatusConsensusImpl.java      |   16 ++++++++--------
 .../impl/RelayNetworkStatusVoteImpl.java           |   20 ++++++++++----------
 4 files changed, 22 insertions(+), 22 deletions(-)

diff --git a/src/org/torproject/descriptor/RelayNetworkStatusConsensus.java b/src/org/torproject/descriptor/RelayNetworkStatusConsensus.java
index 42757ce..08ec8e4 100644
--- a/src/org/torproject/descriptor/RelayNetworkStatusConsensus.java
+++ b/src/org/torproject/descriptor/RelayNetworkStatusConsensus.java
@@ -32,11 +32,11 @@ public interface RelayNetworkStatusConsensus extends Descriptor {
 
   /* Return recommended server versions or null if the consensus doesn't
    * contain recommended server versions. */
-  public SortedSet<String> getRecommendedServerVersions();
+  public List<String> getRecommendedServerVersions();
 
   /* Return recommended client versions or null if the consensus doesn't
    * contain recommended client versions. */
-  public SortedSet<String> getRecommendedClientVersions();
+  public List<String> getRecommendedClientVersions();
 
   /* Return known relay flags. */
   public SortedSet<String> getKnownFlags();
diff --git a/src/org/torproject/descriptor/RelayNetworkStatusVote.java b/src/org/torproject/descriptor/RelayNetworkStatusVote.java
index 9ff47ec..6bfdd6f 100644
--- a/src/org/torproject/descriptor/RelayNetworkStatusVote.java
+++ b/src/org/torproject/descriptor/RelayNetworkStatusVote.java
@@ -32,11 +32,11 @@ public interface RelayNetworkStatusVote extends Descriptor {
 
   /* Return recommended server versions or null if the authority doesn't
    * recommend server versions. */
-  public SortedSet<String> getRecommendedServerVersions();
+  public List<String> getRecommendedServerVersions();
 
   /* Return recommended client versions or null if the authority doesn't
    * recommend server versions. */
-  public SortedSet<String> getRecommendedClientVersions();
+  public List<String> getRecommendedClientVersions();
 
   /* Return known relay flags. */
   public SortedSet<String> getKnownFlags();
diff --git a/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java b/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java
index 0771382..6721f4d 100644
--- a/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java
+++ b/src/org/torproject/descriptor/impl/RelayNetworkStatusConsensusImpl.java
@@ -284,9 +284,9 @@ public class RelayNetworkStatusConsensusImpl
         line, parts);
   }
 
-  private SortedSet<String> parseClientOrServerVersions(String line,
+  private List<String> parseClientOrServerVersions(String line,
       String[] parts) throws DescriptorParseException {
-    SortedSet<String> result = new TreeSet<String>();
+    List<String> result = new ArrayList<String>();
     if (parts.length == 1) {
       return result;
     } else if (parts.length > 2) {
@@ -397,16 +397,16 @@ public class RelayNetworkStatusConsensusImpl
     return this.distSeconds;
   }
 
-  private SortedSet<String> recommendedClientVersions;
-  public SortedSet<String> getRecommendedClientVersions() {
+  private List<String> recommendedClientVersions;
+  public List<String> getRecommendedClientVersions() {
     return this.recommendedClientVersions == null ? null :
-        new TreeSet<String>(this.recommendedClientVersions);
+        new ArrayList<String>(this.recommendedClientVersions);
   }
 
-  private SortedSet<String> recommendedServerVersions;
-  public SortedSet<String> getRecommendedServerVersions() {
+  private List<String> recommendedServerVersions;
+  public List<String> getRecommendedServerVersions() {
     return this.recommendedServerVersions == null ? null :
-        new TreeSet<String>(this.recommendedServerVersions);
+        new ArrayList<String>(this.recommendedServerVersions);
   }
 
   private SortedSet<String> knownFlags = new TreeSet<String>();
diff --git a/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java b/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java
index c4d3226..a7a5328 100644
--- a/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java
+++ b/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java
@@ -100,11 +100,11 @@ public class RelayNetworkStatusVoteImpl
             this.votingDelay.add(Long.parseLong(votingDelayString));
           }
         } else if (line.startsWith("client-versions ")) {
-          this.recommendedClientVersions = new TreeSet<String>(
-              Arrays.asList(line.split(" ")[1].split(",")));
+          this.recommendedClientVersions =
+              Arrays.asList(line.split(" ")[1].split(","));
         } else if (line.startsWith("server-versions ")) {
-          this.recommendedServerVersions = new TreeSet<String>(
-              Arrays.asList(line.split(" ")[1].split(",")));
+          this.recommendedServerVersions =
+              Arrays.asList(line.split(" ")[1].split(","));
         } else if (line.startsWith("known-flags ")) {
           for (String flag : line.substring("known-flags ".length()).
               split(" ")) {
@@ -238,16 +238,16 @@ public class RelayNetworkStatusVoteImpl
     return new ArrayList<Long>(this.votingDelay);
   }
 
-  private SortedSet<String> recommendedClientVersions;
-  public SortedSet<String> getRecommendedClientVersions() {
+  private List<String> recommendedClientVersions;
+  public List<String> getRecommendedClientVersions() {
     return this.recommendedClientVersions == null ? null :
-        new TreeSet<String>(this.recommendedClientVersions);
+        new ArrayList<String>(this.recommendedClientVersions);
   }
 
-  private SortedSet<String> recommendedServerVersions;
-  public SortedSet<String> getRecommendedServerVersions() {
+  private List<String> recommendedServerVersions;
+  public List<String> getRecommendedServerVersions() {
     return this.recommendedServerVersions == null ? null :
-        new TreeSet<String>(this.recommendedServerVersions);
+        new ArrayList<String>(this.recommendedServerVersions);
   }
 
   private SortedSet<String> knownFlags = new TreeSet<String>();

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits