nus-yam/ex-repair huggingface dataset:
Program: 186703
Project: 186703
Buggy source:
/** 
 * Quick'n'dirty initialization of all analyses. If the analyses get more options or get more complex in the future, this will need some work.
 * @param targets the root methods to use for all analyses and the callgraph.
 * @param cacheAnalysisType cache analysis type
 * @param wcaRoots if not null, initialize the WCA invoker with these roots.
 */
public void initAnalyses(Collection<MethodInfo> targets,AnalysisType cacheAnalysisType,Collection<MethodInfo> wcaRoots){
  logger.info("String_Node_Str");
  targetCallGraph=CallGraph.buildCallGraph(targets,new DefaultCallgraphBuilder(AppInfo.getSingleton().getCallstringLength()));
  logger.info("String_Node_Str");
  execCountAnalysis=new ExecCountAnalysis(targetCallGraph);
  execCountAnalysis.initialize();
  logger.info("String_Node_Str");
  methodCacheAnalysis=new MethodCacheAnalysis(this,cacheAnalysisType,targetCallGraph);
  methodCacheAnalysis.initialize();
  if (wcaRoots != null) {
    logger.info("String_Node_Str");
    wcaInvoker=new WCAInvoker(this,wcaRoots);
    try {
      wcaInvoker.initialize();
    }
 catch (    BadConfigurationException e) {
      throw new BadConfigurationError(e.getMessage(),e);
    }
  }
}

Fixed version (ground truth):
/** 
 * Quick'n'dirty initialization of all analyses. If the analyses get more options or get more complex in the future, this will need some work.
 * @param targets the root methods to use for all analyses and the callgraph.
 * @param cacheAnalysisType cache analysis type
 * @param wcaRoots if not null, initialize the WCA invoker with these roots.
 */
public void initAnalyses(Collection<MethodInfo> targets,AnalysisType cacheAnalysisType,Collection<MethodInfo> wcaRoots){
  logger.info("String_Node_Str");
  Set<MethodInfo> allTargets=new HashSet<MethodInfo>(targets);
  if (wcaRoots != null) {
    allTargets.addAll(wcaRoots);
  }
  targetCallGraph=CallGraph.buildCallGraph(allTargets,new DefaultCallgraphBuilder(AppInfo.getSingleton().getCallstringLength()));
  logger.info("String_Node_Str");
  execCountAnalysis=new ExecCountAnalysis(targetCallGraph);
  execCountAnalysis.initialize();
  logger.info("String_Node_Str");
  methodCacheAnalysis=new MethodCacheAnalysis(this,cacheAnalysisType,targetCallGraph);
  methodCacheAnalysis.initialize();
  if (wcaRoots != null) {
    logger.info("String_Node_Str");
    wcaInvoker=new WCAInvoker(this,wcaRoots);
    try {
      wcaInvoker.initialize();
    }
 catch (    BadConfigurationException e) {
      throw new BadConfigurationError(e.getMessage(),e);
    }
  }
}
Program: 186704
Project: 186704
Buggy source:
private void traverseInvokeGraph(DirectedGraph<ExecutionContext,ContextEdge> graph,CacheUpdater updater){
  if (callGraph.getAcyclicity() == Ternary.TRUE) {
    TopologicalOrderIterator<ExecutionContext,ContextEdge> topOrder=new TopologicalOrderIterator<ExecutionContext,ContextEdge>(graph);
    while (topOrder.hasNext()) {
      ExecutionContext node=topOrder.next();
      int newBlocks=updater.getCacheBlocks(node,true);
      if (!updater.updateBlocks(node,newBlocks)) {
      }
    }
  }
 else {
    for (    ExecutionContext node : graph.vertexSet()) {
      int newBlocks=updater.getCacheBlocks(node,false);
      if (!updater.updateBlocks(node,newBlocks)) {
      }
    }
  }
}

Fixed version (ground truth):
private void traverseInvokeGraph(DirectedGraph<ExecutionContext,ContextEdge> graph,CacheUpdater updater){
  if (callGraph.getAcyclicity() == Ternary.TRUE) {
    TopologicalOrderIterator<ExecutionContext,ContextEdge> topOrder=new TopologicalOrderIterator<ExecutionContext,ContextEdge>(graph);
    while (topOrder.hasNext()) {
      ExecutionContext node=topOrder.next();
      int newBlocks=updater.getCacheBlocks(node,true);
      if (!updater.updateBlocks(node,newBlocks)) {
      }
    }
  }
 else {
    for (    ExecutionContext node : graph.vertexSet()) {
      int newBlocks=1;
      if (!updater.updateBlocks(node,newBlocks)) {
      }
    }
  }
}
Program: 186706
Project: 186706
Buggy source:
public AnalysisContextLocal getRootContext(){
  if (analysisType == AnalysisType.ALWAYS_HIT) {
    return new AnalysisContextLocal(StaticCacheApproximation.ALWAYS_HIT);
  }
  if (analysisType == AnalysisType.ALWAYS_MISS) {
    return new AnalysisContextLocal(StaticCacheApproximation.ALWAYS_MISS);
  }
  if (analysisType == AnalysisType.ALWAYS_MISS_OR_HIT) {
    return new AnalysisContextLocal(StaticCacheApproximation.ALL_FIT_SIMPLE);
  }
  return new AnalysisContextLocal(StaticCacheApproximation.ALL_FIT_SIMPLE);
}

Fixed version (ground truth):
public AnalysisContextLocal getRootContext(){
  return getAnalysisContext(CallString.EMPTY);
}
Program: 186707
Project: 186707
Buggy source:
private void setWCETOptions(MethodInfo targetMethod,boolean generateReports){
  Config config=wcetTool.getConfig();
  config.setOption(ProjectConfig.TARGET_METHOD,targetMethod.getMemberID().toString());
  config.setOption(ProjectConfig.DO_GENERATE_REPORTS,generateReports);
  config.setOption(ProjectConfig.DO_GENERATE_REPORTS,false);
  config.setOption(ProjectConfig.DUMP_TARGET_CALLGRAPH,DUMPTYPE.off);
}

