nus-yam/ex-repair huggingface dataset:
Program: 186615
Project: 186615
Buggy source:
/** 
 * Analyze the cost for loading each distinct tag in the given segment at most once. This can also be used to count the number of distinct tags (given each tag the cost of 1), or the number of cache blocks for the variable block method cache (given each tag a cost equal to the number of cache blocks it needs)
 * @param segment the segment to analyze
 * @param accessEdges cache access edges partitioned by tag
 * @param costModel
 * @param useILP use integer variables (more expensive, more accurate)
 * @param analysisKey
 * @param wcetTool
 * @return
 * @throws InvalidFlowFactException 
 * @throws LpSolveException 
 */
public static <T>long computeMissOnceCost(Segment segment,Iterable<Entry<T,List<SuperGraphEdge>>> partition,F1<SuperGraphEdge,Long> costModel,boolean useILP,String analysisKey,WCETTool wcetTool) throws InvalidFlowFactException, LpSolveException {
  IPETConfig ipetConfig=new IPETConfig(wcetTool.getConfig());
  IPETSolver<SuperGraphEdge> ipetSolver=GlobalAnalysis.buildIpetProblem(wcetTool,analysisKey,segment,ipetConfig);
  addPersistenceSegmentConstraints(segment,partition,ipetSolver,costModel,analysisKey);
  double lpCost=ipetSolver.solve(null,useILP);
  long maxCacheCost=(long)(lpCost + 0.5);
  return maxCacheCost;
}

Fixed version (ground truth):
/** 
 * Analyze the cost for loading each distinct tag in the given segment at most once. This can also be used to count the number of distinct tags (given each tag the cost of 1), or the number of cache blocks for the variable block method cache (given each tag a cost equal to the number of cache blocks it needs)
 * @param segment the segment to analyze
 * @param accessEdges cache access edges partitioned by tag
 * @param costModel
 * @param useILP use integer variables (more expensive, more accurate)
 * @param analysisKey
 * @param wcetTool
 * @return
 * @throws InvalidFlowFactException 
 * @throws LpSolveException 
 */
public static <T>long computeMissOnceCost(Segment segment,Iterable<Entry<T,List<SuperGraphEdge>>> partition,F1<SuperGraphEdge,Long> costModel,boolean useILP,String analysisKey,WCETTool wcetTool) throws InvalidFlowFactException, LpSolveException {
  IPETConfig ipetConfig=new IPETConfig(wcetTool.getConfig());
  String problemKey=GlobalAnalysis.formatProblemName(analysisKey,segment.getEntryMethods().toString());
  IPETSolver<SuperGraphEdge> ipetSolver=GlobalAnalysis.buildIpetProblem(wcetTool,problemKey,segment,ipetConfig);
  addPersistenceSegmentConstraints(segment,partition,ipetSolver,costModel,analysisKey);
  double lpCost=ipetSolver.solve(null,useILP);
  long maxCacheCost=(long)(lpCost + 0.5);
  return maxCacheCost;
}
Program: 186616
Project: 186616
Buggy source:
/** 
 * @param persistenceSegment
 * @param ipetSolver
 * @param missEdgesOut
 */
public static <T>Set<SuperGraphEdge> addPersistenceSegmentConstraints(Segment persistenceSegment,Iterable<Entry<T,List<SuperGraphEdge>>> partition,IPETSolver<SuperGraphEdge> ipetSolver,F1<SuperGraphEdge,Long> costModel,Object analysisKey){
  HashSet<SuperGraphEdge> missEdges=new HashSet<SuperGraphEdge>();
  for (  Entry<T,List<SuperGraphEdge>> accessed : partition) {
    List<SuperGraphEdge> missOnceEdges=new ArrayList<SuperGraphEdge>();
    for (    SuperGraphEdge accessEdge : accessed.getValue()) {
      long cost=costModel.apply(accessEdge);
      SuperGraphEdge missEdge=SuperGraphSplitEdge.generateSplitEdges(accessEdge,analysisKey,1).iterator().next();
      ipetSolver.addConstraint(IPETUtils.relativeBound(Iterators.singleton(missEdge),Iterators.singleton(accessEdge),1));
      ipetSolver.addEdgeCost(missEdge,cost);
      missOnceEdges.add(missEdge);
    }
    ipetSolver.addConstraint(IPETUtils.flowBound(missOnceEdges,1));
    missEdges.addAll(missOnceEdges);
  }
  return missEdges;
}

Fixed version (ground truth):
/** 
 * Add constraints for a persistence segment
 * @param < T > cache tag type
 * @param < C > access edge collection type
 * @param persistenceSegment
 * @param partition
 * @param ipetSolver
 * @param costModel
 * @param analysisKey
 * @return
 */
public static <T,C extends Iterable<SuperGraphEdge>>Set<SuperGraphEdge> addPersistenceSegmentConstraints(Segment persistenceSegment,Iterable<Entry<T,C>> partition,IPETSolver<SuperGraphEdge> ipetSolver,F1<SuperGraphEdge,Long> costModel,Object analysisKey){
  HashSet<SuperGraphEdge> missEdges=new HashSet<SuperGraphEdge>();
  for (  Entry<T,C> accessed : partition) {
    List<SuperGraphEdge> missOnceEdges=new ArrayList<SuperGraphEdge>();
    for (    SuperGraphEdge accessEdge : accessed.getValue()) {
      long cost=costModel.apply(accessEdge);
      SuperGraphEdge missEdge=SuperGraphExtraCostEdge.generateExtraCostEdge(accessEdge,analysisKey,accessed.getKey());
      ipetSolver.addConstraint(IPETUtils.relativeBound(Iterators.singleton(missEdge),Iterators.singleton(accessEdge),1));
      ipetSolver.addEdgeCost(missEdge,cost);
      missOnceEdges.add(missEdge);
    }
    ipetSolver.addConstraint(IPETUtils.flowBound(missOnceEdges,1));
    missEdges.addAll(missOnceEdges);
  }
  return missEdges;
}
Program: 186617
Project: 186617
Buggy source:
/** 
 * Add miss once cost: for each method cache persistence segment, add maximum miss cost to the segment entries
 * @param segment
 * @param ipetSolver
 * @throws LpSolveException 
 * @throws InvalidFlowFactException 
 */
