Program: 100057
Project: 100057
Buggy source:
/** 
 * This could be done more efficiently.
 */
private void computeTransverseEdges(){
  for (  BasicBlockInContext<ISSABasicBlock> bb : partialIPFG) {
    if (partialIPFG.hasCall(bb)) {
      Set targets=partialIPFG.getCallTargets(bb);
      for (Iterator it2=targets.iterator(); it2.hasNext(); ) {
        CGNode n=(CGNode)it2.next();
        if (!noCollapse.contains(n)) {
          Object s_n=nodeManager.getCollapsedEntry(n);
          Set<Object> incoming=MapUtil.findOrCreateSet(incomingTransverseEdges,s_n);
          incoming.add(bb);
          Set<Object> outgoing=MapUtil.findOrCreateSet(outgoingTransverseEdges,bb);
          outgoing.add(s_n);
          Object e_n=nodeManager.getCollapsedExit(n);
          for (Iterator returnSites=getReturnSites(bb); returnSites.hasNext(); ) {
            Object ret=returnSites.next();
            Set<Object> in=MapUtil.findOrCreateSet(incomingTransverseEdges,ret);
            in.add(e_n);
            Set<Object> out=MapUtil.findOrCreateSet(outgoingTransverseEdges,e_n);
            out.add(ret);
          }
        }
      }
    }
  }
  for (Iterator it=nodeManager.iterateCollapsedNodes(); it.hasNext(); ) {
    Object n=it.next();
    if (!nodeManager.isCollapsedEntry(n)) {
      continue;
    }
    CGNode node=nodeManager.getProcOfCollapsedNode(n);
    for (Iterator it2=cg.getSuccNodes(node); it2.hasNext(); ) {
      CGNode outNode=(CGNode)it2.next();
      if (noCollapse.contains(outNode)) {
        ControlFlowGraph<ISSABasicBlock> cfg=partialIPFG.getCFG(outNode);
        BasicBlockInContext<ISSABasicBlock> entry=new BasicBlockInContext<ISSABasicBlock>(outNode,cfg.entry());
        Set<Object> incoming=MapUtil.findOrCreateSet(incomingTransverseEdges,entry);
        incoming.add(n);
        Set<Object> outgoing=MapUtil.findOrCreateSet(outgoingTransverseEdges,n);
        outgoing.add(entry);
        BasicBlockInContext<ISSABasicBlock> exit=new BasicBlockInContext<ISSABasicBlock>(outNode,cfg.exit());
        Object retSite=nodeManager.getCollapsedExit(node);
        incoming=MapUtil.findOrCreateSet(incomingTransverseEdges,retSite);
        incoming.add(exit);
        outgoing=MapUtil.findOrCreateSet(outgoingTransverseEdges,exit);
        outgoing.add(retSite);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * This could be done more efficiently.
 */
private void computeTransverseEdges(){
  for (  BasicBlockInContext<ISSABasicBlock> bb : partialIPFG) {
    if (partialIPFG.hasCall(bb)) {
      Set targets=partialIPFG.getCallTargets(bb);
      for (Iterator it2=targets.iterator(); it2.hasNext(); ) {
        CGNode n=(CGNode)it2.next();
        if (!noCollapse.contains(n)) {
          Object s_n=nodeManager.getCollapsedEntry(n);
          Set<Object> incoming=MapUtil.findOrCreateSet(incomingTransverseEdges,s_n);
          incoming.add(bb);
          Set<Object> outgoing=MapUtil.findOrCreateSet(outgoingTransverseEdges,bb);
          outgoing.add(s_n);
          Object e_n=nodeManager.getCollapsedExit(n);
          for (Iterator returnSites=getReturnSites(bb,n); returnSites.hasNext(); ) {
            Object ret=returnSites.next();
            Set<Object> in=MapUtil.findOrCreateSet(incomingTransverseEdges,ret);
            in.add(e_n);
            Set<Object> out=MapUtil.findOrCreateSet(outgoingTransverseEdges,e_n);
            out.add(ret);
          }
        }
      }
    }
  }
  for (Iterator it=nodeManager.iterateCollapsedNodes(); it.hasNext(); ) {
    Object n=it.next();
    if (!nodeManager.isCollapsedEntry(n)) {
      continue;
    }
    CGNode node=nodeManager.getProcOfCollapsedNode(n);
    for (Iterator it2=cg.getSuccNodes(node); it2.hasNext(); ) {
      CGNode outNode=(CGNode)it2.next();
      if (noCollapse.contains(outNode)) {
        ControlFlowGraph<ISSABasicBlock> cfg=partialIPFG.getCFG(outNode);
        BasicBlockInContext<ISSABasicBlock> entry=new BasicBlockInContext<ISSABasicBlock>(outNode,cfg.entry());
        Set<Object> incoming=MapUtil.findOrCreateSet(incomingTransverseEdges,entry);
        incoming.add(n);
        Set<Object> outgoing=MapUtil.findOrCreateSet(outgoingTransverseEdges,n);
        outgoing.add(entry);
        BasicBlockInContext<ISSABasicBlock> exit=new BasicBlockInContext<ISSABasicBlock>(outNode,cfg.exit());
        Object retSite=nodeManager.getCollapsedExit(node);
        incoming=MapUtil.findOrCreateSet(incomingTransverseEdges,retSite);
        incoming.add(exit);
        outgoing=MapUtil.findOrCreateSet(outgoingTransverseEdges,exit);
        outgoing.add(retSite);
      }
    }
  }
}