Fixed version (ground truth):
private void setWCETOptions(MethodInfo targetMethod,boolean generateReports){
  Config config=wcetTool.getConfig();
  config.setOption(ProjectConfig.TARGET_METHOD,targetMethod.getMemberID().toString());
  config.setOption(ProjectConfig.DO_GENERATE_REPORTS,generateReports);
  config.setOption(ProjectConfig.DO_GENERATE_REPORTS,false);
  config.setOption(ProjectConfig.DUMP_TARGET_CALLGRAPH,DUMPTYPE.off);
  config.setOption(IPETConfig.DUMP_ILP,false);
}
Program: 186708
Project: 186708
Buggy source:
public void initialize() throws BadConfigurationException {
  if (wcaTargets.size() != 1) {
    throw new BadConfigurationException("String_Node_Str");
  }
  setWCETOptions(wcaTargets.iterator().next(),false);
  wcetTool.initialize();
  IPETConfig ipetConfig=new IPETConfig(wcetTool.getConfig());
  RecursiveStrategy<AnalysisContextLocal,WcetCost> strategy;
  if (useMethodCacheStrategy) {
    strategy=analyses.getMethodCacheAnalysis().createRecursiveStrategy(wcetTool,ipetConfig);
  }
 else {
    strategy=new LocalAnalysis(wcetTool,ipetConfig);
  }
  recursiveAnalysis=new RecursiveWcetAnalysis<AnalysisContextLocal>(wcetTool,ipetConfig,strategy);
  WcetCost cost=recursiveAnalysis.computeCost(wcetTool.getTargetMethod(),analyses.getMethodCacheAnalysis().getRootContext());
}

Fixed version (ground truth):
public void initialize() throws BadConfigurationException {
  if (wcaTargets.size() != 1) {
    throw new BadConfigurationException("String_Node_Str");
  }
  setWCETOptions(wcaTargets.iterator().next(),false);
  wcetTool.initialize();
  IPETConfig ipetConfig=new IPETConfig(wcetTool.getConfig());
  RecursiveStrategy<AnalysisContextLocal,WcetCost> strategy;
  if (useMethodCacheStrategy) {
    strategy=analyses.getMethodCacheAnalysis().createRecursiveStrategy(wcetTool,ipetConfig);
  }
 else {
    strategy=new LocalAnalysis(wcetTool,ipetConfig);
  }
  recursiveAnalysis=new RecursiveWcetAnalysis<AnalysisContextLocal>(wcetTool,ipetConfig,strategy);
  runAnalysis(wcetTool.getCallGraph().getReversedGraph());
}
Program: 186709
Project: 186709
Buggy source:
public WCAInvoker(AnalysisManager analyses,Collection<MethodInfo> wcaTargets){
  this.analyses=analyses;
  this.jcopter=analyses.getJCopter();
  this.wcaTargets=wcaTargets;
  wcetTool=jcopter.getWcetTool();
  useMethodCacheStrategy=true;
}

Fixed version (ground truth):
public WCAInvoker(AnalysisManager analyses,Collection<MethodInfo> wcaTargets){
  this.analyses=analyses;
  this.jcopter=analyses.getJCopter();
  this.wcaTargets=wcaTargets;
  wcetTool=jcopter.getWcetTool();
  useMethodCacheStrategy=true;
  wcaNodeFlow=new HashMap<ExecutionContext,Map<CFGNode,Long>>();
}
Program: 186710
Project: 186710
Buggy source:
/** 
 * Update the WCA results after a set of methods have been changed. The changesets of analyses in the AnalysisManager are checked for changes too.
 * @param changedMethods a set of methods of which the code has been modified.
 */
public void updateWCA(Collection<MethodInfo> changedMethods){
  Set<MethodInfo> roots=new HashSet<MethodInfo>(changedMethods);
  roots.addAll(analyses.getMethodCacheAnalysis().getClassificationChangeSet());
  CallGraph callGraph=wcetTool.getCallGraph();
  List<ExecutionContext> rootNodes=new ArrayList<ExecutionContext>(roots.size());
  for (  MethodInfo root : roots) {
    rootNodes.addAll(callGraph.getNodes(root));
  }
  final Set<MethodInfo> methods=new HashSet<MethodInfo>();
  DFSVisitor<ExecutionContext,ContextEdge> visitor=new EmptyDFSVisitor<ExecutionContext,ContextEdge>(){
    @Override public void preorder(    ExecutionContext node){
      methods.add(node.getMethodInfo());
    }
  }
;
  DirectedGraph<ExecutionContext,ContextEdge> reversed=wcetTool.getCallGraph().getReversedGraph();
  DFSTraverser<ExecutionContext,ContextEdge> traverser=new DFSTraverser<ExecutionContext,ContextEdge>(visitor);
  traverser.traverse(reversed);
  recursiveAnalysis.clearCache(methods);
  recursiveAnalysis.computeCost(wcetTool.getTargetMethod(),analyses.getMethodCacheAnalysis().getRootContext());
}

Fixed version (ground truth):
/** 
 * Update the WCA results after a set of methods have been changed. The changesets of analyses in the AnalysisManager are checked for changes too.
 * @param changedMethods a set of methods of which the code has been modified.
 */
public void updateWCA(Collection<MethodInfo> changedMethods){
  Set<MethodInfo> roots=new HashSet<MethodInfo>(changedMethods);
  roots.addAll(analyses.getMethodCacheAnalysis().getClassificationChangeSet());
  CallGraph callGraph=wcetTool.getCallGraph();
  List<ExecutionContext> rootNodes=new ArrayList<ExecutionContext>(roots.size());
  for (  MethodInfo root : roots) {
    rootNodes.addAll(callGraph.getNodes(root));
  }
  runAnalysis(wcetTool.getCallGraph().createInvokeGraph(rootNodes,true));
}
Program: 186711
Project: 186711
Buggy source:
public boolean isOnWCETPath(MethodInfo method,InstructionHandle ih){
  ControlFlowGraph cfg=method.getCode().getControlFlowGraph(false);
  BasicBlockNode node=cfg.getHandleNode(ih);
  return recursiveAnalysis.isWCETBlock(cfg,node);
}

