nus-yam/ex-repair huggingface dataset:
Program: 186656
Project: 186656
Buggy source:
private Set<MethodInfo> runAnalysis(DirectedGraph<ExecutionContext,ContextEdge> reversed){
  TopologicalOrderIterator<ExecutionContext,ContextEdge> topOrder=new TopologicalOrderIterator<ExecutionContext,ContextEdge>(reversed);
  MethodCacheAnalysis cacheAnalysis=analyses.getMethodCacheAnalysis();
  Set<MethodInfo> changed=new HashSet<MethodInfo>();
  while (topOrder.hasNext()) {
    ExecutionContext node=topOrder.next();
    RecursiveWcetAnalysis<AnalysisContextLocal>.LocalWCETSolution sol=recursiveAnalysis.computeSolution(node.getMethodInfo(),cacheAnalysis.getAnalysisContext(node.getCallString()));
    wcaNodeFlow.put(node,sol.getNodeFlow());
    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);
  MethodCacheAnalysis cacheAnalysis=analyses.getMethodCacheAnalysis();
  Set<MethodInfo> changed=new HashSet<MethodInfo>();
  while (topOrder.hasNext()) {
    ExecutionContext node=topOrder.next();
    RecursiveWcetAnalysis<AnalysisContextLocal>.LocalWCETSolution sol=recursiveAnalysis.computeSolution(node.getMethodInfo(),cacheAnalysis.getAnalysisContext(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;
}
Program: 186658
Project: 186658
Buggy source:
public long getTotalInvokeReturnMissCosts(CallString callString){
  if (analysisType == AnalysisType.ALWAYS_HIT)   return 0;
  int size=0;
  for (  MethodInfo method : callGraph.findImplementations(callString)) {
    size=Math.max(size,method.getCode().getNumberOfWords());
  }
  WCETProcessorModel pm=analyses.getJCopter().getWCETProcessorModel();
  int sizeInvoker=callString.top().getInvoker().getCode().getNumberOfWords();
  return getInvokeMissCount(callString) * pm.getMethodCacheMissPenalty(size,true) - getReturnMissCount(callString) * pm.getMethodCacheMissPenalty(sizeInvoker,false);
}

Fixed version (ground truth):
public long getTotalInvokeReturnMissCosts(CallString callString){
  if (analysisType == AnalysisType.ALWAYS_HIT)   return 0;
  AppInfo appInfo=AppInfo.getSingleton();
  int size=0;
  for (  MethodInfo method : appInfo.findImplementations(callString)) {
    size=Math.max(size,method.getCode().getNumberOfWords());
  }
  WCETProcessorModel pm=analyses.getJCopter().getWCETProcessorModel();
  int sizeInvoker=callString.top().getInvoker().getCode().getNumberOfWords();
  return getInvokeMissCount(callString) * pm.getMethodCacheMissPenalty(size,true) - getReturnMissCount(callString) * pm.getMethodCacheMissPenalty(sizeInvoker,false);
}
Program: 186659
Project: 186659
Buggy source:
/** 
 * @return the first instruction in the instruction list which will be modified. After optimization this needsto refer to the first modified or new instruction.
 */
public InstructionHandle getStart(){
  return start;
}

Fixed version (ground truth):
public InstructionHandle getStart(){
  return start;
}
Program: 186660
Project: 186660
Buggy source:
/** 
 * @return the last instruction in the instruction list which will be modified. After optimization this needsto refer to the last modified or new instruction.
 */
public InstructionHandle getEnd(){
  return end;
}

Fixed version (ground truth):
public InstructionHandle getEnd(){
  return end;
}
Program: 186661
Project: 186661
Buggy source:
private long calcLocalGain(AnalysisManager analyses){
  long gain=jcopter.getWCETProcessorModel().getExecutionTime(context,invokeSite.getInstructionHandle());
  if (!preciseCycleEstimate) {
    gain-=invokee.getArgumentTypes().length * storeCycles;
    if (!invokee.isStatic())     gain-=storeCycles;
    if (needsNPCheck)     gain-=checkNPCycles;
  }
 else {
  }
  return gain;
}

Fixed version (ground truth):
private long calcLocalGain(AnalysisManager analyses){
  long gain=jcopter.getWCETProcessorModel().getExecutionTime(context,invokeSite.getInstructionHandle());
  if (!preciseCycleEstimate) {
    gain-=invokee.getArgumentTypes().length * storeCycles;
    if (!invokee.isStatic())     gain-=storeCycles;
    if (needsNPCheck)     gain-=checkNPCycles;
    gain+=deltaReturnCycles;
  }
 else {
    throw new AppInfoError("String_Node_Str");
  }
  return gain;
}
Program: 186662
Project: 186662
Buggy source:
@Override public boolean recalculate(AnalysisManager analyses,StacksizeAnalysis stacksize){
  deltaLocals=invokee.getCode().getMaxLocals();
  if (!checkStackAndLocals(stacksize)) {
    return false;
  }
  deltaCodesize=calcDeltaCodesize(analyses);
  isLastLocalInvoke=checkIsLastLocalInvoke();
  isLastInvoke=isLastLocalInvoke && checkIsLastInvoker();
  localGain=calcLocalGain(analyses);
  deltaCacheMiss=-analyses.getMethodCacheAnalysis().getInvokeReturnMissCosts(invokeSite,invokee);
  return true;
}

Fixed version (ground truth):
@Override public boolean recalculate(AnalysisManager analyses,StacksizeAnalysis stacksize){
  deltaLocals=invokee.getCode().getMaxLocals();
  if (!checkStackAndLocals(stacksize)) {
    return false;
  }
  deltaCodesize=calcDeltaCodesize(analyses);
  isLastLocalInvoke=checkIsLastLocalInvoke();
  isLastInvoke=isLastLocalInvoke && checkIsLastInvoker();
  localGain=calcLocalGain(analyses);
  deltaCacheMiss=calcDeltaCacheMissCosts(analyses);
  return true;
}
Program: 186663
Project: 186663
Buggy source:
public boolean doExcludeInvokee(MethodInfo invokee){
  String className=invokee.getClassName();
  for (  MethodInfo target : jcopter.getJConfig().getWCATargets()) {
    if (target.equals(invokee)) {
      return false;
    }
  }
  for (  String prefix : ignorePrefix) {
    if (className.startsWith(prefix + "String_Node_Str") || className.equals(prefix) || prefix.equals(className + "String_Node_Str" + invokee.getShortName())|| prefix.equals(className + "String_Node_Str" + invokee.getShortName())) {
      return true;
    }
  }
  return false;
}

Fixed version (ground truth):
public boolean doExcludeInvokee(MethodInfo invokee){
  String className=invokee.getClassName();
  for (  MethodInfo target : jcopter.getJConfig().getWCATargets()) {
    if (target.equals(invokee)) {
      return true;
    }
  }
  for (  String prefix : ignorePrefix) {
    if (className.startsWith(prefix + "String_Node_Str") || className.equals(prefix) || prefix.equals(className + "String_Node_Str" + invokee.getShortName())|| prefix.equals(className + "String_Node_Str" + invokee.getShortName())) {
      return true;
    }
  }
  return false;
}
Program: 186667
Project: 186667
Buggy source:
public boolean removeNode(ExecutionContext context,boolean removeUnreachable){
  if (removeUnreachable) {
    for (    ContextEdge e : callGraph.outgoingEdgesOf(context)) {
      removeEdge(e,removeUnreachable);
    }
  }
  return callGraph.removeVertex(context);
}

Fixed version (ground truth):
public boolean removeNode(ExecutionContext context,boolean removeUnreachable){
  if (removeUnreachable) {
    List<ContextEdge> remove=new ArrayList<ContextEdge>(callGraph.outgoingEdgesOf(context));
    for (    ContextEdge e : remove) {
      removeEdge(e,removeUnreachable);
    }
  }
  return callGraph.removeVertex(context);
}
Program: 186669
Project: 186669
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--;
        }
      }
    }
    if (ih == null) {
      return null;
    }
  }
 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=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;
}
Program: 186670
Project: 186670
Buggy source:
private void remapTargets(Map<InstructionHandle,InstructionHandle> instrMap,InstructionHandle last,InstructionHandle oldLast){
  InstructionHandle src=oldLast;
  InstructionHandle ih=last;
  while (src != null) {
    Instruction i=src.getInstruction();
    Instruction c=ih.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++) {
          ((Select)bc).setTarget(j,instrMap.get(targets[j]));
        }
      }
      bc.setTarget(instrMap.get(target));
    }
    src=src.getPrev();
    ih=ih.getPrev();
  }
}

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 (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);
    }
  }
}
Program: 186671
Project: 186671
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.getPrev(),iList.getEnd());
  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(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;
}
Program: 186672
Project: 186672
Buggy source:
@Override public void sortCandidates(Set<MethodInfo> changedMethods){
  for (  MethodInfo method : changedMethods) {
    MethodData data=methodData.get(method);
    queue.removeAll(data.getRatios());
    data.getRatios().clear();
    Collection<RebateRatio> ratios=calculateRatios(method,data.getCandidates());
    data.getRatios().addAll(ratios);
    queue.addAll(ratios);
  }
}

