Program: 186650
Project: 186650
Buggy source:
/** 
 * Update class report (cost per line number)
 * @param key
 * @param sol FIXME: Currently only reported once per method
 */
private void updateClassReport(CacheKey key,LocalWCETSolution sol){
  MethodInfo m=key.m;
  if (costsPerLineReported.contains(m))   return;
  costsPerLineReported.add(m);
  Map<CFGNode,WcetCost> nodeCosts=sol.getNodeCostMap();
  HashMap<CFGNode,String> nodeFlowCostDescrs=new HashMap<CFGNode,String>();
  for (  Entry<CFGNode,WcetCost> entry : nodeCosts.entrySet()) {
    CFGNode n=entry.getKey();
    WcetCost cost=entry.getValue();
    if (sol.getNodeFlow(n) > 0) {
      nodeFlowCostDescrs.put(n,cost.toString());
      BasicBlock basicBlock=n.getBasicBlock();
      if (basicBlock != null) {
        TreeSet<Integer> lineRange=basicBlock.getSourceLineRange();
        if (lineRange.isEmpty()) {
          logger.error("String_Node_Str");
        }
        ClassInfo cli=basicBlock.getClassInfo();
        ClassReport cr=getWCETTool().getReport().getClassReport(cli);
        Long oldCost=(Long)cr.getLineProperty(lineRange.first(),"String_Node_Str");
        if (oldCost == null)         oldCost=0L;
        long newCost=sol.getNodeFlow(n) * nodeCosts.get(n).getCost();
        if (logger.isTraceEnabled()) {
          logger.trace("String_Node_Str" + oldCost + "String_Node_Str"+ newCost+ "String_Node_Str"+ sol.getNodeFlow(n)+ "String_Node_Str"+ nodeCosts.get(n).getCost()+ "String_Node_Str"+ "String_Node_Str"+ lineRange.first()+ "String_Node_Str"+ basicBlock.getMethodInfo());
        }
        cr.addLineProperty(lineRange.first(),"String_Node_Str",oldCost + newCost);
        for (        int i : lineRange) {
          cr.addLineProperty(i,"String_Node_Str","String_Node_Str");
        }
      }
    }
 else {
      nodeFlowCostDescrs.put(n,"String_Node_Str" + nodeCosts.get(n).getCost());
    }
  }
}

Fixed version (ground truth):
/** 
 * Update class report (cost per line number)
 * @param key
 * @param sol FIXME: Currently only reported once per method
 */
private void updateClassReport(CacheKey key,LocalWCETSolution sol){
  MethodInfo m=key.m;
  if (costsPerLineReported.contains(m))   return;
  costsPerLineReported.add(m);
  Map<CFGNode,WcetCost> nodeCosts=sol.getNodeCostMap();
  HashMap<CFGNode,String> nodeFlowCostDescrs=new HashMap<CFGNode,String>();
  for (  Entry<CFGNode,WcetCost> entry : nodeCosts.entrySet()) {
    CFGNode n=entry.getKey();
    WcetCost cost=entry.getValue();
    if (sol.getNodeFlow(n) > 0) {
      nodeFlowCostDescrs.put(n,cost.toString());
      BasicBlock basicBlock=n.getBasicBlock();
      if (basicBlock != null) {
        TreeSet<Integer> lineRange=basicBlock.getSourceLineRange();
        if (lineRange.isEmpty()) {
          logger.error("String_Node_Str" + basicBlock + "String_Node_Str"+ m+ "String_Node_Str");
          continue;
        }
        ClassInfo cli=basicBlock.getClassInfo();
        ClassReport cr=getWCETTool().getReport().getClassReport(cli);
        Long oldCost=(Long)cr.getLineProperty(lineRange.first(),"String_Node_Str");
        if (oldCost == null)         oldCost=0L;
        long newCost=sol.getNodeFlow(n) * nodeCosts.get(n).getCost();
        if (logger.isTraceEnabled()) {
          logger.trace("String_Node_Str" + oldCost + "String_Node_Str"+ newCost+ "String_Node_Str"+ sol.getNodeFlow(n)+ "String_Node_Str"+ nodeCosts.get(n).getCost()+ "String_Node_Str"+ "String_Node_Str"+ lineRange.first()+ "String_Node_Str"+ basicBlock.getMethodInfo());
        }
        cr.addLineProperty(lineRange.first(),"String_Node_Str",oldCost + newCost);
        for (        int i : lineRange) {
          cr.addLineProperty(i,"String_Node_Str","String_Node_Str");
        }
      }
    }
 else {
      nodeFlowCostDescrs.put(n,"String_Node_Str" + nodeCosts.get(n).getCost());
    }
  }
}