Fixed version (ground truth):
public boolean isOnWCETPath(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;
}
Program: 186712
Project: 186712
Buggy source:
public boolean useWCA(){
  return jcopter.useWCET();
}

Fixed version (ground truth):
public boolean useWCA(){
  return jcopter.useWCA();
}
Program: 186714
Project: 186714
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();
  for (InstructionHandle ih=start; ih != null; 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);
    }
    if (ih == end)     break;
  }
  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);
      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;
}
Program: 186716
Project: 186716
Buggy source:
private InstructionHandle copyInstruction(MethodCode invokeeCode,StacksizeAnalysis stacksize,InstructionList il,InstructionHandle src,InstructionHandle next){
  InstructionHandle ih;
  Instruction instr=src.getInstruction();
  Instruction c=instr.copy();
  if (instr instanceof LocalVariableInstruction) {
    int slot=maxLocals + ((LocalVariableInstruction)instr).getIndex();
    ((LocalVariableInstruction)c).setIndex(slot);
    ih=il.insert(next,c);
  }
 else   if (instr instanceof ReturnInstruction) {
    if (src.getNext() != null) {
      c=new GOTO(next);
      ih=il.insert(next,c);
    }
 else {
      ih=null;
    }
    int stack=stacksize.getStacksizeBefore(src);
    Type type=((ReturnInstruction)instr).getType();
    stack-=type.getSize();
    if (stack != 0) {
      Instruction store=TypeHelper.createStoreInstruction(type,maxLocals);
      ih=il.insert(ih == null ? next : ih,store);
      Instruction load=TypeHelper.createLoadInstruction(type,maxLocals);
      il.append(ih,load);
      while (stack > 0) {
        if (stack > 1) {
          il.append(ih,new POP2());
          stack-=2;
        }
 else {
          il.append(ih,new POP());
          stack--;
        }
      }
    }
  }
 else   if (c instanceof BranchInstruction) {
    ih=il.insert(next,(BranchInstruction)c);
  }
 else {
    ih=il.insert(next,c);
  }
  return ih;
}

Fixed version (ground truth):
private InstructionHandle copyInstruction(MethodCode invokeeCode,StacksizeAnalysis stacksize,InstructionList il,InstructionHandle src,InstructionHandle next){
  InstructionHandle ih;
  Instruction instr=src.getInstruction();
  Instruction c=invokeSite.getInvoker().getCode().copyFrom(invokee.getClassInfo(),instr);
  if (instr instanceof LocalVariableInstruction) {
    int slot=maxLocals + ((LocalVariableInstruction)instr).getIndex();
    ((LocalVariableInstruction)c).setIndex(slot);
    ih=il.insert(next,c);
  }
 else   if (instr instanceof ReturnInstruction) {
    if (src.getNext() != null) {
      c=new GOTO(next);
      ih=il.insert(next,c);
    }
 else {
      ih=null;
    }
    int stack=stacksize.getStacksizeBefore(src);
    Type type=((ReturnInstruction)instr).getType();
    stack-=type.getSize();
    if (stack != 0) {
      Instruction store=TypeHelper.createStoreInstruction(type,maxLocals);
      ih=il.insert(ih == null ? next : ih,store);
      Instruction load=TypeHelper.createLoadInstruction(type,maxLocals);
      il.append(ih,load);
      while (stack > 0) {
        if (stack > 1) {
          il.append(ih,new POP2());
          stack-=2;
        }
 else {
          il.append(ih,new POP());
          stack--;
        }
      }
    }
  }
 else   if (c instanceof BranchInstruction) {
    ih=il.insert(next,(BranchInstruction)c);
  }
 else {
    ih=il.insert(next,c);
  }
  return ih;
}
Program: 186719
Project: 186719
Buggy source:
@Override public String toString(){
  return memberId.toString();
}

Fixed version (ground truth):
@Override public String toString(){
  return memberId.toString(false);
}
Program: 186720
Project: 186720
Buggy source:
/** 
 * @return all source code lines this basic block maps to
 */
public TreeSet<Integer> getSourceLineRange(){
  TreeSet<Integer> lines=new TreeSet<Integer>();
  for (  InstructionHandle ih : instructions) {
    int sourceLine=methodCode.getLineNumber(ih);
    if (sourceLine >= 0)     lines.add(sourceLine);
  }
  return lines;
}

Fixed version (ground truth):
/** 
 * @return all source code lines this basic block maps to
 */
public TreeSet<Integer> getSourceLineRange(){
  TreeSet<Integer> lines=new TreeSet<Integer>();
  for (  InstructionHandle ih : instructions) {
    LineNumberGen gen=methodCode.getLineNumberEntry(ih,ih == instructions.getFirst());
    int sourceLine=gen != null ? gen.getSourceLine() : -1;
    if (sourceLine >= 0)     lines.add(sourceLine);
  }
  return lines;
}
Program: 186721
Project: 186721
Buggy source:
@Override public void onCreateClass(ClassInfo classInfo,boolean loaded){
  if (!loaded)   return;
  try {
    if (AppInfo.getSingleton().getClassFile(classInfo).getTime() > storage.lastModified()) {
      logger.error("String_Node_Str" + classInfo + "String_Node_Str"+ storage+ "String_Node_Str");
      return;
    }
    for (    MethodInfo method : classInfo.getMethods()) {
      if (!method.hasCode())       continue;
      List<SourceLineEntry> entries=sourceLineMap.get(method);
      if (entries == null)       continue;
      applySourceInfos(method,entries);
    }
  }
 catch (  FileNotFoundException e) {
    logger.warn("String_Node_Str",e);
  }
}

Fixed version (ground truth):
@Override public void onCreateClass(ClassInfo classInfo,boolean loaded){
  if (!loaded)   return;
  try {
    if (AppInfo.getSingleton().getClassFile(classInfo).getTime() > storage.lastModified()) {
      logger.error("String_Node_Str" + classInfo + "String_Node_Str"+ storage+ "String_Node_Str");
      return;
    }
    for (    MethodInfo method : classInfo.getMethods()) {
      if (!method.hasCode())       continue;
      List<SourceLineEntry> entries=sourceLineMap.get(method.getMemberID());
      if (entries == null)       continue;
      applySourceInfos(method,entries);
    }
  }
 catch (  FileNotFoundException e) {
    logger.warn("String_Node_Str",e);
  }
}
Program: 186722
Project: 186722
Buggy source:
/** 
 * Load all source file and -line annotations for all classes from the storage file.
 * @throws IOException on file read errors
 */