Fixed version (ground truth):
@Override public void sortCandidates(Set<MethodInfo> changedMethods){
  for (  MethodInfo method : changedMethods) {
    MethodData data=methodData.get(method);
    if (data == null)     continue;
    queue.removeAll(data.getRatios());
    data.getRatios().clear();
    Collection<RebateRatio> ratios=calculateRatios(method,data.getCandidates());
    data.getRatios().addAll(ratios);
    queue.addAll(ratios);
  }
}
Program: 186674
Project: 186674
Buggy source:
public ExecutionContext(MethodInfo method){
  assert(method != null);
  this.method=method;
  this.callString=CallString.EMPTY;
}

Fixed version (ground truth):
public ExecutionContext(MethodInfo method){
  assert(method != null);
  this.method=method;
  this.callString=CallString.EMPTY;
  this.hash=callString.hashCode() * 31 + method.hashCode();
}
Program: 186675
Project: 186675
Buggy source:
@Override public int hashCode(){
  final int prime=31;
  int result=callString.hashCode();
  result=prime * result + method.hashCode();
  return result;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return hash;
}
Program: 186676
Project: 186676
Buggy source:
@Override public void onSetupConfig(AppSetup setup) throws Config.BadConfigurationException {
  OptionGroup options=setup.getConfig().getOptions();
  config=new JCopterConfig(options);
}

