TreeMap<String, FileData> map = new TreeMap<String, FileData>();
try {
NativeObject json = (NativeObject) parser.parseValue(data);
for (Object scriptURI : json.keySet()) {
NativeObject scriptData = (NativeObject) json.get(scriptURI);
NativeArray lineCoverageArray = (NativeArray) scriptData.get("lineData");
NativeObject branchJSONArray = (NativeObject) scriptData.get("branchData");
List<Integer> countData = new ArrayList<Integer>(lineCoverageArray.size());
for (int i = 0; i < lineCoverageArray.size(); i++)
countData.add((Integer) lineCoverageArray.get(i));
// Function Coverage (HA-CA)
NativeArray functionCoverageArray = (NativeArray) scriptData.get("functionData");
List<Integer> funcData = new ArrayList<Integer>();
if (functionCoverageArray != null) {
for (int i = 0; i < functionCoverageArray.size(); i++)
funcData.add((Integer) functionCoverageArray.get(i));
}
SortedMap<Integer, List<BranchData>> branchLineMap = new TreeMap<Integer, List<BranchData>>();
if (branchJSONArray != null) {
readBranchLines(branchJSONArray, branchLineMap);