Skip to content

Commit

Permalink
Fixed weird issue with raw exporting. Value array is empty while the …
Browse files Browse the repository at this point in the history
…data is showing it has index's. Currently assuming that this data is malformed.
  • Loading branch information
Adam8234 committed Mar 17, 2018
1 parent bdd3c72 commit 567116a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ android {
applicationId 'com.team2052.frckrawler'
minSdkVersion 19
targetSdkVersion 27
versionCode 41
versionName "3.3.1"
versionCode 42
versionName "3.3.2"
multiDexEnabled true

// Needed for support lib 23.2.0+ on pre-L devices
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,22 @@ public class CompileUtil {

if (data.has("value")) {
return data.get("value").toString();
} else {
} else if (data.has("values")) {
JsonObject metricData = JSON.getAsJsonObject(metric.getData());
JsonArray dataIndexes = data.getAsJsonArray("values");
JsonArray valueArray = metricData.getAsJsonArray("values");
List<String> selected = Lists.newArrayListWithExpectedSize(dataIndexes.size());
for (int i = 0; i < dataIndexes.size(); i++) {
int dataIndex = dataIndexes.get(i).getAsInt();
selected.add(valueArray.get(dataIndex).toString());
if (valueArray.size() > 0) {
for (int i = 0; i < dataIndexes.size(); i++) {
int dataIndex = dataIndexes.get(i).getAsInt();
selected.add(valueArray.get(dataIndex).toString());
}
return Joiner.on(", ").join(selected);
} else {
return "";
}
return Joiner.on(", ").join(selected);
}
return "";
};

public static Func1<List<MetricValue>, CompiledMetricValue> metricValuesToCompiledValue(Robot robot, Metric metric, float compileWeight) {
Expand Down

0 comments on commit 567116a

Please sign in to comment.