public Set<SuperGraphEdge> addMissOnceCost(Segment segment,IPETSolver<SuperGraphEdge> ipetSolver) throws InvalidFlowFactException, LpSolveException {
  Set<SuperGraphEdge> missEdges=new HashSet<SuperGraphEdge>();
  for (  Segment persistenceSegment : findPersistenceSegmentCover(segment,true)) {
    long cost=computeMissOnceCost(persistenceSegment,getCacheAccessesByTag(persistenceSegment).entrySet(),EDGE_MISS_COST,true,KEY,wcetTool);
    System.err.println("String_Node_Str" + persistenceSegment + "String_Node_Str"+ cost);
    for (    SuperGraphEdge entryEdge : persistenceSegment.getEntryEdges()) {
      if (!persistenceSegment.includesEdge(entryEdge)) {
        throw new AssertionError("String_Node_Str" + entryEdge);
      }
 else {
        missEdges.add(fixedAdditionalCostEdge(entryEdge,cost,ipetSolver));
      }
    }
  }
  return missEdges;
}

Fixed version (ground truth):
/** 
 * Add miss once cost: for each method cache persistence segment, add maximum miss cost to the segment entries
 * @param segment
 * @param ipetSolver
 * @throws LpSolveException 
 * @throws InvalidFlowFactException 
 */
public Set<SuperGraphEdge> addMissOnceCost(Segment segment,IPETSolver<SuperGraphEdge> ipetSolver) throws InvalidFlowFactException, LpSolveException {
  Set<SuperGraphEdge> missEdges=new HashSet<SuperGraphEdge>();
  int tag=0;
  for (  Segment persistenceSegment : findPersistenceSegmentCover(segment,true)) {
    tag++;
    long cost=computeMissOnceCost(persistenceSegment,getCacheAccessesByTag(persistenceSegment).entrySet(),EDGE_MISS_COST,true,KEY,wcetTool);
    WCETTool.logger.debug("String_Node_Str" + persistenceSegment + "String_Node_Str"+ cost);
    F1<SuperGraphEdge,Long> costModel=MiscUtils.const1(cost);
    Set<SuperGraphEdge> costEdges=CachePersistenceAnalysis.addFixedCostEdges(persistenceSegment.getEntryEdges(),ipetSolver,costModel,KEY + "String_Node_Str",tag);
    missEdges.addAll(costEdges);
  }
  return missEdges;
}
Program: 186618
Project: 186618
Buggy source:
/** 
 * Add always miss cost: for each access to the method cache, add cost of access
 * @param segment
 * @param ipetSolver
 */
public Set<SuperGraphEdge> addMissAlwaysCost(Segment segment,IPETSolver<SuperGraphEdge> ipetSolver){
  Set<SuperGraphEdge> missEdges=new HashSet<SuperGraphEdge>();
  for (  SuperGraphEdge accessEdge : collectCacheAccesses(segment)) {
    if (!segment.includesEdge(accessEdge)) {
      throw new AssertionError("String_Node_Str" + accessEdge);
    }
 else {
      missEdges.add(fixedAdditionalCostEdge(accessEdge,getMissCost(accessEdge),ipetSolver));
    }
  }
  return missEdges;
}

Fixed version (ground truth):
/** 
 * Add always miss cost: for each access to the method cache, add cost of access
 * @param segment
 * @param ipetSolver
 */
public Set<SuperGraphEdge> addMissAlwaysCost(Segment segment,IPETSolver<SuperGraphEdge> ipetSolver){
  Iterable<SuperGraphEdge> accessEdges=collectCacheAccesses(segment);
  for (  SuperGraphEdge accessEdge : accessEdges) {
    if (!segment.includesEdge(accessEdge)) {
      throw new AssertionError("String_Node_Str" + accessEdge);
    }
  }
  return CachePersistenceAnalysis.addFixedCostEdges(accessEdges,ipetSolver,EDGE_MISS_COST,KEY + "String_Node_Str",0);
}
Program: 186619
Project: 186619
Buggy source:
public static void dumpBarPlot(List<OCacheAnalysisResult> samples,PrintStream out){
  for (  Entry<Integer,List<OCacheAnalysisResult>> entryConfig : partitionByConfig(samples).entrySet()) {
    int config=entryConfig.getKey();
    boolean first=true;
    out.println("String_Node_Str" + config + "String_Node_Str");
    for (    Entry<Integer,List<OCacheAnalysisResult>> entry : partitionByLineSize(entryConfig.getValue()).entrySet()) {
      int lineSize=entry.getKey();
      out.printf("String_Node_Str",lineSize);
      List<OCacheAnalysisResult> results=entry.getValue();
      Collections.sort(results,OCacheAnalysisResult.wayLineComperator());
      Vector<Integer> sampleWays=new Vector<Integer>();
      for (      OCacheAnalysisResult r : results) {
        if (r.blockSize > 1)         continue;
        out.printf("String_Node_Str",r.cyclesPerAccess);
        sampleWays.add(r.ways);
      }
      out.println("String_Node_Str" + sampleWays);
    }
    out.println("String_Node_Str" + config + "String_Node_Str");
    List<OCacheAnalysisResult> results=entryConfig.getValue();
    Collections.sort(results,OCacheAnalysisResult.wayLineComperator());
    int oldWays=-1;
    int oldLineSize=-1;
    for (    OCacheAnalysisResult r : results) {
      if (r.ways != oldWays || r.lineWords != oldLineSize) {
        oldWays=r.ways;
        oldLineSize=r.lineWords;
        out.printf("String_Node_Str",r.ways,r.lineWords);
      }
      out.printf("String_Node_Str",r.cyclesPerAccess);
    }
    out.println("String_Node_Str");
  }
}