Fixed version (ground truth):
@Override public void onSetupConfig(AppSetup setup) throws Config.BadConfigurationException {
  OptionGroup options=setup.getConfig().getOptions();
  config=new JCopterConfig(options);
  ControlFlowGraph.setIgnoreATHROW(true);
}
Program: 186677
Project: 186677
Buggy source:
/** 
 * Return a set of methods which become unreachable (w.r.t. to the complete callgraph, not to the set of methods to optimize) after the optimization has been performed, e.g. due to inlining the last callsite. <p>This is used to calculate the resulting total codesize as well as to skip unused methods from optimizations.</p> <p>Note that the resultset can increase after another optimization took place.</p>
 * @return a set of methods which can be removed after the optimization, or null or an empty set if nothing changes.
 */
public Collection<MethodInfo> getUnreachableMethods(){
  return null;
}

Fixed version (ground truth):
/** 
 * Return a set of methods which become unreachable (w.r.t. to the complete callgraph, not to the set of methods to optimize) after the optimization has been performed, e.g. due to inlining the last callsite. <p>This is used to calculate the resulting total codesize as well as to skip unused methods from optimizations.</p> <p>Note that the resultset can become larger after another optimization took place. Also note that if a method becomes unreachable in the target- or WCA-callgraph but not in the main callgraph, it is not returned here.</p>
 * @return a set of methods which can be removed after the optimization, or null or an empty set if nothing changes.
 */
public Collection<MethodInfo> getUnreachableMethods(){
  return null;
}
Program: 186679
Project: 186679
Buggy source:
@Override public void sortCandidates(Set<MethodInfo> changedMethods){
  for (  MethodInfo method : changedMethods) {
    MethodData data=methodData.get(method);
    if (data == null)     continue;
    queue.removeAll(data.getRatios());
    data.getRatios().clear();
    Collection<RebateRatio> ratios=calculateRatios(method,data.getCandidates());
    data.getRatios().addAll(ratios);
    queue.addAll(ratios);
  }
}

Fixed version (ground truth):
@Override public void sortCandidates(Set<MethodInfo> changedMethods){
  for (  MethodInfo method : changedMethods) {
    MethodData data=methodData.get(method);
    if (data == null)     continue;
    if (!analyses.getTargetCallGraph().containsMethod(method)) {
      removeCandidates(method);
      continue;
    }
    queue.removeAll(data.getRatios());
    data.getRatios().clear();
    Collection<RebateRatio> ratios=calculateRatios(method,data.getCandidates());
    data.getRatios().addAll(ratios);
    queue.addAll(ratios);
  }
}
Program: 186680
Project: 186680
Buggy source:
public void removeCandidate(Candidate candidate){
  MethodData data=methodData.remove(candidate.getMethod());
  data.getCandidates().remove(candidate);
}