public void loadSourceInfos() throws IOException {
  if (sourceLineMap == null) {
    readSourceInfos();
  }
  for (  MethodInfo method : sourceLineMap.keySet()) {
    if (AppInfo.getSingleton().getClassFile(method.getClassInfo()).getTime() > storage.lastModified()) {
      logger.error("String_Node_Str" + storage + "String_Node_Str");
      return;
    }
  }
  for (  Map.Entry<MethodInfo,List<SourceLineEntry>> entry : sourceLineMap.entrySet()) {
    MethodInfo method=entry.getKey();
    applySourceInfos(method,entry.getValue());
  }
}

Fixed version (ground truth):
/** 
 * Load all source file and -line annotations for all classes from the storage file.
 */
public void loadSourceInfos(){
  if (sourceLineMap == null) {
    try {
      readSourceInfos();
    }
 catch (    IOException e) {
      logger.error("String_Node_Str" + storage,e);
    }
  }
  Map<MethodInfo,List<SourceLineEntry>> methodMap=new HashMap<MethodInfo,List<SourceLineEntry>>(sourceLineMap.size());
  for (  MemberID mID : sourceLineMap.keySet()) {
    try {
      MethodInfo method=AppInfo.getSingleton().getMethodInfo(mID);
      methodMap.put(method,sourceLineMap.get(mID));
    }
 catch (    MethodNotFoundException ignored) {
      logger.warn("String_Node_Str" + mID + "String_Node_Str"+ storage+ "String_Node_Str");
    }
  }
  for (  MethodInfo method : methodMap.keySet()) {
    try {
      if (AppInfo.getSingleton().getClassFile(method.getClassInfo()).getTime() > storage.lastModified()) {
        logger.error("String_Node_Str" + storage + "String_Node_Str");
        return;
      }
    }
 catch (    FileNotFoundException e) {
      logger.error("String_Node_Str" + method.getClassInfo() + "String_Node_Str",e);
      return;
    }
  }
  for (  Map.Entry<MethodInfo,List<SourceLineEntry>> entry : methodMap.entrySet()) {
    MethodInfo method=entry.getKey();
    applySourceInfos(method,entry.getValue());
  }
}
Program: 186723
Project: 186723
Buggy source:
@Override public void onSuccessfulOptimize(Candidate optimized,List<Candidate> newCandidates){
  globalCodesize+=getDeltaGlobalCodesize(optimized);
  Collection<MethodInfo> unreachable=optimized.getUnreachableMethods();
  if (unreachable != null && !unreachable.isEmpty()) {
    for (    MethodInfo m : unreachable) {
      removeCandidates(m);
    }
  }
  removeCandidates(optimized.getMethod(),optimized.getStart(),optimized.getEnd());
  addCandidates(optimized.getMethod(),newCandidates);
}

Fixed version (ground truth):
@Override public void onSuccessfulOptimize(Candidate optimized,List<Candidate> newCandidates){
  globalCodesize+=getDeltaGlobalCodesize(optimized);
  Collection<MethodInfo> unreachable=optimized.getUnreachableMethods();
  if (unreachable != null && !unreachable.isEmpty()) {
    for (    MethodInfo m : unreachable) {
      removeCandidates(m);
    }
  }
  removeCandidate(optimized);
  removeCandidates(optimized.getMethod(),optimized.getStart(),optimized.getEnd());
  addCandidates(optimized.getMethod(),newCandidates);
}
Program: 186724
Project: 186724
Buggy source:
private InstructionHandle copyInstruction(MethodCode invokeeCode,StacksizeAnalysis stacksize,InstructionList il,InstructionHandle src,InstructionHandle next){
  InstructionHandle ih;
  Instruction instr=src.getInstruction();
  Instruction c=invokeSite.getInvoker().getCode().copyFrom(invokee.getClassInfo(),instr);
  if (instr instanceof LocalVariableInstruction) {
    int slot=maxLocals + ((LocalVariableInstruction)instr).getIndex();
    ((LocalVariableInstruction)c).setIndex(slot);
    ih=il.insert(next,c);
  }
 else   if (instr instanceof ReturnInstruction) {
    if (src.getNext() != null) {
      c=new GOTO(next);
      ih=il.insert(next,c);
    }
 else {
      ih=null;
    }
    int stack=stacksize.getStacksizeBefore(src);
    Type type=((ReturnInstruction)instr).getType();
    stack-=type.getSize();
    if (stack != 0) {
      Instruction store=TypeHelper.createStoreInstruction(type,maxLocals);
      ih=il.insert(ih == null ? next : ih,store);
      Instruction load=TypeHelper.createLoadInstruction(type,maxLocals);
      il.append(ih,load);
      while (stack > 0) {
        if (stack > 1) {
          il.append(ih,new POP2());
          stack-=2;
        }
 else {
          il.append(ih,new POP());
          stack--;
        }
      }
    }
  }
 else   if (c instanceof BranchInstruction) {
    ih=il.insert(next,(BranchInstruction)c);
  }
 else {
    ih=il.insert(next,c);
  }
  return ih;
}