Fixed version (ground truth):
public static void dumpBarPlot(List<OCacheAnalysisResult> samples,PrintStream out){
  for (  Entry<Integer,List<OCacheAnalysisResult>> entryConfig : partitionByConfig(samples).entrySet()) {
    int config=entryConfig.getKey();
    out.println("String_Node_Str" + config + "String_Node_Str");
    for (    Entry<Integer,List<OCacheAnalysisResult>> entry : partitionByLineSize(entryConfig.getValue()).entrySet()) {
      int lineSize=entry.getKey();
      out.printf("String_Node_Str",lineSize);
      List<OCacheAnalysisResult> results=entry.getValue();
      Collections.sort(results,OCacheAnalysisResult.wayLineComperator());
      Vector<Integer> sampleWays=new Vector<Integer>();
      for (      OCacheAnalysisResult r : results) {
        if (r.blockSize > 1)         continue;
        out.printf("String_Node_Str",r.cyclesPerAccess);
        sampleWays.add(r.ways);
      }
      out.println("String_Node_Str" + sampleWays);
    }
    out.println("String_Node_Str" + config + "String_Node_Str");
    List<OCacheAnalysisResult> results=entryConfig.getValue();
    Collections.sort(results,OCacheAnalysisResult.wayLineComperator());
    int oldWays=-1;
    int oldLineSize=-1;
    for (    OCacheAnalysisResult r : results) {
      if (r.ways != oldWays || r.lineWords != oldLineSize) {
        oldWays=r.ways;
        oldLineSize=r.lineWords;
        out.printf("String_Node_Str",r.ways,r.lineWords);
      }
      out.printf("String_Node_Str",r.cyclesPerAccess);
    }
    out.println("String_Node_Str");
  }
}
Program: 186620
Project: 186620
Buggy source:
/** 
 * Compile the callgraph back into an instruction list and store it in the associated MethodCode. <p> We do not order the blocks here, this is a separate optimization Also, we do not insert jump instructions if the fallthrough edge of a block does not link to the next block in the block list. Instead an error is raised. </p> TODO create method to insert jump blocks where necessary
 */
public void compile(){
  InstructionList il=new InstructionList();
  Object[] attributes={KEY_CFGNODE};
  Map<BasicBlock,BasicBlockNode> blockMap=buildBlockNodeMap();
  for (int i=0; i < blocks.size(); i++) {
    BasicBlock bb=blocks.get(i);
    BasicBlockNode bbn=blockMap.get(bb);
    if (bbn == null) {
      continue;
    }
    for (    CFGEdge e : graph.outgoingEdgesOf(bbn)) {
      if (e.getKind() != EdgeKind.NEXT_EDGE)       continue;
      BasicBlock target=graph.getEdgeTarget(e).getBasicBlock();
      if (blocks.get(i + 1) != target) {
        throw new ControlFlowError("String_Node_Str" + i + "String_Node_Str"+ methodInfo);
      }
    }
  }
}

Fixed version (ground truth):
/** 
 * Compile the callgraph back into an instruction list and store it in the associated MethodCode. <p> We do not order the blocks here, this is a separate optimization Also, we do not insert jump instructions if the fallthrough edge of a block does not link to the next block in the block list. Instead an error is raised. </p> TODO create method to insert jump blocks where necessary
 */
public void compile(){
  InstructionList il=new InstructionList();
  Object[] attributes={KEY_CFGNODE};
  Map<BasicBlock,BasicBlockNode> blockMap=buildBlockNodeMap();
  for (int i=0; i < blocks.size(); i++) {
    BasicBlock bb=blocks.get(i);
    BasicBlockNode bbn=blockMap.get(bb);
    if (bbn == null) {
      continue;
    }
    for (    CFGEdge e : graph.outgoingEdgesOf(bbn)) {
      if (e.getKind() != EdgeKind.NEXT_EDGE)       continue;
      BasicBlock target=graph.getEdgeTarget(e).getBasicBlock();
      if (target == null)       continue;
      if (blocks.get(i + 1) != target) {
        throw new ControlFlowError("String_Node_Str" + i + "String_Node_Str"+ methodInfo);
      }
    }
  }
}
Program: 186621
Project: 186621
Buggy source:
public Type getType(){
  return fieldInfo != null ? fieldInfo.getType() : type;
}

Fixed version (ground truth):
public Type getType(){
  if (fieldInfo == null && type == null) {
    ClassInfo classInfo=classRef.getClassInfo();
    if (classInfo != null) {
      fieldInfo=classInfo.getFieldInfoInherited(name,true);
    }
  }
  if (fieldInfo != null)   return fieldInfo.getType();
  return type;
}
Program: 186622
Project: 186622
Buggy source:
public static StoreInstruction createStoreInstruction(Type type,int slot){
switch (type.getType()) {
case Constants.T_BOOLEAN:
case Constants.T_CHAR:
case Constants.T_SHORT:
case Constants.T_INT:
    return new ISTORE(slot);
case Constants.T_FLOAT:
  return new FSTORE(slot);
case Constants.T_LONG:
return new LSTORE(slot);
case Constants.T_DOUBLE:
return new DSTORE(slot);
case Constants.T_OBJECT:
case Constants.T_ARRAY:
return new ASTORE(slot);
default :
throw new AppInfoError("String_Node_Str" + type + "String_Node_Str"+ slot);
}
}

Fixed version (ground truth):
public static StoreInstruction createStoreInstruction(Type type,int slot){
switch (type.getType()) {
case Constants.T_BOOLEAN:
case Constants.T_BYTE:
case Constants.T_CHAR:
case Constants.T_SHORT:
case Constants.T_INT:
    return new ISTORE(slot);
case Constants.T_FLOAT:
  return new FSTORE(slot);
case Constants.T_LONG:
return new LSTORE(slot);
case Constants.T_DOUBLE:
return new DSTORE(slot);
case Constants.T_OBJECT:
case Constants.T_ARRAY:
return new ASTORE(slot);
default :
throw new AppInfoError("String_Node_Str" + type + "String_Node_Str"+ slot);
}
}
Program: 186623
Project: 186623
Buggy source:
public static LoadInstruction createLoadInstruction(Type type,int slot){
switch (type.getType()) {
case Constants.T_BOOLEAN:
case Constants.T_CHAR:
case Constants.T_SHORT:
case Constants.T_INT:
    return new ILOAD(slot);
case Constants.T_FLOAT:
  return new FLOAD(slot);
case Constants.T_LONG:
return new LLOAD(slot);
case Constants.T_DOUBLE:
return new DLOAD(slot);
case Constants.T_OBJECT:
case Constants.T_ARRAY:
return new ALOAD(slot);
default :
throw new AppInfoError("String_Node_Str" + type + "String_Node_Str"+ slot);
}
}