Fixed version (ground truth):
public void removeCandidate(Candidate candidate){
  MethodData data=methodData.get(candidate.getMethod());
  data.getCandidates().remove(candidate);
}
Program: 186681
Project: 186681
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);
  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);
  }
  for (  CallGraph cg : analyses.getCallGraphs()) {
    updateCallgraph(cg,invokeMap);
  }
  updateAnalyses(analyses,invokeMap);
  isLastInvoke=!analyses.getAppInfoCallGraph().containsMethod(invokee);
  return true;
}
Program: 186682
Project: 186682
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);
  }
  isLastInvoke=cg.containsMethod(invokee);
}

Fixed version (ground truth):
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);
  }
}
Program: 186683
Project: 186683
Buggy source:
/** 
 * Get the control flow graph associated with this method code or create a new one. <p> By default, changes to the returned CFG are compiled back before the InstructionList of this method is accessed. If you want a CFG where changes to it are not compiled back automatically, use   {@code new ControlFlowGraph(MethodInfo)}instead. Also if you want to construct a CFG for a specific context or with a different implementation finder, you need to construct a callgraph yourself, keep a reference to it as long as you want to keep modifications to the graph and you need ensure that changes to a graph invalidate other graphs of the same method yourself, if required. </p>
 * @param clean if true, compile and recreate the graph if {@link ControlFlowGraph#isClean()} returns false.
 * @return the CFG for this method.
 */
public ControlFlowGraph getControlFlowGraph(boolean clean){
  if (cfg != null && clean && !cfg.isClean()) {
    cfg.compile();
    cfg=null;
  }
  if (this.cfg == null) {
    try {
      cfg=new ControlFlowGraph(this.getMethodInfo());
      for (      AppEventHandler ah : AppInfo.getSingleton().getEventHandlers()) {
        ah.onCreateMethodControlFlowGraph(cfg,clean);
      }
    }
 catch (    BadGraphException e) {
      throw new BadGraphError("String_Node_Str" + methodInfo,e);
    }
  }
  return cfg;
}

Fixed version (ground truth):
/** 
 * Get the control flow graph associated with this method code or create a new one. <p> By default, changes to the returned CFG are compiled back before the InstructionList of this method is accessed. If you want a CFG where changes to it are not compiled back automatically, use   {@code new ControlFlowGraph(MethodInfo)}instead. Also if you want to construct a CFG for a specific context or with a different implementation finder, you need to construct a callgraph yourself, keep a reference to it as long as you want to keep modifications to the graph and you need ensure that changes to a graph invalidate other graphs of the same method yourself, if required. </p>
 * @param clean if true, compile and recreate the graph if {@link ControlFlowGraph#isClean()} returns false.
 * @return the CFG for this method.
 */
public ControlFlowGraph getControlFlowGraph(boolean clean){
  if (cfg != null && clean && !cfg.isClean()) {
    cfg.compile();
    cfg=null;
  }
  if (this.cfg == null) {
    try {
      cfg=new ControlFlowGraph(this.getMethodInfo());
      cfg.registerHandleNodes();
      for (      AppEventHandler ah : AppInfo.getSingleton().getEventHandlers()) {
        ah.onCreateMethodControlFlowGraph(cfg,clean);
      }
    }
 catch (    BadGraphException e) {
      throw new BadGraphError("String_Node_Str" + methodInfo,e);
    }
  }
  return cfg;
}
Program: 186684
Project: 186684
Buggy source:
/** 
 * Get the line number of the instruction. This may refer to a line number in another file. To get the correct source file for this instruction, use   {@link #getSourceFileName(InstructionHandle)}.
 * @see #getSourceFileName(InstructionHandle)
 * @param ih the instruction to check.
 * @return the line number of the instruction, or -1 if unknown.
 */
public int getLineNumber(InstructionHandle ih){
  InstructionHandle handle=findLineNumberHandle(ih);
  if (handle == null)   return -1;
  Integer line=(Integer)handle.getAttribute(KEY_LINENUMBER);
  if (line != null) {
    return line;
  }
  LineNumberGen entry=getLineNumberEntry(ih,false);
  return entry != null ? entry.getSourceLine() : -1;
}

Fixed version (ground truth):
/** 
 * Get the line number of the instruction. This may refer to a line number in another file. To get the correct source file for this instruction, use   {@link #getSourceFileName(InstructionHandle)}.
 * @see #getSourceFileName(InstructionHandle)
 * @param ih the instruction to check.
 * @return the line number of the instruction, or -1 if unknown.
 */
