nus-yam/ex-repair huggingface dataset:
Program: 186570
Project: 186570
Buggy source:
/** 
 * @param methodInfo a possible invokee
 * @return true if this invokeSite may invoke the method. Does not use the callgraph to check.
 */
public Ternary canInvoke(MethodInfo methodInfo){
  MethodRef invokeeRef=getInvokeeRef();
  MethodInfo method=invokeeRef.getMethodInfo();
  if (!isVirtual()) {
    return Ternary.valueOf(methodInfo.equals(invokeeRef.getMethodInfo()));
  }
  if (method == null) {
    return Ternary.UNKNOWN;
  }
  if (!methodInfo.getClassInfo().isSubclassOf(invokeeRef.getClassInfo())) {
    return Ternary.FALSE;
  }
  return Ternary.valueOf(methodInfo.overrides(method,true));
}

Fixed version (ground truth):
/** 
 * @param methodInfo a possible invokee
 * @return true if this invokeSite may invoke the method. Does not use the callgraph to check.For interface invoke sites this can return UNKNOWN if the class of the given method implementation does not implement the referenced interface.
 */
public Ternary canInvoke(MethodInfo methodInfo){
  MethodRef invokeeRef=getInvokeeRef();
  MethodInfo method=invokeeRef.getMethodInfo();
  if (!isVirtual()) {
    return Ternary.valueOf(methodInfo.equals(invokeeRef.getMethodInfo()));
  }
  if (method == null) {
    return Ternary.UNKNOWN;
  }
  if (!methodInfo.getClassInfo().isSubclassOf(invokeeRef.getClassInfo())) {
    if (isInvokeInterface() && !methodInfo.getClassInfo().isInterface()) {
      if (!invokeeRef.getMethodSignature().equals(methodInfo.getMethodSignature())) {
        return Ternary.FALSE;
      }
      return Ternary.UNKNOWN;
    }
    return Ternary.FALSE;
  }
  return Ternary.valueOf(methodInfo.overrides(method,true));
}
Program: 186571
Project: 186571
Buggy source:
private void updateChilds(ExecutionContext context,List<ExecutionContext> childs){
  long ecCount=nodeCount.get(context);
  List<ExecutionContext> emptyCSNodes=new LinkedList<ExecutionContext>();
  for (  ExecutionContext child : childs) {
    long count;
    if (!child.getCallString().isEmpty()) {
      count=ecCount * getExecFrequency(context,child.getCallString().top().getInstructionHandle());
      addExecCount(child,count);
    }
 else {
      emptyCSNodes.add(child);
    }
  }
  if (emptyCSNodes.isEmpty())   return;
  for (  InvokeSite invokeSite : context.getMethodInfo().getCode().getInvokeSites()) {
    long count=getExecCount(context,invokeSite.getInstructionHandle());
    for (    ExecutionContext child : emptyCSNodes) {
      if (invokeSite.canInvoke(child.getMethodInfo()) == Ternary.TRUE) {
        addExecCount(child,count);
      }
    }
  }
}