Fixed version (ground truth):
public static LoadInstruction createLoadInstruction(Type type,int slot){
switch (type.getType()) {
case Constants.T_BOOLEAN:
case Constants.T_BYTE:
case Constants.T_CHAR:
case Constants.T_SHORT:
case Constants.T_INT:
    return new ILOAD(slot);
case Constants.T_FLOAT:
  return new FLOAD(slot);
case Constants.T_LONG:
return new LLOAD(slot);
case Constants.T_DOUBLE:
return new DLOAD(slot);
case Constants.T_OBJECT:
case Constants.T_ARRAY:
return new ALOAD(slot);
default :
throw new AppInfoError("String_Node_Str" + type + "String_Node_Str"+ slot);
}
}
Program: 186624
Project: 186624
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 (useWCA()) {
    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());
  executor.performGreedyOptimizer();
  executor.cleanupMethodCode();
  executor.removeUnusedMembers();
  executor.relinkInvokesuper();
  executor.cleanupConstantPool();
}
Program: 186628
Project: 186628
Buggy source:
public SerializedFlowEdge(FlowEdge e){
  this.type=e.type;
  this.methodName=e.getContext().getMethodInfo().getFQMethodName();
  this.headIns=e.head.getPosition();
  this.tailIns=e.head.getPosition();
}

Fixed version (ground truth):
public SerializedFlowEdge(FlowEdge e){
  this.type=e.type;
  this.methodName=e.getContext().getMethodInfo().getFQMethodName();
  this.headIns=e.head.getPosition();
  this.tailIns=e.tail.getPosition();
}
Program: 186629
Project: 186629
Buggy source:
@Override public int getMaxMethodSize(){
  return 65535;
}

Fixed version (ground truth):
@Override public int getMaxMethodSize(){
  return 512;
}
Program: 186630
Project: 186630
Buggy source:
public InlineHelper(JCopter jcopter,InlineConfig inlineConfig){
  this.jcopter=jcopter;
  this.inlineConfig=inlineConfig;
  maxInlineSize=0;
  maxRecursiveInlining=0;
  maxCodesize=0;
  maxLocals=0;
  maxStacksize=0;
}

Fixed version (ground truth):
public InlineHelper(JCopter jcopter,InlineConfig inlineConfig){
  this.jcopter=jcopter;
  this.inlineConfig=inlineConfig;
  maxInlineSize=0;
  maxRecursiveInlining=0;
  ProcessorModel pm=AppInfo.getSingleton().getProcessorModel();
  maxCodesize=pm.getMaxMethodSize();
  maxLocals=pm.getMaxLocals();
  maxStacksize=pm.getMaxStackSize();
}
Program: 186631
Project: 186631
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);
  calcCacheMissCosts(analyses,deltaCodesize);
  return true;
}

Fixed version (ground truth):
@Override public boolean recalculate(AnalysisManager analyses,StacksizeAnalysis stacksize){
  deltaLocals=invokee.getCode().getMaxLocals();
  deltaCodesize=calcDeltaCodesize(analyses);
  if (!checkConstraints(stacksize)) {
    return false;
  }
  isLastLocalInvoke=checkIsLastLocalInvoke();
  isLastInvoke=isLastLocalInvoke && checkIsLastInvoker();
  localGain=calcLocalGain(analyses);
  calcCacheMissCosts(analyses,deltaCodesize);
  return true;
}
Program: 186633
Project: 186633
Buggy source:
/** 
 * Check the options, check if the assumptions on the code hold.
 * @throws BadConfigurationException if the WCA_TARGETS option is not set correctly
 */