public int getLineNumber(InstructionHandle ih){
  InstructionHandle handle=findLineNumberHandle(ih);
  if (handle == null)   return -1;
  Integer line=(Integer)handle.getAttribute(KEY_LINENUMBER);
  if (line != null) {
    return line;
  }
  LineNumberGen entry=getLineNumberEntry(handle,false);
  return entry != null ? entry.getSourceLine() : -1;
}
Program: 186685
Project: 186685
Buggy source:
/** 
 * Return a new callstring, extended by the given invoke site. <p>Let   {@code n(1)} be the id of the given invoke site, and{@code n(2),...,n(k)} be the callstring represented by {@code this}<ol><li/>If k &lt;= maxDepth, the resulting callstring is   {@code n(1),n(2),...,n(k)}<li/>If k &gt;=   maxDepth, the resulting callstring is   {@code n(1),n(2),...,n(maxDepth)}</ol>
 * @see MethodCode#getInvokeSite(InstructionHandle)
 * @param is the invokesite to be pushed at the end of the string.
 * @param maxLen the maximum length of the callstring
 * @return a new callstring with the given invocation as the last element.
 */
public CallString push(InvokeSite is,int maxLen){
  if (maxLen == 0)   return EMPTY;
  int k=Math.min(callString.length + 1,maxLen);
  int end=callString.length + 1;
  InvokeSite[] cs=Arrays.copyOfRange(callString,end - k,end);
  cs[k - 1]=is;
  return new CallString(cs);
}

Fixed version (ground truth):
/** 
 * Return a new callstring, extended by the given invoke site. <p>Let   {@code n(1)} be the id of the given invoke site, and{@code n(2),...,n(k)} be the callstring represented by {@code this}<ol><li/>If k &lt;= maxDepth, the resulting callstring is   {@code n(1),n(2),...,n(k)}<li/>If k &gt;=   maxDepth, the resulting callstring is   {@code n(1),n(2),...,n(maxDepth)}</ol>
 * @see MethodCode#getInvokeSite(InstructionHandle)
 * @param is the invokesite to be pushed at the end of the string.
 * @param maxLen the maximum length of the callstring
 * @return a new callstring with the given invocation as the last element.
 */
public CallString push(InvokeSite is,int maxLen){
  if (maxLen <= 0)   return EMPTY;
  if (callString.length == 0) {
    return new CallString(is);
  }
  int k=Math.min(callString.length + 1,maxLen);
  int end=callString.length + 1;
  InvokeSite[] cs=Arrays.copyOfRange(callString,end - k,end);
  cs[k - 1]=is;
  return new CallString(cs);
}
Program: 186686
Project: 186686
Buggy source:
/** 
 * Get the node for an instruction handle. This only works if   {@link #registerHandleNodes()} has been called first.
 * @param ih The instruction handle of a method which has this CFG associated with it
 * @return The basic block node associated with an instruction handle
 */
public BasicBlockNode getHandleNode(InstructionHandle ih){
  BasicBlockNode blockNode=(BasicBlockNode)ih.getAttribute(KEY_CFGNODE);
  if (blockNode == null) {
    String errMsg="String_Node_Str" + ih.toString(true);
    logger.error(errMsg);
    return null;
  }
  return blockNode;
}

Fixed version (ground truth):
public BasicBlockNode getHandleNode(InstructionHandle ih,boolean ignoreMissingNodes){
  BasicBlockNode blockNode=(BasicBlockNode)ih.getAttribute(KEY_CFGNODE);
  if (blockNode == null && !ignoreMissingNodes) {
    String errMsg="String_Node_Str" + ih.toString(true);
    logger.error(errMsg);
    return null;
  }
  return blockNode;
}
Program: 186687
Project: 186687
Buggy source:
/** 
 * Inline all InvokeSites which are marked for inlining by an inline strategy.
 */
public void performGreedyOptimizer(){
  if (!getJConfig().doAllowExperimental())   return;
  if (!getJConfig().doOptimizeNormal())   return;
  GreedyOptimizer optimizer=new GreedyOptimizer(greedyConfig);
  if (getJConfig().doAssumeDynamicClassLoader()) {
    logger.info("String_Node_Str");
    return;
  }
 else {
    optimizer.addOptimizer(new InlineOptimizer(jcopter,inlineConfig));
  }
  logger.info("String_Node_Str");
  optimizer.optimize();
  logger.info("String_Node_Str");
}

Fixed version (ground truth):
/** 
 * Inline all InvokeSites which are marked for inlining by an inline strategy.
 */
