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

[tor-commits] [metrics-lib/master] Make the vote and consensus interfaces more similar.



commit cb3934aa8c76bf4229572e366647c002d0aa161f
Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date:   Thu Dec 15 09:18:57 2011 +0100

    Make the vote and consensus interfaces more similar.
---
 .../descriptor/RelayNetworkStatusVote.java         |    2 +-
 .../impl/RelayNetworkStatusVoteImpl.java           |   10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/org/torproject/descriptor/RelayNetworkStatusVote.java b/src/org/torproject/descriptor/RelayNetworkStatusVote.java
index f591c10..9ff47ec 100644
--- a/src/org/torproject/descriptor/RelayNetworkStatusVote.java
+++ b/src/org/torproject/descriptor/RelayNetworkStatusVote.java
@@ -42,7 +42,7 @@ public interface RelayNetworkStatusVote extends Descriptor {
   public SortedSet<String> getKnownFlags();
 
   /* Return consensus parameters. */
-  public SortedMap<String, String> getConsensusParams();
+  public SortedMap<String, Integer> getConsensusParams();
 
   /* Return the directory nickname. */
   public String getNickname();
diff --git a/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java b/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java
index 238a512..c4d3226 100644
--- a/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java
+++ b/src/org/torproject/descriptor/impl/RelayNetworkStatusVoteImpl.java
@@ -115,7 +115,7 @@ public class RelayNetworkStatusVoteImpl
             for (String param :
                 line.substring("params ".length()).split(" ")) {
               String paramName = param.split("=")[0];
-              String paramValue = param.split("=")[1];
+              int paramValue = Integer.parseInt(param.split("=")[1]);
               this.consensusParams.put(paramName, paramValue);
             }
           }
@@ -255,10 +255,10 @@ public class RelayNetworkStatusVoteImpl
     return new TreeSet<String>(this.knownFlags);
   }
 
-  private SortedMap<String, String> consensusParams =
-      new TreeMap<String, String>();
-  public SortedMap<String, String> getConsensusParams() {
-    return new TreeMap<String, String>(this.consensusParams);
+  private SortedMap<String, Integer> consensusParams =
+      new TreeMap<String, Integer>();
+  public SortedMap<String, Integer> getConsensusParams() {
+    return new TreeMap<String, Integer>(this.consensusParams);
   }
 
   private String nickname;



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