public void initialize() throws BadConfigurationException {
  if (useWCA()) {
  }
 else   if (options.isSet(WCA_TARGETS)) {
    try {
      wcaTargets=Config.parseMethodList(options.getOption(WCA_TARGETS));
    }
 catch (    BadConfigurationException ignored) {
      logger.warn("String_Node_Str" + options.getOption(WCA_TARGETS) + "String_Node_Str");
    }
  }
 else {
    try {
      wcaTargets=Config.parseMethodList(options.getOption(WCA_TARGETS));
    }
 catch (    BadConfigurationException ignored) {
      logger.debug("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
/** 
 * Check the options, check if the assumptions on the code hold.
 * @throws BadConfigurationException if the WCA_TARGETS option is not set correctly
 */
public void initialize() throws BadConfigurationException {
  if (useWCA()) {
    wcaTargets=Config.parseMethodList(options.getOption(WCA_TARGETS));
  }
 else   if (options.isSet(WCA_TARGETS)) {
    try {
      wcaTargets=Config.parseMethodList(options.getOption(WCA_TARGETS));
    }
 catch (    BadConfigurationException ignored) {
      logger.warn("String_Node_Str" + options.getOption(WCA_TARGETS) + "String_Node_Str");
    }
  }
 else {
    try {
      wcaTargets=Config.parseMethodList(options.getOption(WCA_TARGETS));
    }
 catch (    BadConfigurationException ignored) {
      logger.debug("String_Node_Str");
    }
  }
}
Program: 186634
Project: 186634
Buggy source:
public void initialize() throws BadConfigurationException {
  if (wcaTargets.size() != 1) {
    throw new BadConfigurationException("String_Node_Str");
  }
  setWCETOptions(wcaTargets.iterator().next(),false);
  wcetTool.initialize(false);
  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());
}

Fixed version (ground truth):
public void initialize() throws BadConfigurationException {
  if (wcaTargets.isEmpty()) {
    throw new BadConfigurationException("String_Node_Str");
  }
  if (wcaTargets.size() != 1) {
    throw new BadConfigurationException("String_Node_Str");
  }
  setWCETOptions(wcaTargets.iterator().next(),false);
  wcetTool.initialize(false);
  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: 186637
Project: 186637
Buggy source:
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;
}

Fixed version (ground truth):
private AnalysisManager initializeAnalyses(){
  AnalysisManager analyses=new AnalysisManager(jcopter);
  analyses.initAnalyses(config.getTargetMethods(),config.getCacheAnalysisType(),config.useWCA() ? config.getWCATargets() : null);
  logger.info("String_Node_Str" + analyses.getTargetCallGraph().getNodes().size());
  return analyses;
}
Program: 186638
Project: 186638
Buggy source:
public Set<InvokeSite> getInvokeSites(MethodInfo invokee){
  MethodNode node=getMethodNode(invokee);
  Set<InvokeSite> invokeSites=new HashSet<InvokeSite>();
  for (  ExecutionContext ec : node.getInstances()) {
    if (ec.getCallString().isEmpty()) {
      AppInfo appInfo=AppInfo.getSingleton();
      for (      ContextEdge edge : callGraph.incomingEdgesOf(ec)) {
        for (        InvokeSite invokeSite : edge.getSource().getMethodInfo().getCode().getInvokeSites()) {
          Set<MethodInfo> impl=appInfo.findImplementations(invokeSite);
          if (impl.contains(invokee)) {
            invokeSites.add(invokeSite);
          }
        }
      }
    }
 else {
      invokeSites.add(ec.getCallString().top());
    }
  }
  return invokeSites;
}

Fixed version (ground truth):
public Set<InvokeSite> getInvokeSites(MethodInfo invokee){
  MethodNode node=getMethodNode(invokee);
  Set<InvokeSite> invokeSites=new HashSet<InvokeSite>();
  for (  ExecutionContext ec : node.getInstances()) {
    if (ec.getCallString().isEmpty()) {
      AppInfo appInfo=AppInfo.getSingleton();
      for (      ContextEdge edge : callGraph.incomingEdgesOf(ec)) {
        for (        InvokeSite invokeSite : edge.getSource().getMethodInfo().getCode().getInvokeSites()) {
          if (invokeSite.canInvoke(invokee) == Ternary.TRUE) {
            invokeSites.add(invokeSite);
          }
        }
      }
    }
 else {
      invokeSites.add(ec.getCallString().top());
    }
  }
  return invokeSites;
}
Program: 186639
Project: 186639
Buggy source:
private void traverse(EdgeProvider<V,E> provider,V parent,E edge,V node,int depth){
  Integer ts=discovery.get(node);
  DFSEdgeType type;
  if (parent == null) {
    type=DFSEdgeType.ROOT;
  }
 else   if (ts == null) {
    type=DFSEdgeType.TREE_EDGE;
  }
 else   if (ts < 0) {
    type=DFSEdgeType.BACK_EDGE;
  }
 else {
    int pts=-discovery.get(parent);
    type=pts <= ts ? DFSEdgeType.FORWARD_EDGE : DFSEdgeType.CROSS_EDGE;
  }
  Collection<E> outEdges=provider.outgoingEdgesOf(node);
  boolean descend=visitor.visitNode(parent,edge,node,type,outEdges,depth);
  if (ts == null) {
    return;
  }
  time++;
  int currTime=time;
  if (descend) {
    discovery.put(node,-currTime);
    for (    E out : outEdges) {
      traverse(provider,parent,out,provider.getEdgeTarget(out),depth + 1);
    }
  }
  visitor.finishNode(parent,edge,node,type,outEdges,depth);
  discovery.put(node,currTime);
  time++;
}

Fixed version (ground truth):
private void traverse(EdgeProvider<V,E> provider,V parent,E edge,V node,int depth){
  Integer ts=discovery.get(node);
  DFSEdgeType type;
  if (parent == null) {
    type=DFSEdgeType.ROOT;
  }
 else   if (ts == null) {
    type=DFSEdgeType.TREE_EDGE;
  }
 else   if (ts < 0) {
    type=DFSEdgeType.BACK_EDGE;
  }
 else {
    int pts=-discovery.get(parent);
    type=pts <= ts ? DFSEdgeType.FORWARD_EDGE : DFSEdgeType.CROSS_EDGE;
  }
  Collection<E> outEdges=provider.outgoingEdgesOf(node);
  boolean descend=visitor.visitNode(parent,edge,node,type,outEdges,depth);
  if (ts != null) {
    return;
  }
  time++;
  int currTime=time;
  if (descend) {
    discovery.put(node,-currTime);
    for (    E out : outEdges) {
      traverse(provider,node,out,provider.getEdgeTarget(out),depth + 1);
    }
  }
  visitor.finishNode(parent,edge,node,type,outEdges,depth);
  discovery.put(node,currTime);
  time++;
}
Program: 186640
Project: 186640
Buggy source:
private void updateExecCounts(DirectedGraph<ExecutionContext,ContextEdge> dag){
  TopologicalOrderIterator<ExecutionContext,ContextEdge> topOrder=new TopologicalOrderIterator<ExecutionContext,ContextEdge>(dag);
  while (topOrder.hasNext()) {
    ExecutionContext next=topOrder.next();
    updateChilds(next,callGraph.getChildren(next));
  }
}

Fixed version (ground truth):
private void updateExecCounts(DirectedGraph<ExecutionContext,ContextEdge> dag){
  TopologicalOrderIterator<ExecutionContext,ContextEdge> topOrder=new TopologicalOrderIterator<ExecutionContext,ContextEdge>(dag);
  while (topOrder.hasNext()) {
    ExecutionContext next=topOrder.next();
    if (logger.isTraceEnabled()) {
      logger.trace("String_Node_Str" + next);
    }
    updateChilds(next,callGraph.getChildren(next));
  }
}
Program: 186641
Project: 186641
Buggy source:
/** 
 * Update the execution counts after inlining. This must be called after the underlying callgraph has been updated!
 * @param invokeSite the inlined invokesite.
 * @param invokee the inlined method.
 * @param newInvokeSites the set of new invokesites in the invoker
 */
public void inline(InvokeSite invokeSite,MethodInfo invokee,Set<InvokeSite> newInvokeSites){
  List<ExecutionContext> queue=new ArrayList<ExecutionContext>();
  for (  ExecutionContext context : callGraph.getNodes(invokeSite.getInvoker())) {
    for (    ExecutionContext child : callGraph.getChildren(context)) {
      if (child.getCallString().isEmpty() && child.getMethodInfo().equals(invokee)) {
        nodeCount.put(child,nodeCount.get(child) - getExecCount(invokeSite));
      }
 else       if (!child.getCallString().isEmpty() && newInvokeSites.contains(child.getCallString().top())) {
        addExecCount(child,getExecCount(context,child.getCallString().top().getInstructionHandle()));
        queue.add(child);
      }
    }
  }
  DirectedGraph<ExecutionContext,ContextEdge> dag=GraphUtils.copyGraph(new InlineEdgeProvider(newInvokeSites),callGraph.getEdgeFactory(),queue,false);
  updateExecCounts(dag);
  changeSet.add(invokee);
}

Fixed version (ground truth):
/** 
 * Update the execution counts after inlining. This must be called after the underlying callgraph has been updated!
 * @param invokeSite the inlined invokesite.
 * @param invokee the inlined method.
 * @param newInvokeSites the set of new invokesites in the invoker
 */
public void inline(InvokeSite invokeSite,MethodInfo invokee,Set<InvokeSite> newInvokeSites){
  List<ExecutionContext> queue=new ArrayList<ExecutionContext>();
  for (  ExecutionContext context : callGraph.getNodes(invokeSite.getInvoker())) {
    for (    ExecutionContext child : callGraph.getChildren(context)) {
      if (child.getCallString().isEmpty() && child.getMethodInfo().equals(invokee)) {
        nodeCount.put(child,nodeCount.get(child) - getExecCount(invokeSite,invokee));
      }
 else       if (!child.getCallString().isEmpty() && newInvokeSites.contains(child.getCallString().top())) {
        addExecCount(child,getExecCount(context,child.getCallString().top().getInstructionHandle()));
        queue.add(child);
      }
    }
  }
  DirectedGraph<ExecutionContext,ContextEdge> dag=GraphUtils.copyGraph(new InlineEdgeProvider(newInvokeSites),callGraph.getEdgeFactory(),queue,false);
  updateExecCounts(dag);
  changeSet.add(invokee);
}
Program: 186644
Project: 186644
Buggy source:
public void buildCallGraph(boolean useDFA){
  if (useDFA) {
    DFACallgraphBuilder builder=new DFACallgraphBuilder(jcopter.getDfaTool(),appInfo.getCallstringLength());
    builder.setSkipNatives(true);
    appInfo.buildCallGraph(builder);
  }
 else {
    DefaultCallgraphBuilder builder=new DefaultCallgraphBuilder();
    builder.setSkipNatives(true);
    appInfo.buildCallGraph(builder);
    reduceCallGraph();
  }
}

Fixed version (ground truth):
public void buildCallGraph(boolean useDFA){
  if (useDFA) {
    DFACallgraphBuilder builder=new DFACallgraphBuilder(jcopter.getDfaTool(),appInfo.getCallstringLength());
    builder.setSkipNatives(true);
    appInfo.buildCallGraph(builder);
  }
 else {
    DefaultCallgraphBuilder builder=new DefaultCallgraphBuilder();
    builder.setSkipNatives(true);
    builder.setUseCallgraph(false);
    appInfo.buildCallGraph(builder);
    reduceCallGraph();
  }
}
Program: 186645
Project: 186645
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);
  runAnalysis(wcetTool.getCallGraph().getReversedGraph());
}

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(false);
  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: 186646
Project: 186646
Buggy source:
private boolean run(ExecHelper exec){
  File uppaalOutDir;
  try {
    project.setTopLevelLogger(tlLogger);
    tlLogger.info("String_Node_Str");
    project.initialize();
    uppaalOutDir=project.getOutDir("String_Node_Str");
  }
 catch (  Exception e) {
    exec.logException("String_Node_Str",e);
    return false;
  }
  UppaalAnalysis ua=new UppaalAnalysis(tlLogger,project,uppaalOutDir);
  List<MethodInfo> methods=project.getCallGraph().getReachableImplementations(project.getTargetMethod());
  Collections.reverse(methods);
  List<WCETEntry> entries=new ArrayList<WCETEntry>();
  for (  MethodInfo m : methods) {
    if (project.computeCyclomaticComplexity(m) > ECC_TRESHOLD) {
      tlLogger.info("String_Node_Str" + m + "String_Node_Str"+ project.computeCyclomaticComplexity(m)+ "String_Node_Str");
    }
 else {
      tlLogger.info("String_Node_Str" + m);
      WcetCost wcet;
      try {
        wcet=ua.calculateWCET(m);
        entries.add(new WCETEntry(m,wcet.getCost(),ua.getSearchtime(),ua.getSolvertimemax()));
      }
 catch (      Exception e) {
        exec.logException("String_Node_Str",e);
        return false;
      }
    }
  }
  for (  WCETEntry entry : entries) {
    System.out.println("String_Node_Str" + entry.target.toString());
    System.out.println("String_Node_Str" + entry.wcet);
    System.out.println("String_Node_Str" + project.computeCyclomaticComplexity(entry.target));
    System.out.println("String_Node_Str" + entry.searchtime);
    System.out.println("String_Node_Str" + entry.solvertime);
  }
  return true;
}

Fixed version (ground truth):
private boolean run(ExecHelper exec){
  File uppaalOutDir;
  try {
    project.setTopLevelLogger(tlLogger);
    tlLogger.info("String_Node_Str");
    project.initialize(true);
    uppaalOutDir=project.getOutDir("String_Node_Str");
  }
 catch (  Exception e) {
    exec.logException("String_Node_Str",e);
    return false;
  }
  UppaalAnalysis ua=new UppaalAnalysis(tlLogger,project,uppaalOutDir);
  List<MethodInfo> methods=project.getCallGraph().getReachableImplementations(project.getTargetMethod());
  Collections.reverse(methods);
  List<WCETEntry> entries=new ArrayList<WCETEntry>();
  for (  MethodInfo m : methods) {
    if (project.computeCyclomaticComplexity(m) > ECC_TRESHOLD) {
      tlLogger.info("String_Node_Str" + m + "String_Node_Str"+ project.computeCyclomaticComplexity(m)+ "String_Node_Str");
    }
 else {
      tlLogger.info("String_Node_Str" + m);
      WcetCost wcet;
      try {
        wcet=ua.calculateWCET(m);
        entries.add(new WCETEntry(m,wcet.getCost(),ua.getSearchtime(),ua.getSolvertimemax()));
      }
 catch (      Exception e) {
        exec.logException("String_Node_Str",e);
        return false;
      }
    }
  }
  for (  WCETEntry entry : entries) {
    System.out.println("String_Node_Str" + entry.target.toString());
    System.out.println("String_Node_Str" + entry.wcet);
    System.out.println("String_Node_Str" + project.computeCyclomaticComplexity(entry.target));
    System.out.println("String_Node_Str" + entry.searchtime);
    System.out.println("String_Node_Str" + entry.solvertime);
  }
  return true;
}
Program: 186647
Project: 186647
Buggy source:
private boolean run(){
  try {
    project.setTopLevelLogger(exec.getExecLogger());
    exec.info("String_Node_Str");
    project.initialize();
    MethodInfo largestMethod=project.getWCETProcessorModel().getMethodCache().checkCache();
    int minWords=MiscUtils.bytesToWords(largestMethod.getCode().getNumberOfBytes());
    reportMetric("String_Node_Str",largestMethod.getFQMethodName(),minWords);
  }
 catch (  Exception e) {
    exec.logException("String_Node_Str",e);
    return false;
  }
  if (project.getProjectConfig().doObjectCacheAnalysis()) {
    ObjectCacheAnalysis oca=new ObjectCacheAnalysis(project);
    return oca.run();
  }
 else {
    return runWCETAnalysis();
  }
}

Fixed version (ground truth):
private boolean run(){
  try {
    project.setTopLevelLogger(exec.getExecLogger());
    exec.info("String_Node_Str");
    project.initialize(true);
    MethodInfo largestMethod=project.getWCETProcessorModel().getMethodCache().checkCache();
    int minWords=MiscUtils.bytesToWords(largestMethod.getCode().getNumberOfBytes());
    reportMetric("String_Node_Str",largestMethod.getFQMethodName(),minWords);
  }
 catch (  Exception e) {
    exec.logException("String_Node_Str",e);
    return false;
  }
  if (project.getProjectConfig().doObjectCacheAnalysis()) {
    ObjectCacheAnalysis oca=new ObjectCacheAnalysis(project);
    return oca.run();
  }
 else {
    return runWCETAnalysis();
  }
}
Program: 186648
Project: 186648
Buggy source:
private void reportSpecial(String metric,WcetCost cost,long start,long stop,double solverTime){
  String key="String_Node_Str" + metric;
  System.out.println(key + "String_Node_Str" + cost);
  if (start != stop)   System.out.println(key + "String_Node_Str" + timeDiff(start,stop));
  if (solverTime != 0)   System.out.println(key + "String_Node_Str" + solverTime);
  project.recordSpecialResult(metric,cost);
  project.getReport().addStat(key,cost.toString());
}

Fixed version (ground truth):
private void reportSpecial(String metric,WcetCost cost,long start,long stop,double solverTime){
  String key="String_Node_Str" + metric;
  System.out.println(key + "String_Node_Str" + cost);
  if (start != stop)   System.out.println(key + "String_Node_Str" + timeDiff(start,stop));
  if (solverTime != 0)   System.out.println(key + "String_Node_Str" + solverTime);
  project.recordSpecialResult(metric,cost);
  if (project.reportGenerationActive()) {
    project.getReport().addStat(key,cost.toString());
  }
}
Program: 186649
Project: 186649
Buggy source:
public void initialize() throws BadConfigurationException {
  if (projectConfig.saveResults()) {
    this.resultRecord=projectConfig.getResultFile();
    if (!projectConfig.appendResults()) {
      recordMetric("String_Node_Str",this.getProjectName());
      if (projectConfig.addPerformanceResults()) {
        recordMetric("String_Node_Str",new Date());
      }
    }
  }
  linkerInfo=new LinkerInfo(this);
  try {
    linkerInfo.loadLinkInfo();
  }
 catch (  IOException e) {
    throw new BadConfigurationException("String_Node_Str",e);
  }
catch (  ClassNotFoundException e) {
    throw new BadConfigurationException("String_Node_Str",e);
  }
  if (doDataflowAnalysis()) {
    topLevelLogger.info("String_Node_Str");
    dataflowAnalysis();
    topLevelLogger.info("String_Node_Str");
  }
  if (!appInfo.hasCallGraph()) {
    DefaultCallgraphBuilder callGraphBuilder;
    if (doDataflowAnalysis()) {
      callGraphBuilder=new DFACallgraphBuilder(getDfaTool(),appInfo.getCallstringLength());
    }
 else {
      callGraphBuilder=new DefaultCallgraphBuilder();
    }
    callGraphBuilder.setSkipNatives(true);
    appInfo.buildCallGraph(callGraphBuilder);
  }
  rebuildCallGraph();
  if (projectConfig.doPreprocess()) {
    WCETPreprocess.preprocess(appInfo);
  }
  dumpCallGraph("String_Node_Str");
}

Fixed version (ground truth):
public void initialize(boolean loadLinkInfo) throws BadConfigurationException {
  if (projectConfig.saveResults()) {
    this.resultRecord=projectConfig.getResultFile();
    if (!projectConfig.appendResults()) {
      recordMetric("String_Node_Str",this.getProjectName());
      if (projectConfig.addPerformanceResults()) {
        recordMetric("String_Node_Str",new Date());
      }
    }
  }
  if (loadLinkInfo) {
    linkerInfo=new LinkerInfo(this);
    try {
      linkerInfo.loadLinkInfo();
    }
 catch (    IOException e) {
      throw new BadConfigurationException("String_Node_Str",e);
    }
catch (    ClassNotFoundException e) {
      throw new BadConfigurationException("String_Node_Str",e);
    }
  }
  if (doDataflowAnalysis()) {
    topLevelLogger.info("String_Node_Str");
    dataflowAnalysis();
    topLevelLogger.info("String_Node_Str");
  }
  if (!appInfo.hasCallGraph()) {
    DefaultCallgraphBuilder callGraphBuilder;
    if (doDataflowAnalysis()) {
      callGraphBuilder=new DFACallgraphBuilder(getDfaTool(),appInfo.getCallstringLength());
    }
 else {
      callGraphBuilder=new DefaultCallgraphBuilder();
    }
    callGraphBuilder.setSkipNatives(true);
    appInfo.buildCallGraph(callGraphBuilder);
  }
  rebuildCallGraph();
  if (projectConfig.doPreprocess()) {
    WCETPreprocess.preprocess(appInfo);
  }
  dumpCallGraph("String_Node_Str");
}
Program: 186651
Project: 186651
Buggy source:
public LineNumberGen getLineNumberEntry(InstructionHandle ih,boolean checkPrevious){
  InstructionHandle prev=ih;
  while (prev != null) {
    InstructionTargeter[] targeter=ih.getTargeters();
    if (targeter != null) {
      for (      InstructionTargeter t : targeter) {
        if (t instanceof LineNumberGen) {
          return (LineNumberGen)t;
        }
      }
    }
    if (checkPrevious && prev.getAttribute(KEY_LINENUMBER) == null) {
      prev=prev.getPrev();
    }
 else {
      break;
    }
  }
  return null;
}

Fixed version (ground truth):
public LineNumberGen getLineNumberEntry(InstructionHandle ih,boolean checkPrevious){
  InstructionHandle prev=ih;
  while (prev != null) {
    InstructionTargeter[] targeter=prev.getTargeters();
    if (targeter != null) {
      for (      InstructionTargeter t : targeter) {
        if (t instanceof LineNumberGen) {
          return (LineNumberGen)t;
        }
      }
    }
    if (checkPrevious && prev.getAttribute(KEY_LINENUMBER) == null) {
      prev=prev.getPrev();
    }
 else {
      break;
    }
  }
  return null;
}
Program: 186652
Project: 186652
Buggy source:
@Override public String toString(){
  return "String_Node_Str" + target.getPosition() + "String_Node_Str"+ edgeKind+ "String_Node_Str";
}

Fixed version (ground truth):
@Override public String toString(){
  return "String_Node_Str" + instructions;
}
Program: 186653
Project: 186653
Buggy source:
@Override protected void register(){
  if (instantiatedFrom == null) {
    super.register();
  }
}

Fixed version (ground truth):
@Override protected void register(){
  if (instantiatedFrom == null) {
    super.register();
  }
 else {
    instantiatedFrom.register();
  }
}
Program: 186654
Project: 186654
Buggy source:
public void initAnalysis(boolean useMethodCacheStrategy){
  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());
}