Fixed version (ground truth):
private InstructionHandle copyInstruction(MethodCode invokerCode,StacksizeAnalysis stacksize,InstructionList il,InstructionHandle src,InstructionHandle next){
  InstructionHandle ih;
  Instruction instr=src.getInstruction();
  Instruction c=invokerCode.copyFrom(invokee.getClassInfo(),instr);
  if (instr instanceof LocalVariableInstruction) {
    int slot=maxLocals + ((LocalVariableInstruction)instr).getIndex();
    ((LocalVariableInstruction)c).setIndex(slot);
    ih=il.insert(next,c);
  }
 else   if (instr instanceof ReturnInstruction) {
    if (src.getNext() != null) {
      c=new GOTO(next);
      ih=il.insert(next,c);
    }
 else {
      ih=null;
    }
    int stack=stacksize.getStacksizeBefore(src);
    Type type=((ReturnInstruction)instr).getType();
    stack-=type.getSize();
    if (stack != 0) {
      Instruction store=TypeHelper.createStoreInstruction(type,maxLocals);
      ih=il.insert(ih == null ? next : ih,store);
      Instruction load=TypeHelper.createLoadInstruction(type,maxLocals);
      il.append(ih,load);
      while (stack > 0) {
        if (stack > 1) {
          il.append(ih,new POP2());
          stack-=2;
        }
 else {
          il.append(ih,new POP());
          stack--;
        }
      }
    }
  }
 else   if (c instanceof BranchInstruction) {
    ih=il.insert(next,(BranchInstruction)c);
  }
 else {
    ih=il.insert(next,c);
  }
  return ih;
}
Program: 186725
Project: 186725
Buggy source:
private Map<InvokeSite,InvokeSite> insertInvokee(AnalysisManager analyses,CallString callString,InstructionList il,InstructionHandle next){
  MethodCode code=getMethod().getCode();
  MethodCode invokeeCode=invokee.getCode();
  InstructionList iList=invokeeCode.getInstructionList(true,false);
  Map<InstructionHandle,InstructionHandle> instrMap=new HashMap<InstructionHandle,InstructionHandle>();
  Map<InvokeSite,InvokeSite> invokeMap=new HashMap<InvokeSite,InvokeSite>();
  StacksizeAnalysis stacksize=analyses.getStacksizeAnalysis(invokee);
  for (InstructionHandle src=iList.getStart(); src != null; src=src.getNext()) {
    InstructionHandle ih=copyInstruction(invokeeCode,stacksize,il,src,next);
    if (ih == null)     continue;
    code.copyCustomValues(invokee,ih,src);
    if (code.isInvokeSite(ih)) {
      InvokeSite newInvoke=code.getInvokeSite(ih);
      InvokeSite oldInvoke=invokeeCode.getInvokeSite(src);
      invokeMap.put(oldInvoke,newInvoke);
      setInlineCallString(code,ih,callString);
    }
    instrMap.put(src,ih);
  }
  remapTargets(instrMap,next);
  return invokeMap;
}

Fixed version (ground truth):
private Map<InvokeSite,InvokeSite> insertInvokee(AnalysisManager analyses,CallString callString,InstructionList il,InstructionHandle next){
  MethodCode code=getMethod().getCode();
  MethodCode invokeeCode=invokee.getCode();
  InstructionList iList=invokeeCode.getInstructionList(true,false);
  Map<InstructionHandle,InstructionHandle> instrMap=new HashMap<InstructionHandle,InstructionHandle>();
  Map<InvokeSite,InvokeSite> invokeMap=new HashMap<InvokeSite,InvokeSite>();
  StacksizeAnalysis stacksize=analyses.getStacksizeAnalysis(invokee);
  for (InstructionHandle src=iList.getStart(); src != null; src=src.getNext()) {
    InstructionHandle ih=copyInstruction(code,stacksize,il,src,next);
    if (ih == null)     continue;
    code.copyCustomValues(invokee,ih,src);
    if (code.isInvokeSite(ih)) {
      InvokeSite newInvoke=code.getInvokeSite(ih);
      InvokeSite oldInvoke=invokeeCode.getInvokeSite(src);
      invokeMap.put(oldInvoke,newInvoke);
      setInlineCallString(code,ih,callString);
    }
    instrMap.put(src,ih);
  }
  remapTargets(instrMap,next);
  return invokeMap;
}
Program: 186727
Project: 186727
Buggy source:
private InstructionHandle copyInstruction(MethodCode invokerCode,StacksizeAnalysis stacksize,InstructionList il,InstructionHandle src,InstructionHandle next){
  InstructionHandle ih;
  Instruction instr=src.getInstruction();
  Instruction c=invokerCode.copyFrom(invokee.getClassInfo(),instr);
  if (instr instanceof LocalVariableInstruction) {
    int slot=maxLocals + ((LocalVariableInstruction)instr).getIndex();
    ((LocalVariableInstruction)c).setIndex(slot);
    ih=il.insert(next,c);
  }
 else   if (instr instanceof ReturnInstruction) {
    if (src.getNext() != null) {
      c=new GOTO(next);
      ih=il.insert(next,c);
    }
 else {
      ih=null;
    }
    int stack=stacksize.getStacksizeBefore(src);
    Type type=((ReturnInstruction)instr).getType();
    stack-=type.getSize();
    if (stack != 0) {
      Instruction store=TypeHelper.createStoreInstruction(type,maxLocals);
      ih=il.insert(ih == null ? next : ih,store);
      Instruction load=TypeHelper.createLoadInstruction(type,maxLocals);
      il.append(ih,load);
      while (stack > 0) {
        if (stack > 1) {
          il.append(ih,new POP2());
          stack-=2;
        }
 else {
          il.append(ih,new POP());
          stack--;
        }
      }
    }
  }
 else   if (c instanceof BranchInstruction) {
    ih=il.insert(next,(BranchInstruction)c);
  }
 else {
    ih=il.insert(next,c);
  }
  return ih;
}

