int lastln = -1;
String cur_fun = "";
Iterator<TreeLoc> it = nodes.iterator();
while (it.hasNext()){
TreeLoc tl = it.next();
if (cur_fun.equals(tl.getFunction())){
// same data applies within one function
// between this location and last location
for (int i = lastln+1; i < tl.getLine(); ++i)
lineMap.put(new Integer(i), tl);
} else {
// don't fill the gap between functions
cur_fun = tl.getFunction();
}
lineMap.put(new Integer(tl.getLine()), tl);
lastln = tl.getLine();
}
return lineMap;
}