Fixed version (ground truth):
public void initAnalysis(boolean useMethodCacheStrategy){
  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());
  updateWCEP();
}
Program: 186655
Project: 186655
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.
 * @return a set of all methods for which the path may have changed.
 */
public Set<MethodInfo> updateWCA(Collection<MethodInfo> changedMethods){
  CallGraph callGraph=wcetTool.getCallGraph();
  final Set<ExecutionContext> rootNodes=new HashSet<ExecutionContext>();
  for (  MethodInfo root : changedMethods) {
    rootNodes.addAll(callGraph.getNodes(root));
  }
  final int callstringLength=AppInfo.getSingleton().getCallstringLength();
  DFSVisitor<ExecutionContext,ContextEdge> visitor=new EmptyDFSVisitor<ExecutionContext,ContextEdge>(){
    @Override public boolean visitNode(    ExecutionContext parent,    ContextEdge edge,    ExecutionContext node,    DFSEdgeType type,    Collection<ContextEdge> outEdges,    int depth){
      if (type.isFirstVisit() && !wcaNodeFlow.containsKey(node)) {
        rootNodes.add(node);
      }
      return depth <= callstringLength;
    }
  }
;
  DFSTraverser<ExecutionContext,ContextEdge> traverser=new DFSTraverser<ExecutionContext,ContextEdge>(visitor);
  traverser.traverse(callGraph.getGraph(),rootNodes);
  for (  MethodInfo method : analyses.getMethodCacheAnalysis().getClassificationChangeSet()) {
    rootNodes.addAll(callGraph.getNodes(method));
  }
  return runAnalysis(wcetTool.getCallGraph().createInvokeGraph(rootNodes,true));
}

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.
 * @return a set of all methods for which the path may have changed.
 */