Fixed version (ground truth):
private InstructionHandle copyInstruction(MethodCode invokerCode,StacksizeAnalysis stacksize,InstructionList il,InstructionHandle src,InstructionHandle next){
  InstructionHandle ih;
  Instruction instr=src.getInstruction();
  Instruction c=invokerCode.copyFrom(invokee.getClassInfo(),instr);
  if (instr instanceof LocalVariableInstruction) {
    int slot=maxLocals + ((LocalVariableInstruction)instr).getIndex();
    ((LocalVariableInstruction)c).setIndex(slot);
    ih=il.insert(next,c);
  }
 else   if (instr instanceof ReturnInstruction) {
    if (src.getNext() != null) {
      c=new GOTO(next);
      ih=il.insert(next,(BranchInstruction)c);
    }
 else {
      ih=null;
    }
    int stack=stacksize.getStacksizeBefore(src);
    Type type=((ReturnInstruction)instr).getType();
    stack-=type.getSize();
    if (stack != 0) {
      Instruction store=TypeHelper.createStoreInstruction(type,maxLocals);
      ih=il.insert(ih == null ? next : ih,store);
      Instruction load=TypeHelper.createLoadInstruction(type,maxLocals);
      il.append(ih,load);
      while (stack > 0) {
        if (stack > 1) {
          il.append(ih,new POP2());
          stack-=2;
        }
 else {
          il.append(ih,new POP());
          stack--;
        }
      }
    }
  }
 else   if (c instanceof BranchInstruction) {
    ih=il.insert(next,(BranchInstruction)c);
  }
 else {
    ih=il.insert(next,c);
  }
  return ih;
}
Program: 186728
Project: 186728
Buggy source:
private void remapTargets(Map<InstructionHandle,InstructionHandle> instrMap,InstructionHandle next){
  for (  Map.Entry<InstructionHandle,InstructionHandle> e : instrMap.entrySet()) {
    InstructionHandle oldIh=e.getKey();
    InstructionHandle newIh=e.getValue();
    Instruction i=oldIh.getInstruction();
    Instruction c=newIh.getInstruction();
    if (c instanceof BranchInstruction) {
      BranchInstruction bi=(BranchInstruction)i;
      BranchInstruction bc=(BranchInstruction)c;
      InstructionHandle target=bi.getTarget();
      if (bi instanceof Select) {
        InstructionHandle[] targets=((Select)bi).getTargets();
        for (int j=0; j < targets.length; j++) {
          InstructionHandle newTarget=instrMap.get(targets[j]);
          ((Select)bc).setTarget(j,newTarget != null ? newTarget : next);
        }
      }
      InstructionHandle newTarget=instrMap.get(target);
      bc.setTarget(newTarget != null ? newTarget : next);
    }
  }
}

Fixed version (ground truth):
private void remapTargets(Map<InstructionHandle,InstructionHandle> instrMap,InstructionHandle next){
  for (  Map.Entry<InstructionHandle,InstructionHandle> e : instrMap.entrySet()) {
    InstructionHandle oldIh=e.getKey();
    InstructionHandle newIh=e.getValue();
    Instruction i=oldIh.getInstruction();
    Instruction c=newIh.getInstruction();
    if (i instanceof BranchInstruction) {
      BranchInstruction bi=(BranchInstruction)i;
      BranchInstruction bc=(BranchInstruction)c;
      InstructionHandle target=bi.getTarget();
      if (bi instanceof Select) {
        InstructionHandle[] targets=((Select)bi).getTargets();
        for (int j=0; j < targets.length; j++) {
          InstructionHandle newTarget=instrMap.get(targets[j]);
          ((Select)bc).setTarget(j,newTarget != null ? newTarget : next);
        }
      }
      InstructionHandle newTarget=instrMap.get(target);
      bc.setTarget(newTarget != null ? newTarget : next);
    }
  }
}
Program: 186729
Project: 186729
Buggy source:
public Set<ExecutionContext> getInstances(){
  return instances;
}

Fixed version (ground truth):
public Set<ExecutionContext> getInstances(){
  return Collections.unmodifiableSet(instances);
}
Program: 186730
Project: 186730
Buggy source:
public void inline(InvokeSite invokeSite,MethodInfo invokee){
  updateCodesize(invokeSite.getInvoker());
  onExecCountUpdate();
}

Fixed version (ground truth):
public void inline(InvokeSite invokeSite,MethodInfo invokee){
  Set<ExecutionContext> nodes=new HashSet<ExecutionContext>(callGraph.getNodes(invokeSite.getInvoker()));
  List<ExecutionContext> queue=new LinkedList<ExecutionContext>(nodes);
  while (!queue.isEmpty()) {
    ExecutionContext node=queue.remove(0);
    for (    ExecutionContext child : callGraph.getChildren(node)) {
      if (!cacheBlocks.containsKey(child) && !nodes.contains(child)) {
        nodes.add(child);
        queue.add(child);
      }
    }
  }
  updateCodesize(nodes);
  onExecCountUpdate();
}
Program: 186731
Project: 186731
Buggy source:
public void updateCodesize(MethodInfo method){
  updateBlockCounts(callGraph.getNodes(method));
}

Fixed version (ground truth):
public void updateCodesize(Set<ExecutionContext> nodes){
  updateBlockCounts(nodes);
}
Program: 186732
Project: 186732
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);
  }
  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;
  }
  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;
}
Program: 186733
Project: 186733
Buggy source:
private void updateCallgraph(CallGraph cg,Map<InvokeSite,InvokeSite> invokeMap){
  Ternary acyclic=cg.getAcyclicity();
  for (  ExecutionContext invoker : cg.getNodes(getMethod())) {
    for (    ExecutionContext invokeeNode : cg.getInvokedNodes(invoker,invokeSite,invokee)) {
      for (      ExecutionContext child : cg.getChildren(invokeeNode)) {
        ExecutionContext newInvokee;
        if (!child.getCallString().isEmpty()) {
          CallString cs=invoker.getCallString();
          cs=cs.push(invokeMap.get(child.getCallString().top()),appInfo.getCallstringLength());
          newInvokee=cg.copyNodeRecursive(child,cs,appInfo.getCallstringLength());
        }
 else {
          newInvokee=child;
        }
        cg.addEdge(invoker,newInvokee);
      }
    }
  }
  if (!cg.removeNodes(invokeSite,invokee,true)) {
    if (!searchInvokeSites()) {
      cg.removeEdges(getMethod(),invokee,true);
    }
  }
  if (acyclic != Ternary.UNKNOWN) {
    cg.setAcyclicity(acyclic == Ternary.TRUE);
  }
}