public void performGreedyOptimizer(){
  if (!getJConfig().doOptimizeNormal())   return;
  GreedyOptimizer optimizer=new GreedyOptimizer(greedyConfig);
  if (getJConfig().doAssumeDynamicClassLoader()) {
    logger.info("String_Node_Str");
    return;
  }
 else {
    optimizer.addOptimizer(new InlineOptimizer(jcopter,inlineConfig));
  }
  logger.info("String_Node_Str");
  optimizer.optimize();
  logger.info("String_Node_Str");
}
Program: 186688
Project: 186688
Buggy source:
private void loadOptions() throws BadConfigurationException {
  if (getJConfig().doOptimizeNormal() && getJConfig().doAllowExperimental()) {
    greedyConfig=new GreedyConfig(jcopter,getGreedyOptions());
  }
  inlineConfig=new InlineConfig(getInlineOptions());
}

Fixed version (ground truth):
private void loadOptions() throws BadConfigurationException {
  if (getJConfig().doOptimizeNormal()) {
    greedyConfig=new GreedyConfig(jcopter,getGreedyOptions());
  }
  inlineConfig=new InlineConfig(getInlineOptions());
}
Program: 186689
Project: 186689
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){
  targetCallGraph=CallGraph.buildCallGraph(targets,new DefaultCallgraphBuilder(AppInfo.getSingleton().getCallstringLength()));
  execCountAnalysis=new ExecCountAnalysis(targetCallGraph);
  methodCacheAnalysis=new MethodCacheAnalysis(this,cacheAnalysisType,targetCallGraph);
  if (wcaRoots != null) {
    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");
  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);
    }
  }
}
Program: 186691
Project: 186691
Buggy source:
public void optimize(){
  List<MethodInfo> rootMethods=config.getTargetMethods();
  AnalysisManager analyses=initializeAnalyses();
  for (  CodeOptimizer opt : optimizers) {
    opt.initialize(analyses,rootMethods);
  }
  CandidateSelector selector;
  if (config.useWCA()) {
    selector=new WCETRebateSelector(analyses,config.getMaxCodesize());
  }
 else {
    selector=new ACETRebateSelector(analyses,config.getMaxCodesize());
  }
  selector.initialize();
  GreedyOrder order=config.getOrder();
  if (order == GreedyOrder.Global || (order == GreedyOrder.WCAFirst && !config.useWCA())) {
    optimizeMethods(analyses,selector,analyses.getTargetCallGraph().getMethodInfos());
  }
 else   if (order == GreedyOrder.Targets) {
    for (    MethodInfo target : config.getTargetMethods()) {
      optimizeMethods(analyses,selector,analyses.getTargetCallGraph().getReachableImplementationsSet(target));
    }
  }
 else   if (order == GreedyOrder.WCAFirst) {
    Set<MethodInfo> wcaMethods=analyses.getWCAMethods();
    optimizeMethods(analyses,selector,wcaMethods);
    Set<MethodInfo> others=new HashSet<MethodInfo>(analyses.getTargetCallGraph().getMethodInfos());
    others.removeAll(wcaMethods);
    selector=new ACETRebateSelector(analyses,config.getMaxCodesize());
    selector.initialize();
    optimizeMethods(analyses,selector,others);
  }
 else {
    throw new AppInfoError("String_Node_Str" + order + "String_Node_Str");
  }
}

Fixed version (ground truth):
public void optimize(){
  List<MethodInfo> rootMethods=config.getTargetMethods();
  resetCounters();
  AnalysisManager analyses=initializeAnalyses();
  for (  CodeOptimizer opt : optimizers) {
    opt.initialize(analyses,rootMethods);
  }
  CandidateSelector selector;
  if (config.useWCA()) {
    selector=new WCETRebateSelector(analyses,config.getMaxCodesize());
  }
 else {
    selector=new ACETRebateSelector(analyses,config.getMaxCodesize());
  }
  selector.initialize();
  GreedyOrder order=config.getOrder();
  if (order == GreedyOrder.Global || (order == GreedyOrder.WCAFirst && !config.useWCA())) {
    optimizeMethods(analyses,selector,analyses.getTargetCallGraph().getMethodInfos());
  }
 else   if (order == GreedyOrder.Targets) {
    for (    MethodInfo target : config.getTargetMethods()) {
      optimizeMethods(analyses,selector,analyses.getTargetCallGraph().getReachableImplementationsSet(target));
    }
  }
 else   if (order == GreedyOrder.WCAFirst) {
    Set<MethodInfo> wcaMethods=analyses.getWCAMethods();
    optimizeMethods(analyses,selector,wcaMethods);
    Set<MethodInfo> others=new HashSet<MethodInfo>(analyses.getTargetCallGraph().getMethodInfos());
    others.removeAll(wcaMethods);
    selector.printStatistics();
    selector=new ACETRebateSelector(analyses,config.getMaxCodesize());
    selector.initialize();
    optimizeMethods(analyses,selector,others);
  }
 else {
    throw new AppInfoError("String_Node_Str" + order + "String_Node_Str");
  }
  selector.printStatistics();
  printStatistics();
}
Program: 186692
Project: 186692
Buggy source:
private AnalysisManager initializeAnalyses(){
  AnalysisManager analyses=new AnalysisManager(jcopter);
  analyses.initAnalyses(config.getTargetMethods(),config.getCacheAnalysisType(),config.getWCATargets());
  return analyses;
}