public Set<MethodInfo> updateWCA(Collection<MethodInfo> changedMethods){
  CallGraph callGraph=wcetTool.getCallGraph();
  final Set<ExecutionContext> rootNodes=new HashSet<ExecutionContext>();
  for (  MethodInfo root : changedMethods) {
    rootNodes.addAll(callGraph.getNodes(root));
  }
  final int callstringLength=AppInfo.getSingleton().getCallstringLength();
  DFSVisitor<ExecutionContext,ContextEdge> visitor=new EmptyDFSVisitor<ExecutionContext,ContextEdge>(){
    @Override public boolean visitNode(    ExecutionContext parent,    ContextEdge edge,    ExecutionContext node,    DFSEdgeType type,    Collection<ContextEdge> outEdges,    int depth){
      if (type.isFirstVisit() && !wcaNodeFlow.containsKey(node)) {
        rootNodes.add(node);
      }
      return depth <= callstringLength;
    }
  }
;
  DFSTraverser<ExecutionContext,ContextEdge> traverser=new DFSTraverser<ExecutionContext,ContextEdge>(visitor);
  traverser.traverse(callGraph.getGraph(),rootNodes);
  for (  MethodInfo method : analyses.getMethodCacheAnalysis().getClassificationChangeSet()) {
    rootNodes.addAll(callGraph.getNodes(method));
  }
  Set<MethodInfo> changed=runAnalysis(wcetTool.getCallGraph().createInvokeGraph(rootNodes,true));
  updateWCEP();
  return changed;
}