Fixed version (ground truth):
private void updateCallgraph(CallGraph cg,Map<InvokeSite,InvokeSite> invokeMap){
  Ternary acyclic=cg.getAcyclicity();
  List<ExecutionContext> nodes=new ArrayList<ExecutionContext>(cg.getNodes(getMethod()));
  for (  ExecutionContext invoker : nodes) {
    for (    ExecutionContext invokeeNode : cg.getInvokedNodes(invoker,invokeSite,invokee)) {
      for (      ExecutionContext child : cg.getChildren(invokeeNode)) {
        ExecutionContext newInvokee;
        if (!child.getCallString().isEmpty()) {
          CallString cs=invoker.getCallString();
          cs=cs.push(invokeMap.get(child.getCallString().top()),appInfo.getCallstringLength());
          newInvokee=cg.copyNodeRecursive(child,cs,appInfo.getCallstringLength());
        }
 else {
          newInvokee=child;
        }
        cg.addEdge(invoker,newInvokee);
      }
    }
  }
  if (!cg.removeNodes(invokeSite,invokee,true)) {
    if (!searchInvokeSites()) {
      cg.removeEdges(getMethod(),invokee,true);
    }
  }
  if (acyclic != Ternary.UNKNOWN) {
    cg.setAcyclicity(acyclic == Ternary.TRUE);
  }
}
Program: 186734
Project: 186734
Buggy source:
HighResolutionTime add(long millis,int nanos,HighResolutionTime dest){
  dest.set(addSafe(this.millis,millis),((long)this.nanos) + nanos);
  return dest;
}

Fixed version (ground truth):
/** 
 * Behaves exactly like target.wait() but with the enhancement that it waits with a precision of HighResolutionTime.
 * @param target The object on which to wait. The current thread must have a lock on the object.
 * @param time The time for which to wait. If it is RelativeTime(0,0) then wait indefinitely. If it is null then wait indefinitely.
 * @throws java.lang.InterruptedException
 */
HighResolutionTime add(long millis,int nanos,HighResolutionTime dest){
  dest.set(addSafe(this.millis,millis),((long)this.nanos) + nanos);
  return dest;
}
Program: 186735
Project: 186735
Buggy source:
@Override public void visitSelect(Select obj){
  super.visitSelect(obj);
  for (  InstructionHandle tih : obj.getTargets()) {
    flowInfo.addTarget(tih,ControlFlowGraph.EdgeKind.SELECT_EDGE);
    this.targeted.add(tih);
  }
}

Fixed version (ground truth):
@Override public void visitSelect(Select obj){
  super.visitSelect(obj);
  flowInfo.addTarget(obj.getTarget(),ControlFlowGraph.EdgeKind.SELECT_EDGE);
  this.targeted.add(obj.getTarget());
  for (  InstructionHandle tih : obj.getTargets()) {
    flowInfo.addTarget(tih,ControlFlowGraph.EdgeKind.SELECT_EDGE);
    this.targeted.add(tih);
  }
}
Program: 186736
Project: 186736
Buggy source:
public static AnnotationElementValue createValue(DataInputStream in,ConstantPool cp) throws IOException {
  byte tag=in.readByte();
switch (tag) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'T':
case 'J':
case 'S':
case 'Z':
case 's':
    short constValueIndex=in.readShort();
  return new AnnotationElementValue(tag,cp,constValueIndex);
case 'e':
case 'c':
case '@':
case '[':
default :
throw new UnsupportedOperationException("String_Node_Str" + ((char)tag) + "String_Node_Str");
}
}

Fixed version (ground truth):
public static AnnotationElementValue createValue(DataInputStream in,ConstantPool cp) throws IOException {
  byte tag=in.readByte();
switch (tag) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'T':
case 'J':
case 'S':
case 'Z':
case 's':
    short constValueIndex=in.readShort();
  return new AnnotationElementValue(tag,cp,constValueIndex);
case 'e':
short typeNameIndex=in.readShort();
short constNameIndex=in.readShort();
return new AnnotationElementValue(tag,cp,typeNameIndex,constNameIndex);
case 'c':
short classInfoIndex=in.readShort();
return new AnnotationElementValue(tag,cp,classInfoIndex);
case '@':
Annotation annotation=Annotation.createAnnotation(in,cp);
return new AnnotationElementValue(tag,cp,annotation);
case '[':
short numValues=in.readShort();
List<AnnotationElementValue> arrayValue=new ArrayList<AnnotationElementValue>(numValues);
for (int i=0; i < numValues; i++) {
arrayValue.add(createValue(in,cp));
}
return new AnnotationElementValue(tag,cp,arrayValue);
default :
throw new UnsupportedOperationException("String_Node_Str" + ((char)tag) + "String_Node_Str");
}
}
Program: 186737
Project: 186737
Buggy source:
public int length(){
switch (tag) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'T':
case 'J':
case 'S':
case 'Z':
case 's':
    return 3;
case 'e':
case 'c':
case '@':
case '[':
default :
  throw new UnsupportedOperationException("String_Node_Str" + ((char)tag) + "String_Node_Str");
}
}

Fixed version (ground truth):
public int length(){
switch (tag) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'T':
case 'J':
case 'S':
case 'Z':
case 's':
    return 3;
case 'e':
  return 5;
case 'c':
return 3;
case '@':
return 1 + annotation.length();
case '[':
int length=3;
for (AnnotationElementValue ev : arrayValue) {
length+=ev.length();
}
return length;
default :
throw new UnsupportedOperationException("String_Node_Str" + ((char)tag) + "String_Node_Str");
}
}
Program: 186738
Project: 186738
Buggy source:
public void dump(DataOutputStream out) throws IOException {
  out.writeByte(tag);
switch (tag) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'T':
case 'J':
case 'S':
case 'Z':
case 's':
    out.writeShort(constValueIndex);
  return;
case 'e':
case 'c':
case '@':
case '[':
default :
throw new UnsupportedOperationException("String_Node_Str" + ((char)tag) + "String_Node_Str");
}
}

Fixed version (ground truth):
public void dump(DataOutputStream out) throws IOException {
  out.writeByte(tag);
switch (tag) {
case 'B':
case 'C':
case 'D':
case 'F':
case 'T':
case 'J':
case 'S':
case 'Z':
case 's':
    out.writeShort(constValueIndex);
  return;
case 'e':
out.writeShort(typeNameIndex);
out.writeShort(constNameIndex);
return;
case 'c':
out.writeShort(classInfoIndex);
return;
case '@':
annotation.dump(out);
return;
case '[':
out.writeShort(arrayValue.size());
for (AnnotationElementValue ev : arrayValue) {
ev.dump(out);
}
return;
default :
throw new UnsupportedOperationException("String_Node_Str" + ((char)tag) + "String_Node_Str");
}
}
Program: 186739
Project: 186739
Buggy source:
public AnnotationElementValue(byte tag,ConstantPool constantPool,short constValueIndex){
  this.tag=tag;
  this.constantPool=constantPool;
  this.constValueIndex=constValueIndex;
}