Fixed version (ground truth):
private AnalysisManager initializeAnalyses(){
  AnalysisManager analyses=new AnalysisManager(jcopter);
  analyses.initAnalyses(config.getTargetMethods(),config.getCacheAnalysisType(),config.getWCATargets());
  logger.info("String_Node_Str" + analyses.getTargetCallGraph().getNodes().size());
  return analyses;
}
Program: 186693
Project: 186693
Buggy source:
protected boolean checkConstraints(Candidate candidate){
  int size=candidate.getMethod().getCode().getNumberOfBytes();
  size+=candidate.getDeltaLocalCodesize();
  if (size > processorModel.getMaxMethodSize())   return false;
  int newGlobalSize=globalCodesize + getDeltaGlobalCodesize(candidate);
  if (newGlobalSize > maxGlobalSize)   return false;
  return true;
}

Fixed version (ground truth):
protected boolean checkConstraints(Candidate candidate){
  int size=candidate.getMethod().getCode().getNumberOfBytes();
  size+=candidate.getDeltaLocalCodesize();
  if (size > processorModel.getMaxMethodSize())   return false;
  if (maxGlobalSize > 0) {
    int newGlobalSize=globalCodesize + getDeltaGlobalCodesize(candidate);
    if (newGlobalSize > maxGlobalSize)     return false;
  }
  return true;
}
Program: 186694
Project: 186694
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 ih=start;
  while (ih != null) {
    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;
    ih=ih.getNext();
  }
  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();
  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;
}
Program: 186695
Project: 186695
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=mi.getCode().getControlFlowGraph(false);
    cfg.resolveVirtualInvokes();
    cfg.insertReturnNodes();
    cfg.insertContinueLoopNodes();
    cfg.registerHandleNodes();
  }
 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: 186697
Project: 186697
Buggy source:
public void reset(InstructionHandle from,InstructionHandle to){
  InstructionHandle ih=from;
  while (ih != to) {
    results.put(ih,analysis.bottom());
    ih=ih.getNext();
  }
  results.put(ih,analysis.bottom());
}

Fixed version (ground truth):
public void reset(InstructionHandle from,InstructionHandle to){
  InstructionHandle ih=from;
  while (ih != to) {
    results.remove(ih);
    ih=ih.getNext();
  }
  results.put(ih,analysis.bottom());
}
Program: 186698
Project: 186698
Buggy source:
@Override public int hashCode(){
  return toString().hashCode();
}

Fixed version (ground truth):
@Override public int hashCode(){
  int result=className != null ? className.hashCode() : 0;
  result=31 * result + (memberName != null ? memberName.hashCode() : 0);
  result=31 * result + (descriptor != null ? descriptor.hashCode() : 0);
  return result;
}
Program: 186699
Project: 186699
Buggy source:
@Override public boolean equals(Object obj){
  if (this == obj)   return true;
  if (obj == null)   return false;
  if (!this.getClass().equals(obj.getClass()))   return false;
  return this.toString().equals(obj.toString());
}

Fixed version (ground truth):
@SuppressWarnings({"String_Node_Str"}) @Override public boolean equals(Object o){
  if (this == o)   return true;
  if (o == null || getClass() != o.getClass())   return false;
  MemberID memberID=(MemberID)o;
  if (className != null ? !className.equals(memberID.className) : memberID.className != null)   return false;
  if (memberName != null ? !memberName.equals(memberID.memberName) : memberID.memberName != null)   return false;
  if (descriptor != null ? !descriptor.equals(memberID.descriptor) : memberID.descriptor != null)   return false;
  return true;
}
Program: 186700
Project: 186700
Buggy source:
@Override public void onSetupAppInfo(AppSetup setup,AppInfo appInfo) throws BadConfigurationException {
  OptionGroup options=setup.getConfig().getOptions();
  config.checkOptions();
  executor=new PhaseExecutor(this,options);
}

Fixed version (ground truth):
@Override public void onSetupAppInfo(AppSetup setup,AppInfo appInfo) throws BadConfigurationException {
  OptionGroup options=setup.getConfig().getOptions();
  config.initialize();
  executor=new PhaseExecutor(this,options);
}
Program: 186701
Project: 186701
Buggy source:
/** 
 * Run all configured optimizations and perform the required analyses.
 */
