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

[or-cvs] [ernie/master] Correct negative bridge user numbers.



Author: Karsten Loesing <karsten.loesing@xxxxxxx>
Date: Tue, 25 May 2010 17:14:37 +0200
Subject: Correct negative bridge user numbers.
Commit: 4c60b02717923f139bf409153600c287008d4d3c

---
 src/BridgeStatsFileHandler.java |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/BridgeStatsFileHandler.java b/src/BridgeStatsFileHandler.java
index 9960481..9a2c6c9 100644
--- a/src/BridgeStatsFileHandler.java
+++ b/src/BridgeStatsFileHandler.java
@@ -248,7 +248,8 @@ public class BridgeStatsFileHandler {
     String key = hashedIdentity + "," + date;
     StringBuilder sb = new StringBuilder(key + "," + time);
     for (String c : countries) {
-      sb.append("," + (obs.containsKey(c) ? obs.get(c) : "0.0"));
+      sb.append("," + (obs.containsKey(c) && !obs.get(c).startsWith("-")
+          ? obs.get(c) : "0.0"));
     }
     String value = sb.toString();
     if (!this.bridgeUsersRaw.containsKey(key)) {
-- 
1.6.5