Program: 74846
Project: 74846
Buggy source:
public void inlineTokenAndTypeMethods(SootClass entityClass,int depth,Set unsafeLocalSet,boolean debug){
  boolean doneSomething=true;
  int count=0;
  while (doneSomething && (count < 20)) {
    doneSomething=false;
    count++;
    if (debug) {
      System.err.println("String_Node_Str" + entityClass + "String_Node_Str"+ count+ "String_Node_Str"+ depth);
      System.out.println("String_Node_Str" + entityClass + "String_Node_Str"+ count+ "String_Node_Str"+ depth);
    }
    for (Iterator methods=entityClass.getMethods().iterator(); methods.hasNext(); ) {
      SootMethod method=(SootMethod)methods.next();
      JimpleBody body=(JimpleBody)method.retrieveActiveBody();
      LocalSplitter.v().transform(body,_phaseName + "String_Node_Str");
      LocalNameStandardizer.v().transform(body,_phaseName + "String_Node_Str");
      TypeAssigner.v().transform(body,_phaseName + "String_Node_Str");
      UnreachableCodeEliminator.v().transform(body,_phaseName + "String_Node_Str");
      CopyPropagator.v().transform(body,_phaseName + "String_Node_Str");
      ConstantPropagatorAndFolder.v().transform(body,_phaseName + "String_Node_Str");
      ConditionalBranchFolder.v().transform(body,_phaseName + "String_Node_Str");
      DeadAssignmentEliminator.v().transform(body,_phaseName + "String_Node_Str");
      UnreachableCodeEliminator.v().transform(body,_phaseName + "String_Node_Str");
      UnusedLocalEliminator.v().transform(body,_phaseName + "String_Node_Str");
      if (debug) {
        System.out.println("String_Node_Str" + method);
      }
      TokenInstanceofEliminator.eliminateCastsAndInstanceOf(body,_phaseName + "String_Node_Str",unsafeLocalSet,debug);
      UnreachableCodeEliminator.v().transform(body,_phaseName + "String_Node_Str");
      CopyPropagator.v().transform(body,_phaseName + "String_Node_Str");
      ConstantPropagatorAndFolder.v().transform(body,_phaseName + "String_Node_Str");
      ConditionalBranchFolder.v().transform(body,_phaseName + "String_Node_Str");
      DeadAssignmentEliminator.v().transform(body,_phaseName + "String_Node_Str");
      UnusedLocalEliminator.v().transform(body,_phaseName + "String_Node_Str");
      UnreachableCodeEliminator.v().transform(body,_phaseName + "String_Node_Str");
      CopyPropagator.v().transform(body,_phaseName + "String_Node_Str");
      ConstantPropagatorAndFolder.v().transform(body,_phaseName + "String_Node_Str");
      ConditionalBranchFolder.v().transform(body,_phaseName + "String_Node_Str");
      DeadAssignmentEliminator.v().transform(body,_phaseName + "String_Node_Str");
      UnusedLocalEliminator.v().transform(body,_phaseName + "String_Node_Str");
      LocalSplitter.v().transform(body,_phaseName + "String_Node_Str");
      TypeAssigner.v().transform(body,_phaseName + "String_Node_Str");
      TokenInstanceofEliminator.eliminateCastsAndInstanceOf(body,_phaseName + "String_Node_Str",Collections.EMPTY_SET,debug);
    }
    TypeSpecializerAnalysis typeAnalysis=new TypeSpecializerAnalysis(entityClass,unsafeLocalSet);
    for (Iterator methods=entityClass.getMethods().iterator(); methods.hasNext(); ) {
      SootMethod method=(SootMethod)methods.next();
      if (_methodWillBeInlined(method)) {
        continue;
      }
      JimpleBody body=(JimpleBody)method.retrieveActiveBody();
      CompleteUnitGraph unitGraph=new CompleteUnitGraph(body);
      SimpleLocalDefs localDefs=new SimpleLocalDefs(unitGraph);
      SimpleLocalUses localUses=new SimpleLocalUses(unitGraph,localDefs);
      if (debug) {
        System.out.println("String_Node_Str" + method);
      }
      for (Iterator units=body.getUnits().snapshotIterator(); units.hasNext(); ) {
        Stmt stmt=(Stmt)units.next();
        if (debug) {
          System.out.println("String_Node_Str" + stmt);
        }
        if (stmt.containsInvokeExpr()) {
          ValueBox box=stmt.getInvokeExprBox();
          Value value=box.getValue();
          if (debug) {
            System.out.println("String_Node_Str" + value);
          }
          boolean flag=_inlineTokenMethodsIn(method,body,stmt,box,localDefs,localUses,typeAnalysis,depth,unsafeLocalSet,debug);
          doneSomething|=flag;
          if (!flag) {
            doneSomething|=_inlineTypeMethodsIn(method,body,stmt,box,localDefs,localUses,depth,unsafeLocalSet,debug);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public void inlineTokenAndTypeMethods(SootClass entityClass,int depth,Set unsafeLocalSet,boolean debug){
  boolean doneSomething=true;
  int count=0;
  while (doneSomething && (count < 20)) {
    doneSomething=false;
    count++;
    if (debug) {
      System.err.println("String_Node_Str" + entityClass + "String_Node_Str"+ count+ "String_Node_Str"+ depth);
      System.out.println("String_Node_Str" + entityClass + "String_Node_Str"+ count+ "String_Node_Str"+ depth);
    }
    for (Iterator methods=entityClass.getMethods().iterator(); methods.hasNext(); ) {
      SootMethod method=(SootMethod)methods.next();
      JimpleBody body=(JimpleBody)method.retrieveActiveBody();
      LocalSplitter.v().transform(body,_phaseName + "String_Node_Str");
      LocalNameStandardizer.v().transform(body,_phaseName + "String_Node_Str");
      TypeAssigner.v().transform(body,_phaseName + "String_Node_Str");
      UnreachableCodeEliminator.v().transform(body,_phaseName + "String_Node_Str");
      CopyPropagator.v().transform(body,_phaseName + "String_Node_Str");
      ConstantPropagatorAndFolder.v().transform(body,_phaseName + "String_Node_Str");
      ConditionalBranchFolder.v().transform(body,_phaseName + "String_Node_Str");
      DeadAssignmentEliminator.v().transform(body,_phaseName + "String_Node_Str");
      UnreachableCodeEliminator.v().transform(body,_phaseName + "String_Node_Str");
      UnusedLocalEliminator.v().transform(body,_phaseName + "String_Node_Str");
      if (debug) {
        System.out.println("String_Node_Str" + method);
      }
      TokenInstanceofEliminator.eliminateCastsAndInstanceOf(body,_phaseName + "String_Node_Str",unsafeLocalSet,debug);
      UnreachableCodeEliminator.v().transform(body,_phaseName + "String_Node_Str");
      CopyPropagator.v().transform(body,_phaseName + "String_Node_Str");
      ConstantPropagatorAndFolder.v().transform(body,_phaseName + "String_Node_Str");
      ConditionalBranchFolder.v().transform(body,_phaseName + "String_Node_Str");
      DeadAssignmentEliminator.v().transform(body,_phaseName + "String_Node_Str");
      UnusedLocalEliminator.v().transform(body,_phaseName + "String_Node_Str");
      UnreachableCodeEliminator.v().transform(body,_phaseName + "String_Node_Str");
      CopyPropagator.v().transform(body,_phaseName + "String_Node_Str");
      ConstantPropagatorAndFolder.v().transform(body,_phaseName + "String_Node_Str");
      ConditionalBranchFolder.v().transform(body,_phaseName + "String_Node_Str");
      DeadAssignmentEliminator.v().transform(body,_phaseName + "String_Node_Str");
      UnusedLocalEliminator.v().transform(body,_phaseName + "String_Node_Str");
      LocalSplitter.v().transform(body,_phaseName + "String_Node_Str");
      TypeAssigner.v().transform(body,_phaseName + "String_Node_Str");
      TokenInstanceofEliminator.eliminateCastsAndInstanceOf(body,_phaseName + "String_Node_Str",Collections.EMPTY_SET,debug);
    }
    TypeSpecializerAnalysis typeAnalysis=new TypeSpecializerAnalysis(entityClass,unsafeLocalSet);
    for (Iterator methods=entityClass.getMethods().iterator(); methods.hasNext(); ) {
      SootMethod method=(SootMethod)methods.next();
      if (_methodWillBeInlined(method)) {
        continue;
      }
      JimpleBody body=(JimpleBody)method.retrieveActiveBody();
      CompleteUnitGraph unitGraph=new CompleteUnitGraph(body);
      SimpleLocalDefs localDefs=new SimpleLocalDefs(unitGraph);
      SimpleLocalUses localUses=new SimpleLocalUses(unitGraph,localDefs);
      if (debug) {
        System.out.println("String_Node_Str" + method);
      }
      for (Iterator units=body.getUnits().snapshotIterator(); units.hasNext(); ) {
        Stmt stmt=(Stmt)units.next();
        if (debug) {
          System.out.println("String_Node_Str" + stmt);
        }
        if (stmt.containsInvokeExpr()) {
          ValueBox box=stmt.getInvokeExprBox();
          Value value=box.getValue();
          if (debug) {
            System.out.println("String_Node_Str" + value);
          }
          Scene.v().setActiveHierarchy(new Hierarchy());
          Scene.v().setFastHierarchy(new FastHierarchy());
          boolean flag=_inlineTokenMethodsIn(method,body,stmt,box,localDefs,localUses,typeAnalysis,depth,unsafeLocalSet,debug);
          doneSomething|=flag;
          if (!flag) {
            doneSomething|=_inlineTypeMethodsIn(method,body,stmt,box,localDefs,localUses,depth,unsafeLocalSet,debug);
          }
        }
      }
    }
  }
}