public void optimize(){
  boolean firstPassDFA=useDFA() && !config.doOptimizeFastOnly();
  if (firstPassDFA) {
    executor.dataflowAnalysis(false);
  }
  executor.buildCallGraph(firstPassDFA);
  executor.dumpCallgraph("String_Node_Str");
  executor.removeDebugAttributes();
  executor.cleanupMethodCode();
  executor.performSimpleInline();
  if (useDFA()) {
    executor.dataflowAnalysis(true);
  }
  executor.buildCallGraph(useDFA());
  if (useWCET()) {
    wcetTool.rebuildCallGraph();
  }
 else {
    logger.info("String_Node_Str");
  }
  executor.performGreedyOptimizer();
  executor.cleanupMethodCode();
  executor.removeUnusedMembers();
  executor.relinkInvokesuper();
  executor.cleanupConstantPool();
}

Fixed version (ground truth):
/** 
 * Run all configured optimizations and perform the required analyses.
 */
public void optimize(){
  boolean firstPassDFA=useDFA() && !config.doOptimizeFastOnly();
  if (firstPassDFA) {
    executor.dataflowAnalysis(false);
  }
  executor.buildCallGraph(firstPassDFA);
  executor.dumpCallgraph("String_Node_Str");
  executor.removeDebugAttributes();
  executor.cleanupMethodCode();
  executor.performSimpleInline();
  if (useDFA()) {
    executor.dataflowAnalysis(true);
  }
  executor.buildCallGraph(useDFA());
  if (useWCA()) {
    wcetTool.rebuildCallGraph();
  }
 else {
    logger.info("String_Node_Str");
  }
  executor.performGreedyOptimizer();
  executor.cleanupMethodCode();
  executor.removeUnusedMembers();
  executor.relinkInvokesuper();
  executor.cleanupConstantPool();
}
Program: 186702
Project: 186702
Buggy source:
private void loadOptions() throws BadConfigurationException {
  if ("String_Node_Str".equals(options.getOption(OPTIMIZE))) {
    optimizeLevel=0;
  }
 else   if ("String_Node_Str".equals(options.getOption(OPTIMIZE))) {
    optimizeLevel=1;
  }
 else   if ("String_Node_Str".equals(options.getOption(OPTIMIZE))) {
    optimizeLevel=2;
  }
 else   if ("String_Node_Str".equals(options.getOption(OPTIMIZE))) {
    optimizeLevel=3;
  }
 else {
    throw new BadConfigurationException("String_Node_Str" + options.getOption(OPTIMIZE) + "String_Node_Str");
  }
  String max=options.getOption(MAX_CODE_SIZE);
  if (max != null) {
    max=max.toLowerCase();
    if (max.endsWith("String_Node_Str")) {
      maxCodesize=Integer.parseInt(max.substring(0,max.length() - 2)) * 1024;
    }
 else     if (max.endsWith("String_Node_Str")) {
      maxCodesize=Integer.parseInt(max.substring(0,max.length() - 2)) * 1024 * 1024;
    }
 else {
      maxCodesize=Integer.parseInt(max);
    }
  }
 else {
  }
  if (useWCA()) {
    wcaTargets=Config.parseMethodList(options.getOption(WCA_TARGETS));
  }
}

Fixed version (ground truth):
private void loadOptions() throws BadConfigurationException {
  if ("String_Node_Str".equals(options.getOption(OPTIMIZE))) {
    optimizeLevel=0;
  }
 else   if ("String_Node_Str".equals(options.getOption(OPTIMIZE))) {
    optimizeLevel=1;
  }
 else   if ("String_Node_Str".equals(options.getOption(OPTIMIZE))) {
    optimizeLevel=2;
  }
 else   if ("String_Node_Str".equals(options.getOption(OPTIMIZE))) {
    optimizeLevel=3;
  }
 else {
    throw new BadConfigurationException("String_Node_Str" + options.getOption(OPTIMIZE) + "String_Node_Str");
  }
  String max=options.getOption(MAX_CODE_SIZE);
  if (max != null) {
    max=max.toLowerCase();
    if (max.endsWith("String_Node_Str")) {
      maxCodesize=Integer.parseInt(max.substring(0,max.length() - 2)) * 1024;
    }
 else     if (max.endsWith("String_Node_Str")) {
      maxCodesize=Integer.parseInt(max.substring(0,max.length() - 2)) * 1024 * 1024;
    }
 else {
      maxCodesize=Integer.parseInt(max);
    }
  }
 else {
  }
}