diff options
author | Godin <mandrikov@gmail.com> | 2010-12-13 09:45:39 +0000 |
---|---|---|
committer | Godin <mandrikov@gmail.com> | 2010-12-13 09:45:39 +0000 |
commit | 53fc4e95247f3fda3becde6bd5b4279a66255c97 (patch) | |
tree | 15e0753fa7ea4183ace82629fed56d701b28f24f /sonar-ws-client/src/main/java/org/sonar/wsclient | |
parent | ab1f321e58cea13e35fd9986de416512c6e51c59 (diff) | |
download | sonarqube-53fc4e95247f3fda3becde6bd5b4279a66255c97.tar.gz sonarqube-53fc4e95247f3fda3becde6bd5b4279a66255c97.zip |
SONAR-833: New Web Service to get history of measures (time machine)
Diffstat (limited to 'sonar-ws-client/src/main/java/org/sonar/wsclient')
-rw-r--r-- | sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java index b9d5eb60be7..8887da9abd2 100644 --- a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java +++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/TimeMachineUnmarshaller.java @@ -5,10 +5,7 @@ import org.json.simple.JSONObject; import org.json.simple.JSONValue; import org.sonar.wsclient.services.TimeMachineData; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class TimeMachineUnmarshaller implements Unmarshaller<TimeMachineData> { @@ -17,7 +14,13 @@ public class TimeMachineUnmarshaller implements Unmarshaller<TimeMachineData> { Map<Date, List<String>> data = new HashMap<Date, List<String>>(); for (Object key : map.keySet()) { JSONArray array = (JSONArray) map.get(key); - data.put(JsonUtils.parseDateTime((String) key), array); + List<String> values = new ArrayList<String>(); + for (int i = 0; i < array.size(); i++) { + Object elem = array.get(i); + String value = elem == null ? null : elem.toString(); + values.add(value); + } + data.put(JsonUtils.parseDateTime((String) key), values); } return new TimeMachineData().setData(data); } |