Fixed version (ground truth):
private void updateChilds(ExecutionContext context,List<ExecutionContext> childs){
  long ecCount=nodeCount.get(context);
  List<ExecutionContext> emptyCSNodes=new LinkedList<ExecutionContext>();
  for (  ExecutionContext child : childs) {
    long count;
    if (!child.getCallString().isEmpty()) {
      count=ecCount * getExecFrequency(context,child.getCallString().top().getInstructionHandle());
      addExecCount(child,count);
    }
 else {
      emptyCSNodes.add(child);
    }
  }
  if (emptyCSNodes.isEmpty())   return;
  for (  InvokeSite invokeSite : context.getMethodInfo().getCode().getInvokeSites()) {
    long count=getExecCount(context,invokeSite.getInstructionHandle());
    for (    ExecutionContext child : emptyCSNodes) {
      if (invokeSite.canInvoke(child.getMethodInfo()) != Ternary.FALSE) {
        addExecCount(child,count);
      }
    }
  }
}
Program: 186572
Project: 186572
Buggy source:
@Override public void optimizeMethod(MethodInfo method){
  ConstantPoolGen cpg=method.getConstantPoolGen();
  InstructionList il=method.getCode().getInstructionList();
  InlineData inlineData=new InlineData();
  for (  InvokeSite invoke : method.getCode().getInvokeSites()) {
    CallString cs=new CallString(invoke);
    while (invoke != null) {
      MethodInfo invokee=helper.devirtualize(cs);
      if (checkInvoke(invoke,cs,invokee,inlineData)) {
        invoke=performSimpleInline(invoke,invokee,inlineData);
        inlineCounter++;
        if (inlineData.getInvokeSite() != null) {
          cs.push(inlineData.getInvokeSite());
        }
 else {
          break;
        }
      }
 else {
        break;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void optimizeMethod(MethodInfo method){
  ConstantPoolGen cpg=method.getConstantPoolGen();
  InstructionList il=method.getCode().getInstructionList();
  InlineData inlineData=new InlineData();
  List<InvokeSite> invokes=new ArrayList<InvokeSite>(method.getCode().getInvokeSites());
  Collections.sort(invokes,new Comparator<InvokeSite>(){
    @Override public int compare(    InvokeSite o1,    InvokeSite o2){
      return o1.getInstructionHandle().getPosition() - o2.getInstructionHandle().getPosition();
    }
  }
);
  for (  InvokeSite invoke : invokes) {
    CallString cs=new CallString(invoke);
    while (invoke != null) {
      MethodInfo invokee=helper.devirtualize(cs);
      if (checkInvoke(invoke,cs,invokee,inlineData)) {
        invoke=performSimpleInline(invoke,invokee,inlineData);
        inlineCounter++;
        if (inlineData.getInvokeSite() != null) {
          cs.push(inlineData.getInvokeSite());
        }
 else {
          break;
        }
      }
 else {
        break;
      }
    }
  }
}
Program: 186573
Project: 186573
Buggy source:
/** 
 * @param methodInfo a possible invokee
 * @return true if this invokeSite may invoke the method. Does not use the callgraph to check.For interface invoke sites this can return UNKNOWN if the class of the given method implementation does not implement the referenced interface.
 */
public Ternary canInvoke(MethodInfo methodInfo){
  MethodRef invokeeRef=getInvokeeRef();
  MethodInfo method=invokeeRef.getMethodInfo();
  if (!isVirtual()) {
    return Ternary.valueOf(methodInfo.equals(invokeeRef.getMethodInfo()));
  }
  if (method == null) {
    return Ternary.UNKNOWN;
  }
  if (!methodInfo.getClassInfo().isSubclassOf(invokeeRef.getClassInfo())) {
    if (isInvokeInterface() && !methodInfo.getClassInfo().isInterface()) {
      if (!invokeeRef.getMethodSignature().equals(methodInfo.getMethodSignature())) {
        return Ternary.FALSE;
      }
      return Ternary.UNKNOWN;
    }
    return Ternary.FALSE;
  }
  return Ternary.valueOf(methodInfo.overrides(method,true));
}

Fixed version (ground truth):
/** 
 * @param methodInfo a possible invokee
 * @return true if this invokeSite may invoke the method. Does not use the callgraph to check.For interface invoke sites this can return UNKNOWN if the class of the given method implementation does not implement the referenced interface.
 */
public Ternary canInvoke(MethodInfo methodInfo){
}
Program: 186574
Project: 186574
Buggy source:
private void updateExecCounts(DirectedGraph<ExecutionContext,ContextEdge> dag){
  TopologicalOrderIterator<ExecutionContext,ContextEdge> topOrder=new TopologicalOrderIterator<ExecutionContext,ContextEdge>(dag);
  while (topOrder.hasNext()) {
    ExecutionContext next=topOrder.next();
    if (logger.isTraceEnabled()) {
      logger.trace("String_Node_Str" + next);
    }
    updateChilds(next,callGraph.getChildren(next));
  }
}

Fixed version (ground truth):
private void updateExecCounts(DirectedGraph<ExecutionContext,ContextEdge> dag){
  TopologicalOrderIterator<ExecutionContext,ContextEdge> topOrder=new TopologicalOrderIterator<ExecutionContext,ContextEdge>(dag);
  while (topOrder.hasNext()) {
    ExecutionContext next=topOrder.next();
    if (logger.isTraceEnabled()) {
      logger.trace("String_Node_Str" + next);
    }
    updateChilds(next);
  }
}
Program: 186575
Project: 186575
Buggy source:
private void updateChilds(ExecutionContext context,List<ExecutionContext> childs){
  long ecCount=nodeCount.get(context);
  List<ExecutionContext> emptyCSNodes=new LinkedList<ExecutionContext>();
  for (  ExecutionContext child : childs) {
    long count;
    if (!child.getCallString().isEmpty()) {
      count=ecCount * getExecFrequency(context,child.getCallString().top().getInstructionHandle());
      addExecCount(child,count);
    }
 else {
      emptyCSNodes.add(child);
    }
  }
  if (emptyCSNodes.isEmpty())   return;
  for (  InvokeSite invokeSite : context.getMethodInfo().getCode().getInvokeSites()) {
    long count=getExecCount(context,invokeSite.getInstructionHandle());
    for (    ExecutionContext child : emptyCSNodes) {
      if (invokeSite.canInvoke(child.getMethodInfo()) != Ternary.FALSE) {
        addExecCount(child,count);
      }
    }
  }
}

Fixed version (ground truth):
private void updateChilds(ExecutionContext context){
  long ecCount=nodeCount.get(context);
  for (  Map.Entry<InvokeSite,Set<ExecutionContext>> entry : callGraph.getChildsPerInvokeSite(context).entrySet()) {
    InvokeSite invokeSite=entry.getKey();
    long count=ecCount * getExecFrequency(context,invokeSite.getInstructionHandle());
    for (    ExecutionContext child : entry.getValue()) {
      addExecCount(child,count);
    }
  }
}
Program: 186576
Project: 186576
Buggy source:
private Set<MethodInfo> runAnalysis(DirectedGraph<ExecutionContext,ContextEdge> reversed){
  TopologicalOrderIterator<ExecutionContext,ContextEdge> topOrder=new TopologicalOrderIterator<ExecutionContext,ContextEdge>(reversed);
  Set<MethodInfo> changed=new HashSet<MethodInfo>();
  while (topOrder.hasNext()) {
    ExecutionContext node=topOrder.next();
    RecursiveWcetAnalysis<AnalysisContextLocal>.LocalWCETSolution sol=recursiveAnalysis.computeSolution(node.getMethodInfo(),new AnalysisContextLocal(cacheApproximation,node.getCallString()));
    wcaNodeFlow.put(node,sol.getNodeFlowVirtual());
    if (node.getMethodInfo().equals(wcetTool.getTargetMethod())) {
      logger.info("String_Node_Str" + sol.getCost().getCost());
    }
    changed.add(node.getMethodInfo());
  }
  return changed;
}

Fixed version (ground truth):
private Set<MethodInfo> runAnalysis(DirectedGraph<ExecutionContext,ContextEdge> reversed){
  TopologicalOrderIterator<ExecutionContext,ContextEdge> topOrder=new TopologicalOrderIterator<ExecutionContext,ContextEdge>(reversed);
  Set<MethodInfo> changed=new HashSet<MethodInfo>();
  while (topOrder.hasNext()) {
    ExecutionContext node=topOrder.next();
    RecursiveWcetAnalysis<AnalysisContextLocal>.LocalWCETSolution sol=recursiveAnalysis.computeSolution(node.getMethodInfo(),new AnalysisContextLocal(cacheApproximation,node.getCallString()));
    wcaNodeFlow.put(node,sol.getNodeFlowVirtual());
    if (node.getMethodInfo().equals(wcetTool.getTargetMethod())) {
      lastWCET=sol.getCost().getCost();
      logger.info("String_Node_Str" + lastWCET);
    }
    changed.add(node.getMethodInfo());
  }
  return changed;
}
Program: 186577
Project: 186577
Buggy source:
void initialize();

Fixed version (ground truth):
void initialize(GreedyConfig config);
Program: 186578
Project: 186578
Buggy source:
public static void registerOptions(OptionGroup options){
  options.addOption(GREEDY_ORDER);
  options.addOption(TARGETS);
  options.addOption(USE_WCEP);
  options.addOption(USE_WCA_EXEC_COUNT);
  options.addOption(USE_FREQUENCY_ONLY);
  options.addOption(CACHE_ANALYSIS_TYPE);
  options.addOption(WCA_CACHE_APPROXIMATION);
  options.addOption(DUMP_TARGET_CALLGRAPH);
  options.addOption(MAX_STEPS);
}

Fixed version (ground truth):
public static void registerOptions(OptionGroup options){
  options.addOption(GREEDY_ORDER);
  options.addOption(TARGETS);
  options.addOption(USE_WCEP);
  options.addOption(USE_WCA_EXEC_COUNT);
  options.addOption(USE_FREQUENCY_ONLY);
  options.addOption(CACHE_ANALYSIS_TYPE);
  options.addOption(WCA_CACHE_APPROXIMATION);
  options.addOption(DUMP_TARGET_CALLGRAPH);
  options.addOption(MAX_STEPS);
  options.addOption(DUMP_STATS);
}
Program: 186579
Project: 186579
Buggy source:
private void loadOptions() throws BadConfigurationException {
  String targetNames=options.getOption(TARGETS);
  if ("String_Node_Str".equals(targetNames)) {
    targets=new ArrayList<MethodInfo>(AppInfo.getSingleton().getCallGraph().getRootMethods());
  }
 else   if ("String_Node_Str".equals(targetNames)) {
    targets=jcopter.getJConfig().getWCATargets();
  }
 else {
    targets=Config.parseMethodList(targetNames);
  }
  useWCEP=useWCA() && options.getOption(USE_WCEP);
  GreedyOrder order=getOrder();
  if (order == GreedyOrder.BottomUp || order == GreedyOrder.TopDown) {
    logger.warn("String_Node_Str" + order + "String_Node_Str");
    useWCEP=false;
  }
}

Fixed version (ground truth):
private void loadOptions() throws BadConfigurationException {
  String targetNames=options.getOption(TARGETS);
  if ("String_Node_Str".equals(targetNames)) {
    targets=new ArrayList<MethodInfo>(AppInfo.getSingleton().getCallGraph().getRootMethods());
  }
 else   if ("String_Node_Str".equals(targetNames)) {
    targets=jcopter.getJConfig().getWCATargets();
  }
 else {
    targets=Config.parseMethodList(targetNames);
  }
  useWCEP=useWCA() && options.getOption(USE_WCEP);
  GreedyOrder order=getOrder();
  if (useWCEP && (order == GreedyOrder.BottomUp || order == GreedyOrder.TopDown)) {
    logger.warn("String_Node_Str" + order + "String_Node_Str");
    useWCEP=false;
  }
}
Program: 186581
Project: 186581
Buggy source:
@Override public void printStatistics(){
  logger.info("String_Node_Str" + globalCodesize + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void printStatistics(){
  logger.info("String_Node_Str" + globalCodesize + "String_Node_Str");
  dumpStats();
  if (dump != null) {
    dump.close();
  }
}
Program: 186582
Project: 186582
Buggy source:
protected void logSelection(ExecFrequencyProvider ecp,RebateRatio ratio){
  if (ratio == null)   return;
  logger.info("String_Node_Str" + ratio.getRatio() + "String_Node_Str"+ ratio.getGain()+ "String_Node_Str"+ ratio.getCandidate().getLocalGain()+ "String_Node_Str"+ ratio.getCandidate().getDeltaCacheMissCosts(analyses,ecp)+ "String_Node_Str"+ analyses.getMethodCacheAnalysis().getDeltaCacheMissCosts(ecp,ratio.getCandidate())+ "String_Node_Str"+ ratio.getCandidate().getDeltaLocalCodesize()+ "String_Node_Str"+ ecp.getExecCount(ratio.getCandidate().getMethod(),ratio.getCandidate().getEntry()));
}

Fixed version (ground truth):
protected void logSelection(ExecFrequencyProvider ecp,RebateRatio ratio){
  if (ratio == null)   return;
  long localGain=ratio.getCandidate().getLocalGain();
  long cache=analyses.getMethodCacheAnalysis().getDeltaCacheMissCosts(ecp,ratio.getCandidate());
  long localCache=ratio.getCandidate().getDeltaCacheMissCosts(analyses,ecp);
  int codesize=ratio.getCandidate().getDeltaLocalCodesize();
  long execCount=ecp.getExecCount(ratio.getCandidate().getMethod(),ratio.getCandidate().getEntry());
  logger.info("String_Node_Str" + ratio.getRatio() + "String_Node_Str"+ ratio.getGain()+ "String_Node_Str"+ localGain+ "String_Node_Str"+ cache+ "String_Node_Str"+ localCache+ "String_Node_Str"+ codesize+ "String_Node_Str"+ execCount);
  dumpStats();
  if (dump != null) {
    dump.print("String_Node_Str" + ratio.getCandidate().toString());
    dump.print("String_Node_Str" + ratio.getRatio() + "String_Node_Str"+ ratio.getGain()+ "String_Node_Str"+ localGain);
    dump.print("String_Node_Str" + cache + "String_Node_Str"+ localCache+ "String_Node_Str"+ codesize+ "String_Node_Str"+ execCount);
    dump.println();
  }
}
Program: 186583
Project: 186583
Buggy source:
@Override public void initialize(){
  globalCodesize=0;
  if (usesCodeRemover) {
    for (    MethodInfo method : AppInfo.getSingleton().getCallGraph().getMethodInfos()) {
      if (!method.hasCode())       continue;
      globalCodesize+=method.getCode().getNumberOfBytes();
    }
  }
 else {
    for (    ClassInfo cls : AppInfo.getSingleton().getClassInfos()) {
      for (      MethodInfo method : cls.getMethods()) {
        if (!method.hasCode())         continue;
        globalCodesize+=method.getCode().getNumberOfBytes();
      }
    }
  }
  DFSVisitor<ExecutionContext,ContextEdge> visitor=new EmptyDFSVisitor<ExecutionContext,ContextEdge>(){
    private int counter=1;
    @Override public void postorder(    ExecutionContext node){
      depthMap.put(node.getMethodInfo(),counter++);
    }
  }
;
  DirectedGraph<ExecutionContext,ContextEdge> graph=analyses.getTargetCallGraph().getReversedGraph();
  DFSTraverser<ExecutionContext,ContextEdge> traverser=new DFSTraverser<ExecutionContext,ContextEdge>(visitor);
  traverser.traverse(graph);
  logger.info("String_Node_Str" + globalCodesize + "String_Node_Str");
}

Fixed version (ground truth):
@Override public void initialize(GreedyConfig config){
  globalCodesize=0;
  if (usesCodeRemover) {
    for (    MethodInfo method : AppInfo.getSingleton().getCallGraph().getMethodInfos()) {
      if (!method.hasCode())       continue;
      globalCodesize+=method.getCode().getNumberOfBytes();
    }
  }
 else {
    for (    ClassInfo cls : AppInfo.getSingleton().getClassInfos()) {
      for (      MethodInfo method : cls.getMethods()) {
        if (!method.hasCode())         continue;
        globalCodesize+=method.getCode().getNumberOfBytes();
      }
    }
  }
  DFSVisitor<ExecutionContext,ContextEdge> visitor=new EmptyDFSVisitor<ExecutionContext,ContextEdge>(){
    private int counter=1;
    @Override public void postorder(    ExecutionContext node){
      depthMap.put(node.getMethodInfo(),counter++);
    }
  }
;
  DirectedGraph<ExecutionContext,ContextEdge> graph=analyses.getTargetCallGraph().getReversedGraph();
  DFSTraverser<ExecutionContext,ContextEdge> traverser=new DFSTraverser<ExecutionContext,ContextEdge>(visitor);
  traverser.traverse(graph);
  logger.info("String_Node_Str" + globalCodesize + "String_Node_Str");
  if (config.doDumpStats()) {
    try {
      dump=new PrintWriter(config.getStatsFile());
      dump.print("String_Node_Str");
      if (analyses.useWCAInvoker())       dump.print("String_Node_Str");
      dump.println("String_Node_Str");
    }
 catch (    FileNotFoundException e) {
      throw new AppInfoError("String_Node_Str",e);
    }
  }
}
Program: 186584
Project: 186584
Buggy source:
/** 
 * Inline all methods which do not increase the code size.
 */
public void performSimpleInline(){
  if (getJConfig().doAssumeDynamicClassLoader()) {
    logger.info("String_Node_Str");
    return;
  }
  logger.info("String_Node_Str");
  new SimpleInliner(jcopter,inlineConfig).optimize();
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Inline all methods which do not increase the code size.
 */
public void performSimpleInline(){
  if (!getOptimizeOptions().getOption(SIMPLE_INLINER)) {
    logger.info("String_Node_Str");
    return;
  }
  if (getJConfig().doAssumeDynamicClassLoader()) {
    logger.info("String_Node_Str");
    return;
  }
  logger.info("String_Node_Str");
  new SimpleInliner(jcopter,inlineConfig).optimize();
  logger.info("String_Node_Str");
}
Program: 186586
Project: 186586
Buggy source:
@Override public boolean optimize(AnalysisManager analyses,StacksizeAnalysis stacksize){
  MethodCode code=getMethod().getCode();
  InstructionList il=code.getInstructionList();
  assert(start == end);
  InstructionHandle invoke=start;
  InstructionHandle next=end.getNext();
  insertPrologue(il,next);
  Map<InvokeSite,InvokeSite> invokeMap;
  CallString callString=getInlineCallString(code,invoke).push(invokeSite);
  invokeMap=insertInvokee(analyses,callString,il,next);
  start=invoke.getNext();
  end=next.getPrev();
  if (end == null) {
    start=null;
  }
  try {
    il.delete(invoke);
  }
 catch (  TargetLostException e) {
    code.retarget(e,start);
  }
  il.setPositions();
  for (  CallGraph cg : analyses.getCallGraphs()) {
    updateCallgraph(cg,invokeMap);
  }
  updateAnalyses(analyses,invokeMap);
  isLastInvoke=!analyses.getAppInfoCallGraph().containsMethod(invokee);
  return true;
}

Fixed version (ground truth):
@Override public boolean optimize(AnalysisManager analyses,StacksizeAnalysis stacksize){
  MethodCode code=getMethod().getCode();
  InstructionList il=code.getInstructionList();
  assert(start == end);
  InstructionHandle invoke=start;
  InstructionHandle next=end.getNext();
  insertPrologue(il,next);
  Map<InvokeSite,InvokeSite> invokeMap;
  CallString callString=getInlineCallString(code,invoke).push(invokeSite);
  invokeMap=insertInvokee(analyses,callString,il,next);
  start=invoke.getNext();
  end=next.getPrev();
  if (end == null) {
    start=null;
  }
  if (end == invoke) {
    start=null;
    end=null;
  }
  InstructionHandle tmp=invoke.getNext();
  try {
    il.delete(invoke);
  }
 catch (  TargetLostException e) {
    code.retarget(e,tmp);
  }
  il.setPositions();
  for (  CallGraph cg : analyses.getCallGraphs()) {
    updateCallgraph(cg,invokeMap);
  }
  updateAnalyses(analyses,invokeMap);
  isLastInvoke=!analyses.getAppInfoCallGraph().containsMethod(invokee);
  return true;
}
Program: 186589
Project: 186589
Buggy source:
@SuppressWarnings("String_Node_Str") public void dataflowAnalysis(boolean loopBounds){
  int callstringLength=appInfo.getCallstringLength();
  DFATool dfaTool=jcopter.getDfaTool();
  logger.info("String_Node_Str");
  dfaTool.setAnalyzeBootMethod(true);
  dfaTool.load();
  logger.info("String_Node_Str");
  dfaTool.runReceiverAnalysis(callstringLength);
  if (loopBounds) {
    logger.info("String_Node_Str");
    dfaTool.runLoopboundAnalysis(callstringLength);
  }
  dfaTool.cleanup();
}

Fixed version (ground truth):
@SuppressWarnings("String_Node_Str") public void dataflowAnalysis(boolean loopBounds){
  int callstringLength=appInfo.getCallstringLength();
  DFATool dfaTool=jcopter.getDfaTool();
  logger.info("String_Node_Str");
  dfaTool.setAnalyzeBootMethod(true);
  dfaTool.load();
  logger.info("String_Node_Str");
  dfaTool.runReceiverAnalysis(callstringLength);
  if (loopBounds) {
    logger.info("String_Node_Str");
    dfaTool.runLoopboundAnalysis(callstringLength);
    if (jcopter.useWCA()) {
      jcopter.getWcetTool().setHasDfaResults(true);
    }
  }
  dfaTool.cleanup();
}
Program: 186590
Project: 186590
Buggy source:
@Override public Collection<Candidate> findCandidates(MethodInfo method,AnalysisManager analyses,StacksizeAnalysis stacksize,int maxLocals,InstructionHandle start,InstructionHandle end){
  List<Candidate> candidates=new LinkedList<Candidate>();
  MethodCode code=method.getCode();
  InstructionHandle next=end.getNext();
  for (InstructionHandle ih=start; ih != next; ih=ih.getNext()) {
    if (code.isInvokeSite(ih)) {
      InvokeSite site=code.getInvokeSite(ih);
      CallString cs=new CallString(site);
      MethodInfo invokee=helper.devirtualize(cs);
      if (invokee == null)       continue;
      cs=getInlineCallString(code,ih).push(site);
      Candidate candidate=checkInvoke(code,cs,site,invokee,maxLocals);
      if (candidate == null) {
        continue;
      }
      if (!candidate.recalculate(analyses,stacksize)) {
        continue;
      }
      candidates.add(candidate);
    }
  }
  return candidates;
}

Fixed version (ground truth):
@Override public Collection<Candidate> findCandidates(MethodInfo method,AnalysisManager analyses,StacksizeAnalysis stacksize,int maxLocals,InstructionHandle start,InstructionHandle end){
  List<Candidate> candidates=new LinkedList<Candidate>();
  MethodCode code=method.getCode();
  InstructionHandle next=end.getNext();
  for (InstructionHandle ih=start; ih != next; ih=ih.getNext()) {
    if (code.isInvokeSite(ih)) {
      InvokeSite site=code.getInvokeSite(ih);
      CallString cs=new CallString(site);
      countInvokeSites++;
      MethodInfo invokee=helper.devirtualize(cs);
      if (invokee == null)       continue;
      countDevirtualized++;
      cs=getInlineCallString(code,ih).push(site);
      Candidate candidate=checkInvoke(code,cs,site,invokee,maxLocals);
      if (candidate == null) {
        continue;
      }
      if (!candidate.recalculate(analyses,stacksize)) {
        continue;
      }
      candidates.add(candidate);
    }
  }
  return candidates;
}
Program: 186591
Project: 186591
Buggy source:
@Override public void printStatistics(){
}

Fixed version (ground truth):
@Override public void printStatistics(){
  logger.info("String_Node_Str" + countInvokeSites + "String_Node_Str"+ (countInvokeSites - countDevirtualized));
}
Program: 186592
Project: 186592
Buggy source:
@Override public void initialize(AnalysisManager analyses,Collection<MethodInfo> roots){
  if (!preciseCycleEstimate) {
    ExecutionContext dummy=new ExecutionContext(roots.iterator().next());
    WCETProcessorModel pm=analyses.getJCopter().getWCETProcessorModel();
    InstructionList il=new InstructionList();
    storeCycles=(int)pm.getExecutionTime(dummy,il.append(new ASTORE(10)));
    checkNPCycles=0;
    checkNPCycles+=(int)pm.getExecutionTime(dummy,il.append(new DUP()));
    checkNPCycles+=(int)pm.getExecutionTime(dummy,il.append(new IFNONNULL(il.append(new ATHROW()))));
    deltaReturnCycles=(int)pm.getExecutionTime(dummy,il.append(new RETURN()));
    deltaReturnCycles-=(int)pm.getExecutionTime(dummy,il.append(new GOTO(il.getEnd())));
  }
}

Fixed version (ground truth):
@Override public void initialize(AnalysisManager analyses,Collection<MethodInfo> roots){
  if (!preciseCycleEstimate) {
    ExecutionContext dummy=new ExecutionContext(roots.iterator().next());
    WCETProcessorModel pm=analyses.getJCopter().getWCETProcessorModel();
    InstructionList il=new InstructionList();
    storeCycles=(int)pm.getExecutionTime(dummy,il.append(new ASTORE(10)));
    checkNPCycles=0;
    checkNPCycles+=(int)pm.getExecutionTime(dummy,il.append(new DUP()));
    checkNPCycles+=(int)pm.getExecutionTime(dummy,il.append(new IFNONNULL(il.append(new ATHROW()))));
    deltaReturnCycles=(int)pm.getExecutionTime(dummy,il.append(new RETURN()));
    deltaReturnCycles-=(int)pm.getExecutionTime(dummy,il.append(new GOTO(il.getEnd())));
  }
  countInvokeSites=0;
  countDevirtualized=0;
}
Program: 186593
Project: 186593
Buggy source:
@Override public void optimizeMethod(MethodInfo method){
  ConstantPoolGen cpg=method.getConstantPoolGen();
  InstructionList il=method.getCode().getInstructionList();
  InlineData inlineData=new InlineData();
  List<InvokeSite> invokes=new ArrayList<InvokeSite>(method.getCode().getInvokeSites());
  Collections.sort(invokes,new Comparator<InvokeSite>(){
    @Override public int compare(    InvokeSite o1,    InvokeSite o2){
      return o1.getInstructionHandle().getPosition() - o2.getInstructionHandle().getPosition();
    }
  }
);
  for (  InvokeSite invoke : invokes) {
    CallString cs=new CallString(invoke);
    while (invoke != null) {
      MethodInfo invokee=helper.devirtualize(cs);
      if (checkInvoke(invoke,cs,invokee,inlineData)) {
        invoke=performSimpleInline(invoke,invokee,inlineData);
        inlineCounter++;
        if (inlineData.getInvokeSite() != null) {
          cs.push(inlineData.getInvokeSite());
        }
 else {
          break;
        }
      }
 else {
        break;
      }
    }
  }
}

Fixed version (ground truth):
@Override public void optimizeMethod(MethodInfo method){
  InlineData inlineData=new InlineData();
  List<InvokeSite> invokes=new ArrayList<InvokeSite>(method.getCode().getInvokeSites());
  Collections.sort(invokes,new Comparator<InvokeSite>(){
    @Override public int compare(    InvokeSite o1,    InvokeSite o2){
      return o1.getInstructionHandle().getPosition() - o2.getInstructionHandle().getPosition();
    }
  }
);
  for (  InvokeSite invoke : invokes) {
    CallString cs=new CallString(invoke);
    while (invoke != null) {
      countInvokeSites++;
      MethodInfo invokee=helper.devirtualize(cs);
      if (invokee == null)       break;
      countDevirtualized++;
      if (checkInvoke(invoke,cs,invokee,inlineData)) {
        invoke=performSimpleInline(invoke,invokee,inlineData);
        inlineCounter++;
        if (inlineData.getInvokeSite() != null) {
          cs.push(inlineData.getInvokeSite());
        }
 else {
          break;
        }
      }
 else {
        break;
      }
    }
  }
}
Program: 186594
Project: 186594
Buggy source:
@Override public void printStatistics(){
  logger.info("String_Node_Str" + inlineCounter + "String_Node_Str");
  logger.info("String_Node_Str" + candidates + "String_Node_Str"+ requiresNPCheck+ "String_Node_Str"+ signatureMismatch+ "String_Node_Str"+ unhandledInstructions+ "String_Node_Str"+ codesizeTooLarge);
}

Fixed version (ground truth):
@Override public void printStatistics(){
  logger.info("String_Node_Str" + inlineCounter + "String_Node_Str");
  logger.info("String_Node_Str" + countInvokeSites + "String_Node_Str"+ (countInvokeSites - countDevirtualized));
  logger.info("String_Node_Str" + candidates + "String_Node_Str"+ requiresNPCheck+ "String_Node_Str"+ signatureMismatch+ "String_Node_Str"+ unhandledInstructions+ "String_Node_Str"+ codesizeTooLarge);
}
Program: 186595
Project: 186595
Buggy source:
@Override public void initialize(){
  inlineCounter=0;
  candidates=0;
  unhandledInstructions=0;
  requiresNPCheck=0;
  signatureMismatch=0;
  codesizeTooLarge=0;
}

Fixed version (ground truth):
@Override public void initialize(){
  inlineCounter=0;
  candidates=0;
  unhandledInstructions=0;
  requiresNPCheck=0;
  signatureMismatch=0;
  codesizeTooLarge=0;
  countInvokeSites=0;
  countDevirtualized=0;
}
Program: 186597
Project: 186597
Buggy source:
/** 
 * @return true if the invokation denotes an interface, not an implementation
 */
public boolean isVirtual(){
  return receiverImpl == null;
}

Fixed version (ground truth):
/** 
 * @return true if the invokation denotes an interface, not an implementation
 */
@Override public boolean isVirtual(){
  return receiverImpl == null;
}
Program: 186598
Project: 186598
Buggy source:
public ControlFlowGraph receiverFlowGraph(){
  return receiverImpl.getCode().getControlFlowGraph(false);
}

Fixed version (ground truth):
@Override public ControlFlowGraph receiverFlowGraph(){
  return receiverImpl.getCode().getControlFlowGraph(false);
}
Program: 186599
Project: 186599
Buggy source:
public InstructionHandle getInstructionHandle(){
  return instr;
}

Fixed version (ground truth):
@Override public InstructionHandle getInstructionHandle(){
  return instr;
}
Program: 186600
Project: 186600
Buggy source:
public MethodInfo getImplementingMethod(){
  return this.receiverImpl;
}

Fixed version (ground truth):
@Override public MethodInfo getImplementingMethod(){
  return this.receiverImpl;
}
Program: 186601
Project: 186601
Buggy source:
/** 
 * Get miss cost for an edge accessing the method cache
 * @param accessEdge either a SuperInvoke or SuperReturn edge, or an entry edge of the segment analyzed
 * @return maximum miss penalty (in cycles)
 */
private long getMissCost(SuperGraphEdge accessEdge){
  SuperGraphNode accessed=accessEdge.getTarget();
  ControlFlowGraph cfg=accessed.getCfg();
  if (accessEdge instanceof SuperReturnEdge) {
    Type returnType=accessEdge.getSource().getCfg().getMethodInfo().getType();
    return methodCache.getMissPenaltyOnReturn(cfg.getNumberOfWords(),returnType);
  }
 else   if (accessEdge instanceof SuperInvokeEdge) {
    InvokeInstruction invokeIns=((SuperInvokeEdge)accessEdge).getInvokeNode().getInvokeSite().getInvokeInstruction();
    return methodCache.getMissPenaltyOnInvoke(cfg.getNumberOfWords(),invokeIns);
  }
 else {
    return methodCache.getMissPenalty(cfg.getNumberOfWords(),false);
  }
}

Fixed version (ground truth):
/** 
 * Get miss cost for an edge accessing the method cache
 * @param accessEdge either a SuperInvoke or SuperReturn edge, or an entry edge of the segment analyzed
 * @return maximum miss penalty (in cycles)
 */
private long getMissCost(SuperGraphEdge accessEdge){
  SuperGraphNode accessed=accessEdge.getTarget();
  ControlFlowGraph cfg=accessed.getCfg();
  if (accessEdge instanceof SuperReturnEdge) {
    Type returnType=accessEdge.getSource().getCfg().getMethodInfo().getType();
    return methodCache.getMissPenaltyOnReturn(cfg.getNumberOfWords(),returnType);
  }
 else   if (accessEdge instanceof SuperInvokeEdge) {
    InstructionHandle invokeIns=((SuperInvokeEdge)accessEdge).getInvokeNode().getInvokeSite().getInstructionHandle();
    return methodCache.getMissPenaltyOnInvoke(cfg.getNumberOfWords(),invokeIns.getInstruction());
  }
 else {
    return methodCache.getMissPenalty(cfg.getNumberOfWords(),false);
  }
}
Program: 186602
Project: 186602
Buggy source:
/** 
 * Get the maximum method cache miss penalty for invoking   {@code invoked} and returning to {@code invoker}.<br/> Also works with virtual invokes (taking the maximum cost)
 * @param invokeSite the invoke site
 * @param context call context
 * @return miss penalty in cycles
 */
public long getInvokeReturnMissCost(InvokeSite invokeSite,CallString context){
  ControlFlowGraph invokerCfg=wcetTool.getFlowGraph(invokeSite.getInvoker());
  long rMiss=methodCache.getMissPenaltyOnReturn(invokerCfg.getNumberOfWords(),invokeSite.getInvokeeRef().getDescriptor().getType());
  long iMissMax=0;
  for (  MethodInfo target : wcetTool.findImplementations(invokeSite.getInvoker(),invokeSite.getInstructionHandle(),context)) {
    ControlFlowGraph invokedCfg=wcetTool.getFlowGraph(target);
    long iMiss=methodCache.getMissPenaltyOnInvoke(invokedCfg.getNumberOfWords(),invokeSite.getInvokeInstruction());
    if (iMiss > iMissMax)     iMissMax=iMiss;
  }
  return iMissMax + rMiss;
}

Fixed version (ground truth):
/** 
 * Get the maximum method cache miss penalty for invoking   {@code invoked} and returning to {@code invoker}.<br/> Also works with virtual invokes (taking the maximum cost)
 * @param invokeSite the invoke site
 * @param context call context
 * @return miss penalty in cycles
 */
public long getInvokeReturnMissCost(InvokeSite invokeSite,CallString context){
  ControlFlowGraph invokerCfg=wcetTool.getFlowGraph(invokeSite.getInvoker());
  long rMiss=methodCache.getMissPenaltyOnReturn(invokerCfg.getNumberOfWords(),invokeSite.getInvokeeRef().getDescriptor().getType());
  long iMissMax=0;
  for (  MethodInfo target : wcetTool.findImplementations(invokeSite.getInvoker(),invokeSite.getInstructionHandle(),context)) {
    ControlFlowGraph invokedCfg=wcetTool.getFlowGraph(target);
    long iMiss=methodCache.getMissPenaltyOnInvoke(invokedCfg.getNumberOfWords(),invokeSite.getInstructionHandle().getInstruction());
    if (iMiss > iMissMax)     iMissMax=iMiss;
  }
  return iMissMax + rMiss;
}
Program: 186603
Project: 186603
Buggy source:
/** 
 * Compute the delay (in cycles) caused by a method cache miss
 * @param invokeeWords number of words to load
 * @param invokeInstruction the invoke instruction
 * @return the maximum miss penalty for loading {@code words} words from method cache during {@code invokeInstruction}
 */
public long getMissPenaltyOnInvoke(int invokeeWords,InvokeInstruction invokeInstruction);

Fixed version (ground truth):
/** 
 * Compute the delay (in cycles) caused by a method cache miss
 * @param invokeeWords number of words to load
 * @param invokeInstruction the invoke instruction
 * @return the maximum miss penalty for loading {@code words} words from method cache during {@code invokeInstruction}
 */
public long getMissPenaltyOnInvoke(int invokeeWords,Instruction invokeInstruction);
Program: 186604
Project: 186604
Buggy source:
/** 
 * @param invokeeWords number of words to load
 * @param invokeInstruction the invoke instruction
 * @return the maximum miss penalty for loading {@code words} words from method cache during {@code invokeInstruction}
 */
public long getMissPenaltyOnInvoke(int invokeeWords,InvokeInstruction invokeInstruction){
  return timing.getMethodCacheMissPenalty(invokeeWords,invokeInstruction.getOpcode());
}

Fixed version (ground truth):
/** 
 * @param invokeeWords number of words to load
 * @param invokeInstruction the invoke instruction
 * @return the maximum miss penalty for loading {@code words} words from method cache during {@code invokeInstruction}
 */
public long getMissPenaltyOnInvoke(int invokeeWords,Instruction invokeInstruction){
  return timing.getMethodCacheMissPenalty(invokeeWords,invokeInstruction.getOpcode());
}
Program: 186605
Project: 186605
Buggy source:
@Override public long getMissPenaltyOnInvoke(int invokeeWords,InvokeInstruction invokeInstruction){
  return 0;
}

Fixed version (ground truth):
@Override public long getMissPenaltyOnInvoke(int invokeeWords,Instruction invokeInstruction){
  return 0;
}
Program: 186606
Project: 186606
Buggy source:
public boolean isOnLocalWCETPath(MethodInfo method,InstructionHandle ih){
  ControlFlowGraph cfg=method.getCode().getControlFlowGraph(false);
  BasicBlockNode block=cfg.getHandleNode(ih);
  for (  ExecutionContext node : wcetTool.getCallGraph().getNodes(method)) {
    Long flow=wcaNodeFlow.get(node).get(block);
    if (flow > 0)     return true;
  }
  return false;
}

Fixed version (ground truth):
public boolean isOnLocalWCETPath(MethodInfo method,InstructionHandle ih){
  ControlFlowGraph cfg=method.getCode().getControlFlowGraph(false);
  BasicBlockNode block=cfg.getHandleNode(ih,true);
  if (block == null) {
    return false;
  }
  for (  ExecutionContext node : wcetTool.getCallGraph().getNodes(method)) {
    Long flow=wcaNodeFlow.get(node).get(block);
    if (flow > 0)     return true;
  }
  return false;
}
Program: 186607
Project: 186607
Buggy source:
@Override public void visitInvokeNode(ControlFlowGraph.InvokeNode n){
  if (n.getVirtualNode() != null) {
    if (project.isInfeasibleReceiver(n.getImplementingMethod(),ctx.getCallString().push(n.getInvokeSite()))) {
      WCETTool.logger.info("String_Node_Str" + n.getImplementingMethod());
      return;
    }
  }
  cost.addLocalCost(processor.getExecutionTime(ctx.getExecutionContext(n),n.getInstructionHandle()));
  if (n.isVirtual()) {
    throw new AssertionError("String_Node_Str" + n.getReferenced() + "String_Node_Str");
  }
  cost.addCost(RecursiveWcetAnalysis.this.recursiveWCET.recursiveCost(RecursiveWcetAnalysis.this,n,ctx));
}

Fixed version (ground truth):
@Override public void visitInvokeNode(ControlFlowGraph.InvokeNode n){
  if (n.getVirtualNode() != null) {
    if (project.isInfeasibleReceiver(n.getImplementingMethod(),ctx.getCallString().push(n.getInvokeSite(),project.getCallstringLength()))) {
      WCETTool.logger.info("String_Node_Str" + n.getImplementingMethod());
      return;
    }
  }
  cost.addLocalCost(processor.getExecutionTime(ctx.getExecutionContext(n),n.getInstructionHandle()));
  if (n.isVirtual()) {
    throw new AssertionError("String_Node_Str" + n.getReferenced() + "String_Node_Str");
  }
  cost.addCost(RecursiveWcetAnalysis.this.recursiveWCET.recursiveCost(RecursiveWcetAnalysis.this,n,ctx));
}
Program: 186608
Project: 186608
Buggy source:
@Override public String toString(){
  if (this.isEmpty())   return "String_Node_Str";
  long hash=hashCode();
  if (hash < 0)   hash+=Integer.MAX_VALUE;
  return String.format("String_Node_Str",callString.length,hash);
}

Fixed version (ground truth):
@Override public String toString(){
  if (this.isEmpty())   return "String_Node_Str";
  long hash=hashCode();
  if (hash < 0)   hash+=Integer.MAX_VALUE;
  if (callString.length == 1) {
    return String.format("String_Node_Str",callString[0].toString());
  }
 else {
    return String.format("String_Node_Str",callString.length,hash);
  }
}
Program: 186609
Project: 186609
Buggy source:
public <K,V>Map runLocalAnalysis(Analysis<K,V> analysis,MethodInfo start){
  Interpreter<K,V> interpreter=new Interpreter<K,V>(analysis,this);
  if (start == null)   throw new AssertionError("String_Node_Str" + start);
  Context context=new Context();
  context.stackPtr=start.getCode().getMaxLocals();
  context.setMethodInfo(start);
  analysis.initialize(start,context);
  InstructionHandle entry=start.getCode().getInstructionList().getStart();
  interpreter.interpret(context,entry,new HashMap<InstructionHandle,ContextMap<K,V>>(),true);
  return analysis.getResult();
}

Fixed version (ground truth):
public <K,V>Map runLocalAnalysis(Analysis<K,V> localAnalysis,ExecutionContext scope){
  Interpreter<K,V> interpreter=new Interpreter<K,V>(localAnalysis,this);
  if (scope == null)   throw new AssertionError("String_Node_Str" + scope);
  Context context=new Context();
  MethodCode entryCode=scope.getMethodInfo().getCode();
  context.stackPtr=entryCode.getMaxLocals();
  context.setMethodInfo(scope.getMethodInfo());
  context.setCallString(scope.getCallString());
  localAnalysis.initialize(scope.getMethodInfo(),context);
  InstructionHandle entry=entryCode.getInstructionList(false,false).getStart();
  interpreter.interpret(context,entry,new HashMap<InstructionHandle,ContextMap<K,V>>(),true);
  return localAnalysis.getResult();
}
Program: 186610
Project: 186610
Buggy source:
public ContextMap<CallString,SymbolicAddressMap> initial(InstructionHandle stmt){
  ContextMap<CallString,SymbolicAddressMap> retval=new ContextMap<CallString,SymbolicAddressMap>(new Context(),new HashMap<CallString,SymbolicAddressMap>());
  CallString l=CallString.EMPTY;
  SymbolicAddressMap init=new SymbolicAddressMap(bsFactory);
  int stackPtr=0;
  if (!entryMethod.isStatic()) {
    init.putStack(stackPtr++,bsFactory.singleton(SymbolicAddress.rootAddress("String_Node_Str")));
  }
  String[] args=entryMethod.getArgumentNames();
  for (int i=0; i < args.length; i++) {
    Type ty=entryMethod.getArgumentType(i);
    if (ty instanceof ReferenceType) {
      init.putStack(stackPtr,bsFactory.singleton(SymbolicAddress.rootAddress("String_Node_Str" + args[i])));
    }
    stackPtr+=ty.getSize();
  }
  retval.put(l,init);
  return retval;
}

Fixed version (ground truth):
public ContextMap<CallString,SymbolicAddressMap> initial(InstructionHandle stmt){
  ContextMap<CallString,SymbolicAddressMap> retval=new ContextMap<CallString,SymbolicAddressMap>(new Context(),new HashMap<CallString,SymbolicAddressMap>());
  SymbolicAddressMap init=new SymbolicAddressMap(bsFactory);
  int stackPtr=0;
  if (!entryMethod.isStatic()) {
    init.putStack(stackPtr++,bsFactory.singleton(SymbolicAddress.rootAddress("String_Node_Str")));
  }
  String[] args=entryMethod.getArgumentNames();
  for (int i=0; i < args.length; i++) {
    Type ty=entryMethod.getArgumentType(i);
    if (ty instanceof ReferenceType) {
      init.putStack(stackPtr,bsFactory.singleton(SymbolicAddress.rootAddress("String_Node_Str" + args[i])));
    }
    stackPtr+=ty.getSize();
  }
  retval.put(initialCallString,init);
  return retval;
}
Program: 186611
Project: 186611
Buggy source:
public void initialize(MethodInfo mi,Context context){
  entryMethod=mi;
}

Fixed version (ground truth):
public void initialize(MethodInfo mi,Context context){
  entryMethod=mi;
  initialCallString=context.callString;
}
Program: 186612
Project: 186612
Buggy source:
/** 
 * Get DFA results on symbolic reference names for the given scope XXX: proper segment support
 * @param scope
 * @return
 */
public LocalPointsToResult getUsedRefs(ExecutionContext scope){
  ExecuteOnceAnalysis eoAna=new ExecuteOnceAnalysis(project);
  DFATool dfa=project.getDfaTool();
  SymbolicPointsTo spt=new SymbolicPointsTo(maxSetSize,project.getCallstringLength(),new ExecOnceQuery(eoAna,scope));
  dfa.runLocalAnalysis(spt,scope.getMethodInfo());
  LocalPointsToResult lpt=new LocalPointsToResult(spt.getResult());
  return lpt;
}

Fixed version (ground truth):
/** 
 * Get DFA results on symbolic reference names for the given scope XXX: proper segment support
 * @param scope
 * @return
 */
public LocalPointsToResult getUsedRefs(ExecutionContext scope){
  ExecuteOnceAnalysis eoAna=new ExecuteOnceAnalysis(project);
  DFATool dfa=project.getDfaTool();
  SymbolicPointsTo spt=new SymbolicPointsTo(maxSetSize,project.getCallstringLength(),new ExecOnceQuery(eoAna,scope));
  dfa.runLocalAnalysis(spt,scope);
  LocalPointsToResult lpt=new LocalPointsToResult(spt.getResult());
  return lpt;
}
Program: 186614
Project: 186614
Buggy source:
public static IPETSolver<SuperGraphEdge> buildIpetProblem(WCETTool wcetTool,String problemName,Segment segment,IPETConfig ipetConfig) throws InvalidFlowFactException {
  problemName=problemName + (nameCounter++);
  IPETSolver<SuperGraphEdge> ipetSolver=new IPETSolver<SuperGraphEdge>(problemName,ipetConfig);
  try {
    segment.exportDOT(wcetTool.getProjectConfig().getOutFile(problemName + "String_Node_Str"));
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  ipetSolver.addConstraint(IPETUtils.constantFlow(segment.getEntryEdges(),1));
  ipetSolver.addConstraint(IPETUtils.constantFlow(segment.getExitEdges(),1));
  for (  SuperGraphNode node : segment.getNodes()) {
    ipetSolver.addConstraint(IPETUtils.flowPreservation(segment.incomingEdgesOf(node),segment.outgoingEdgesOf(node)));
  }
  for (  Pair<SuperInvokeEdge,SuperReturnEdge> superEdgePair : segment.getCallSites()) {
    Iterable<SuperGraphEdge> es1=Iterators.<SuperGraphEdge>singleton(superEdgePair.first());
    Iterable<SuperGraphEdge> es2=Iterators.<SuperGraphEdge>singleton(superEdgePair.second());
    ipetSolver.addConstraint(IPETUtils.flowPreservation(es1,es2));
  }
  for (  LinearConstraint<SuperGraphEdge> flowFact : getFlowFacts(wcetTool,segment)) {
    ipetSolver.addConstraint(flowFact);
  }
  return ipetSolver;
}

Fixed version (ground truth):
/** 
 * Create an interprocedural max-cost max-flow problem for the given segment<br/> Notes:<ul> <li/> super graph edges always have the callstring of the invoking method </ul>
 * @param wcetTool    A reference to the WCETTool
 * @param problemName A unique identifier for the problem (for reporting)
 * @param segment     The segment to build the ILP for
 * @param ipetConfig  Cost of nodes (or {@code null} if no cost is associated with nodes)
 * @return The max-cost maxflow problem
 * @throws InvalidFlowFactException 
 */
public static IPETSolver<SuperGraphEdge> buildIpetProblem(WCETTool wcetTool,String problemName,Segment segment,IPETConfig ipetConfig) throws InvalidFlowFactException {
  IPETSolver<SuperGraphEdge> ipetSolver=new IPETSolver<SuperGraphEdge>(problemName,ipetConfig);
  try {
    segment.exportDOT(wcetTool.getProjectConfig().getOutFile(problemName + "String_Node_Str"));
  }
 catch (  IOException e) {
    e.printStackTrace();
  }
  ipetSolver.addConstraint(IPETUtils.constantFlow(segment.getEntryEdges(),1));
  ipetSolver.addConstraint(IPETUtils.constantFlow(segment.getExitEdges(),1));
  for (  SuperGraphNode node : segment.getNodes()) {
    ipetSolver.addConstraint(IPETUtils.flowPreservation(segment.incomingEdgesOf(node),segment.outgoingEdgesOf(node)));
  }
  for (  Pair<SuperInvokeEdge,SuperReturnEdge> superEdgePair : segment.getCallSites()) {
    Iterable<SuperGraphEdge> es1=Iterators.<SuperGraphEdge>singleton(superEdgePair.first());
    Iterable<SuperGraphEdge> es2=Iterators.<SuperGraphEdge>singleton(superEdgePair.second());
    ipetSolver.addConstraint(IPETUtils.flowPreservation(es1,es2));
  }
  for (  LinearConstraint<SuperGraphEdge> flowFact : getFlowFacts(wcetTool,segment)) {
    ipetSolver.addConstraint(flowFact);
  }
  return ipetSolver;
}