Fixed version (ground truth):
public AnnotationElementValue(byte tag,ConstantPool constantPool,Annotation annotation){
  this.tag=tag;
  this.constantPool=constantPool;
  this.annotation=annotation;
}
Program: 186740
Project: 186740
Buggy source:
@Override public void visitSelect(Select obj){
  super.visitSelect(obj);
  for (  InstructionHandle tih : obj.getTargets()) {
    flowInfo.addTarget(tih,ControlFlowGraph.EdgeKind.SELECT_EDGE);
    this.targeted.add(tih);
  }
}

Fixed version (ground truth):
@Override public void visitSelect(Select obj){
  super.visitSelect(obj);
  flowInfo.addTarget(obj.getTarget(),ControlFlowGraph.EdgeKind.SELECT_EDGE);
  this.targeted.add(obj.getTarget());
  for (  InstructionHandle tih : obj.getTargets()) {
    flowInfo.addTarget(tih,ControlFlowGraph.EdgeKind.SELECT_EDGE);
    this.targeted.add(tih);
  }
}
Program: 186741
Project: 186741
Buggy source:
/** 
 * Get the flowgraph of the given method. <p> A new callgraph is constructed when this method is called, changes to this graph are not automatically stored back to MethodCode. If you want to keep changes to the graph you need to keep a reference to this graph yourself. </p>
 * @param mi the method to get the CFG for
 * @return the CFG for the method.
 */
public ControlFlowGraph getFlowGraph(MethodInfo mi){
  if (!mi.hasCode())   return null;
  ControlFlowGraph cfg;
  try {
    cfg=new ControlFlowGraph(mi,CallString.EMPTY,callGraph);
    cfg.resolveVirtualInvokes();
    cfg.insertReturnNodes();
    cfg.insertContinueLoopNodes();
  }
 catch (  BadGraphException e) {
    throw new BadGraphError(e.getMessage(),e);
  }
  return cfg;
}

Fixed version (ground truth):
/** 
 * Get the flowgraph of the given method. <p> A new callgraph is constructed when this method is called, changes to this graph are not automatically stored back to MethodCode. If you want to keep changes to the graph you need to keep a reference to this graph yourself. </p>
 * @param mi the method to get the CFG for
 * @return the CFG for the method.
 */
public ControlFlowGraph getFlowGraph(MethodInfo mi){
  if (!mi.hasCode())   return null;
  ControlFlowGraph cfg;
  try {
    cfg=mi.getCode().getControlFlowGraph(false);
    cfg.resolveVirtualInvokes();
    cfg.insertReturnNodes();
    cfg.insertContinueLoopNodes();
  }
 catch (  BadGraphException e) {
    throw new BadGraphError(e.getMessage(),e);
  }
  return cfg;
}
Program: 186742
Project: 186742
Buggy source:
@Override public void visitInvokeNode(ControlFlowGraph.InvokeNode n){
  if (n.getVirtualNode() != null) {
    Set<MethodInfo> actuallyReachable=n.getVirtualNode().getImplementedMethods(ctx.getCallString());
    if (!actuallyReachable.contains(n.getImplementedMethod()))     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) {
    Set<MethodInfo> actuallyReachable=n.getVirtualNode().getImplementedMethods(ctx.getCallString(),project.getCallGraph());
    if (!actuallyReachable.contains(n.getImplementedMethod()))     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: 186743
Project: 186743
Buggy source:
public void recordResult(WcetCost wcet,double timeDiff,double solverTime){
  if (resultRecord == null)   return;
  Config c=projectConfig.getConfig();
  if (projectConfig.addPerformanceResults()) {
    recordCVS("String_Node_Str","String_Node_Str",wcet,timeDiff,solverTime,c.getOption(JOPConfig.CACHE_IMPL),c.getOption(JOPConfig.CACHE_SIZE_WORDS),c.getOption(JOPConfig.CACHE_BLOCKS),c.getOption(IPETConfig.STATIC_CACHE_APPROX),c.getOption(IPETConfig.ASSUME_MISS_ONCE_ON_INVOKE));
  }
 else {
    recordCVS("String_Node_Str","String_Node_Str",wcet,c.getOption(JOPConfig.CACHE_IMPL),c.getOption(JOPConfig.CACHE_SIZE_WORDS),c.getOption(JOPConfig.CACHE_BLOCKS),c.getOption(IPETConfig.STATIC_CACHE_APPROX),c.getOption(IPETConfig.ASSUME_MISS_ONCE_ON_INVOKE));
  }
}

Fixed version (ground truth):
public void recordResult(WcetCost wcet,double timeDiff,double solverTime){
  if (resultRecord == null)   return;
  Config c=projectConfig.getConfig();
  OptionGroup o=JOPConfig.getOptions(c);
  if (projectConfig.addPerformanceResults()) {
    recordCVS("String_Node_Str","String_Node_Str",wcet,timeDiff,solverTime,o.getOption(JOPConfig.CACHE_IMPL),o.getOption(JOPConfig.CACHE_SIZE_WORDS),o.getOption(JOPConfig.CACHE_BLOCKS),c.getOption(IPETConfig.STATIC_CACHE_APPROX),c.getOption(IPETConfig.ASSUME_MISS_ONCE_ON_INVOKE));
  }
 else {
    recordCVS("String_Node_Str","String_Node_Str",wcet,o.getOption(JOPConfig.CACHE_IMPL),o.getOption(JOPConfig.CACHE_SIZE_WORDS),o.getOption(JOPConfig.CACHE_BLOCKS),c.getOption(IPETConfig.STATIC_CACHE_APPROX),c.getOption(IPETConfig.ASSUME_MISS_ONCE_ON_INVOKE));
  }
}