nus-yam/ex-repair huggingface dataset:
Program: 85183
Project: 85183
Buggy source:
private SootField checkStatic(SootField ret){
  if (Options.v().wrong_staticness() == Options.wrong_staticness_fail || Options.v().wrong_staticness() == Options.wrong_staticness_fixstrict) {
    if (ret.isStatic() != isStatic() && !ret.isPhantom()) {
      throw new ResolutionFailedException("String_Node_Str" + this + "String_Node_Str"+ ret+ "String_Node_Str");
    }
  }
  return ret;
}

Fixed version (ground truth):
private SootField checkStatic(SootField ret){
  if ((Options.v().wrong_staticness() == Options.wrong_staticness_fail || Options.v().wrong_staticness() == Options.wrong_staticness_fixstrict) && ret.isStatic() != isStatic() && !ret.isPhantom()) {
    throw new ResolutionFailedException("String_Node_Str" + this + "String_Node_Str"+ ret+ "String_Node_Str");
  }
  return ret;
}
Program: 85184
Project: 85184
Buggy source:
private SootMethod checkStatic(SootMethod ret){
  if (ret.isStatic() != isStatic()) {
    if (Options.v().wrong_staticness() != Options.wrong_staticness_ignore && Options.v().wrong_staticness() != Options.wrong_staticness_fixstrict) {
      throw new ResolutionFailedException("String_Node_Str" + this + "String_Node_Str"+ ret+ "String_Node_Str");
    }
  }
  return ret;
}

Fixed version (ground truth):
private SootMethod checkStatic(SootMethod ret){
  if ((Options.v().wrong_staticness() == Options.wrong_staticness_fail || Options.v().wrong_staticness() == Options.wrong_staticness_fixstrict) && ret.isStatic() != isStatic() && !ret.isPhantom()) {
    throw new ResolutionFailedException("String_Node_Str" + this + "String_Node_Str"+ ret+ "String_Node_Str");
  }
  return ret;
}
Program: 85188
Project: 85188
Buggy source:
public int wrong_staticness(){
  if (wrong_staticness == 0)   return wrong_staticness_fix;
  if (wrong_staticness == 0)   return wrong_staticness_fixstrict;
  return wrong_staticness;
}

Fixed version (ground truth):
public int wrong_staticness(){
  if (wrong_staticness == 0)   return wrong_staticness_fixstrict;
  return wrong_staticness;
}
Program: 85189
Project: 85189
Buggy source:
private void postProcessDAVA(){
  Chain<SootClass> appClasses=Scene.v().getApplicationClasses();
  Map<String,String> options=PhaseOptions.v().getPhaseOptions("String_Node_Str");
  boolean transformations=PhaseOptions.getBoolean(options,"String_Node_Str");
  for (  SootClass s : appClasses) {
    String fileName=SourceLocator.v().getFileNameFor(s,Options.v().output_format());
    DavaStaticBlockCleaner.v().staticBlockInlining(s);
    VoidReturnRemover.cleanClass(s);
    RemoveEmptyBodyDefaultConstructor.checkAndRemoveDefault(s);
    logger.debug("String_Node_Str" + fileName + "String_Node_Str");
    for (    SootMethod m : s.getMethods()) {
      if (m.hasActiveBody()) {
        DavaBody body=(DavaBody)m.getActiveBody();
        if (transformations) {
          body.analyzeAST();
        }
 else {
          body.applyBugFixes();
        }
      }
 else {
        continue;
      }
    }
  }
  if (transformations) {
    InterProceduralAnalyses.applyInterProceduralAnalyses();
  }
  outputDava();
}

Fixed version (ground truth):
private void postProcessDAVA(){
  Chain<SootClass> appClasses=Scene.v().getApplicationClasses();
  Map<String,String> options=PhaseOptions.v().getPhaseOptions("String_Node_Str");
  boolean transformations=PhaseOptions.getBoolean(options,"String_Node_Str");
  for (  SootClass s : appClasses) {
    String fileName=SourceLocator.v().getFileNameFor(s,Options.v().output_format());
    DavaStaticBlockCleaner.v().staticBlockInlining(s);
    VoidReturnRemover.cleanClass(s);
    RemoveEmptyBodyDefaultConstructor.checkAndRemoveDefault(s);
    logger.debug("String_Node_Str" + fileName + "String_Node_Str");
    for (    SootMethod m : s.getMethods()) {
      if (m.hasActiveBody()) {
        DavaBody body=(DavaBody)m.getActiveBody();
        if (transformations) {
          body.analyzeAST();
        }
 else {
          body.applyBugFixes();
        }
      }
 else {
        continue;
      }
    }
  }
  if (transformations) {
    InterProceduralAnalyses.applyInterProceduralAnalyses();
  }
}
Program: 85191
Project: 85191
Buggy source:
private void postProcessDAVA(){
  Chain<SootClass> appClasses=Scene.v().getApplicationClasses();
  Map<String,String> options=PhaseOptions.v().getPhaseOptions("String_Node_Str");
  boolean transformations=PhaseOptions.getBoolean(options,"String_Node_Str");
  for (  SootClass s : appClasses) {
    String fileName=SourceLocator.v().getFileNameFor(s,Options.v().output_format());
    DavaStaticBlockCleaner.v().staticBlockInlining(s);
    VoidReturnRemover.cleanClass(s);
    RemoveEmptyBodyDefaultConstructor.checkAndRemoveDefault(s);
    logger.debug("String_Node_Str" + fileName + "String_Node_Str");
    for (    SootMethod m : s.getMethods()) {
      if (m.hasActiveBody()) {
        DavaBody body=(DavaBody)m.getActiveBody();
        if (transformations) {
          body.analyzeAST();
        }
 else {
          body.applyBugFixes();
        }
      }
 else {
        continue;
      }
    }
  }
  if (transformations) {
    InterProceduralAnalyses.applyInterProceduralAnalyses();
  }
  outputDava();
}

Fixed version (ground truth):
private void postProcessDAVA(){
  Chain<SootClass> appClasses=Scene.v().getApplicationClasses();
  Map<String,String> options=PhaseOptions.v().getPhaseOptions("String_Node_Str");
  boolean transformations=PhaseOptions.getBoolean(options,"String_Node_Str");
  for (  SootClass s : appClasses) {
    String fileName=SourceLocator.v().getFileNameFor(s,Options.v().output_format());
    DavaStaticBlockCleaner.v().staticBlockInlining(s);
    VoidReturnRemover.cleanClass(s);
    RemoveEmptyBodyDefaultConstructor.checkAndRemoveDefault(s);
    logger.debug("String_Node_Str" + fileName + "String_Node_Str");
    for (    SootMethod m : s.getMethods()) {
      if (m.hasActiveBody()) {
        DavaBody body=(DavaBody)m.getActiveBody();
        if (transformations) {
          body.analyzeAST();
        }
 else {
          body.applyBugFixes();
        }
      }
 else {
        continue;
      }
    }
  }
  if (transformations) {
    InterProceduralAnalyses.applyInterProceduralAnalyses();
  }
}
Program: 85194
Project: 85194
Buggy source:
private static Deque<RefType> superclassPath(RefType t,RefType anchor){
  Deque<RefType> r=new LinkedList<RefType>();
  r.addFirst(t);
  if (t.getSootClass().isPhantom() && anchor != null) {
    r.addFirst(anchor);
    return r;
  }
  SootClass sc=t.getSootClass();
  while (sc.hasSuperclass()) {
    sc=sc.getSuperclass();
    r.addFirst(sc.getType());
    if (sc.isPhantom() && anchor != null) {
      r.addFirst(anchor);
      break;
    }
  }
  return r;
}

Fixed version (ground truth):
private static Deque<RefType> superclassPath(RefType t,RefType anchor){
  Deque<RefType> r=new ArrayDeque<RefType>();
  r.addFirst(t);
  if (TypeResolver.typesEqual(t,anchor)) {
    return r;
  }
  SootClass sc=t.getSootClass();
  while (sc.hasSuperclass()) {
    sc=sc.getSuperclass();
    RefType cur=sc.getType();
    r.addFirst(cur);
    if (TypeResolver.typesEqual(cur,anchor)) {
      break;
    }
  }
  if (!TypeResolver.typesEqual(r.getFirst(),anchor)) {
    r.addFirst(anchor);
  }
  return r;
}
Program: 85197
Project: 85197
Buggy source:
/** 
 * Using Tarjan's algorithm to contract the SCCs.
 */
private void callGraphDFS(int s){
  int t;
  CgEdge p;
  vis_cg[s]=low_cg[s]=pre_cnt++;
  queue_cg.addLast(s);
  p=call_graph[s];
  while (p != null) {
    t=p.t;
    if (vis_cg[t] == 0) {
      callGraphDFS(t);
    }
    if (low_cg[t] < low_cg[s]) {
      low_cg[s]=low_cg[t];
    }
    p=p.next;
  }
  if (low_cg[s] < vis_cg[s]) {
    scc_size[s]=1;
    return;
  }
  scc_size[s]=queue_cg.size();
  do {
    t=queue_cg.getLast();
    queue_cg.removeLast();
    rep_cg[t]=s;
    low_cg[t]+=n_func;
  }
 while (s != t);
  scc_size[s]-=queue_cg.size();
  if (scc_size[s] > max_scc_size) {
    max_scc_size=scc_size[s];
    max_scc_id=s;
  }
}

Fixed version (ground truth):
/** 
 * Using Tarjan's algorithm to contract the SCCs.
 */
private void callGraphDFS(int s){
  int t;
  CgEdge p;
  vis_cg[s]=low_cg[s]=pre_cnt++;
  queue_cg.addLast(s);
  p=call_graph[s];
  while (p != null) {
    t=p.t;
    if (vis_cg[t] == 0) {
      callGraphDFS(t);
      low_cg[s]=Math.min(low_cg[s],low_cg[t]);
    }
 else {
      low_cg[s]=Math.min(low_cg[s],vis_cg[t]);
    }
    p=p.next;
  }
  if (low_cg[s] < vis_cg[s]) {
    scc_size[s]=1;
    return;
  }
  scc_size[s]=queue_cg.size();
  do {
    t=queue_cg.getLast();
    queue_cg.removeLast();
    rep_cg[t]=s;
    low_cg[t]+=n_func;
  }
 while (s != t);
  scc_size[s]-=queue_cg.size();
  if (scc_size[s] > max_scc_size) {
    max_scc_size=scc_size[s];
    max_scc_id=s;
  }
}
Program: 85198
Project: 85198
Buggy source:
protected void bringToHierarchyUnchecked(SootClass sc){
  String className=sc.getName();
  ClassSource is=SourceLocator.v().getClassSource(className);
  try {
    boolean modelAsPhantomRef=is == null;
    if (modelAsPhantomRef) {
      if (!Scene.v().allowsPhantomRefs()) {
        String suffix="String_Node_Str";
        if (className.equals("String_Node_Str")) {
          suffix="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
        }
 else         if (className.equals("String_Node_Str")) {
          suffix="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
        }
        throw new SootClassNotFoundException("String_Node_Str" + className + "String_Node_Str"+ suffix);
      }
 else {
        sc.setPhantomClass();
      }
    }
 else {
      Dependencies dependencies=is.resolve(sc);
      if (!dependencies.typesToSignature.isEmpty())       classToTypesSignature.putAll(sc,dependencies.typesToSignature);
      if (!dependencies.typesToHierarchy.isEmpty())       classToTypesHierarchy.putAll(sc,dependencies.typesToHierarchy);
    }
  }
  finally {
    if (is != null)     is.close();
  }
  reResolveHierarchy(sc);
}

Fixed version (ground truth):
protected void bringToHierarchyUnchecked(SootClass sc){
  String className=sc.getName();
  ClassSource is=SourceLocator.v().getClassSource(className);
  try {
    boolean modelAsPhantomRef=is == null;
    if (modelAsPhantomRef) {
      if (!Scene.v().allowsPhantomRefs()) {
        String suffix="String_Node_Str";
        if (className.equals("String_Node_Str")) {
          suffix="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
        }
 else         if (className.equals("String_Node_Str")) {
          suffix="String_Node_Str" + "String_Node_Str" + "String_Node_Str";
        }
        throw new SootClassNotFoundException("String_Node_Str" + className + "String_Node_Str"+ suffix);
      }
 else {
        sc.setPhantomClass();
      }
    }
 else {
      Dependencies dependencies=is.resolve(sc);
      if (!dependencies.typesToSignature.isEmpty())       classToTypesSignature.putAll(sc,dependencies.typesToSignature);
      if (!dependencies.typesToHierarchy.isEmpty())       classToTypesHierarchy.putAll(sc,dependencies.typesToHierarchy);
    }
  }
  finally {
    if (is != null)     is.close();
  }
  reResolveHierarchy(sc,SootClass.HIERARCHY);
}
Program: 85199
Project: 85199
Buggy source:
public void reResolveHierarchy(SootClass sc){
  SootClass superClass=sc.getSuperclassUnsafe();
  if (superClass != null)   addToResolveWorklist(superClass,SootClass.HIERARCHY);
  SootClass outerClass=sc.getOuterClassUnsafe();
  if (outerClass != null)   addToResolveWorklist(outerClass,SootClass.HIERARCHY);
  for (  SootClass iface : sc.getInterfaces()) {
    addToResolveWorklist(iface,SootClass.HIERARCHY);
  }
}

Fixed version (ground truth):
public void reResolveHierarchy(SootClass sc,int level){
  SootClass superClass=sc.getSuperclassUnsafe();
  if (superClass != null)   addToResolveWorklist(superClass,level);
  SootClass outerClass=sc.getOuterClassUnsafe();
  if (outerClass != null)   addToResolveWorklist(outerClass,level);
  for (  SootClass iface : sc.getInterfaces()) {
    addToResolveWorklist(iface,level);
  }
}
Program: 85200
Project: 85200
Buggy source:
protected void bringToSignaturesUnchecked(SootClass sc){
  for (  SootField f : sc.getFields()) {
    addToResolveWorklist(f.getType(),SootClass.HIERARCHY);
  }
  for (  SootMethod m : sc.getMethods()) {
    addToResolveWorklist(m.getReturnType(),SootClass.HIERARCHY);
    for (    Type ptype : m.getParameterTypes()) {
      addToResolveWorklist(ptype,SootClass.HIERARCHY);
    }
    List<SootClass> exceptions=m.getExceptionsUnsafe();
    if (exceptions != null) {
      for (      SootClass exception : exceptions) {
        addToResolveWorklist(exception,SootClass.HIERARCHY);
      }
    }
  }
  reResolveHierarchy(sc);
}

Fixed version (ground truth):
protected void bringToSignaturesUnchecked(SootClass sc){
  for (  SootField f : sc.getFields()) {
    addToResolveWorklist(f.getType(),SootClass.HIERARCHY);
  }
  for (  SootMethod m : sc.getMethods()) {
    addToResolveWorklist(m.getReturnType(),SootClass.HIERARCHY);
    for (    Type ptype : m.getParameterTypes()) {
      addToResolveWorklist(ptype,SootClass.HIERARCHY);
    }
    List<SootClass> exceptions=m.getExceptionsUnsafe();
    if (exceptions != null) {
      for (      SootClass exception : exceptions) {
        addToResolveWorklist(exception,SootClass.HIERARCHY);
      }
    }
  }
  reResolveHierarchy(sc,SootClass.SIGNATURES);
}
Program: 85201
Project: 85201
Buggy source:
/** 
 * Creates a method body that throws an "unresolved compilation error" message
 * @param declaringClass The class that was supposed to contain the method
 * @return The created SootMethod
 */
private SootMethod createUnresolvedErrorMethod(SootClass declaringClass){
  SootMethod m=Scene.v().makeSootMethod(name,parameterTypes,returnType,isStatic() ? Modifier.STATIC : 0);
  int modifiers=Modifier.PUBLIC;
  if (isStatic())   modifiers|=Modifier.STATIC;
  m.setModifiers(modifiers);
  JimpleBody body=Jimple.v().newBody(m);
  m.setActiveBody(body);
  final LocalGenerator lg=new LocalGenerator(body);
  body.insertIdentityStmts();
  RefType runtimeExceptionType=RefType.v("String_Node_Str");
  NewExpr newExpr=Jimple.v().newNewExpr(runtimeExceptionType);
  Local exceptionLocal=lg.generateLocal(runtimeExceptionType);
  AssignStmt assignStmt=Jimple.v().newAssignStmt(exceptionLocal,newExpr);
  body.getUnits().add(assignStmt);
  SootMethodRef cref=Scene.v().makeConstructorRef(runtimeExceptionType.getSootClass(),Collections.<Type>singletonList(RefType.v("String_Node_Str")));
  SpecialInvokeExpr constructorInvokeExpr=Jimple.v().newSpecialInvokeExpr(exceptionLocal,cref,StringConstant.v("String_Node_Str" + getSignature() + "String_Node_Str"));
  InvokeStmt initStmt=Jimple.v().newInvokeStmt(constructorInvokeExpr);
  body.getUnits().insertAfter(initStmt,assignStmt);
  body.getUnits().insertAfter(Jimple.v().newThrowStmt(exceptionLocal),initStmt);
  return declaringClass.getOrAddMethod(m);
}

Fixed version (ground truth):
/** 
 * Creates a method body that throws an "unresolved compilation error" message
 * @param declaringClass The class that was supposed to contain the method
 * @return The created SootMethod
 */
private SootMethod createUnresolvedErrorMethod(SootClass declaringClass){
  SootMethod m=Scene.v().makeSootMethod(name,parameterTypes,returnType,isStatic() ? Modifier.STATIC : 0);
  int modifiers=Modifier.PUBLIC;
  if (isStatic())   modifiers|=Modifier.STATIC;
  m.setModifiers(modifiers);
  JimpleBody body=Jimple.v().newBody(m);
  m.setActiveBody(body);
  final LocalGenerator lg=new LocalGenerator(body);
  body.insertIdentityStmts(declaringClass);
  RefType runtimeExceptionType=RefType.v("String_Node_Str");
  NewExpr newExpr=Jimple.v().newNewExpr(runtimeExceptionType);
  Local exceptionLocal=lg.generateLocal(runtimeExceptionType);
  AssignStmt assignStmt=Jimple.v().newAssignStmt(exceptionLocal,newExpr);
  body.getUnits().add(assignStmt);
  SootMethodRef cref=Scene.v().makeConstructorRef(runtimeExceptionType.getSootClass(),Collections.<Type>singletonList(RefType.v("String_Node_Str")));
  SpecialInvokeExpr constructorInvokeExpr=Jimple.v().newSpecialInvokeExpr(exceptionLocal,cref,StringConstant.v("String_Node_Str" + getSignature() + "String_Node_Str"));
  InvokeStmt initStmt=Jimple.v().newInvokeStmt(constructorInvokeExpr);
  body.getUnits().insertAfter(initStmt,assignStmt);
  body.getUnits().insertAfter(Jimple.v().newThrowStmt(exceptionLocal),initStmt);
  return declaringClass.getOrAddMethod(m);
}
Program: 85202
Project: 85202
Buggy source:
/** 
 * Clones the current body, making deep copies of the contents. 
 */
public Object clone(){
  Body b=new JimpleBody(getMethod());
  b.importBodyContentsFrom(this);
  return b;
}

Fixed version (ground truth):
/** 
 * Clones the current body, making deep copies of the contents. 
 */
@Override public Object clone(){
  Body b=new JimpleBody(getMethod());
  b.importBodyContentsFrom(this);
  return b;
}
Program: 85203
Project: 85203
Buggy source:
/** 
 * Inserts usual statements for handling this & parameters into body. 
 */
public void insertIdentityStmts(){
  Unit lastUnit=null;
  if (!getMethod().isStatic()) {
    Local l=Jimple.v().newLocal("String_Node_Str",RefType.v(getMethod().getDeclaringClass()));
    Stmt s=Jimple.v().newIdentityStmt(l,Jimple.v().newThisRef((RefType)l.getType()));
    getLocals().add(l);
    getUnits().addFirst(s);
    lastUnit=s;
  }
  int i=0;
  for (  Type t : getMethod().getParameterTypes()) {
    Local l=Jimple.v().newLocal("String_Node_Str" + i,t);
    Stmt s=Jimple.v().newIdentityStmt(l,Jimple.v().newParameterRef(l.getType(),i));
    getLocals().add(l);
    if (lastUnit == null)     getUnits().addFirst(s);
 else     getUnits().insertAfter(s,lastUnit);
    lastUnit=s;
    i++;
  }
}

Fixed version (ground truth):
/** 
 * Inserts usual statements for handling this & parameters into body.
 * @param declaringClass the class, which should be used for this references. Can be null for static methods 
 */
public void insertIdentityStmts(SootClass declaringClass){
  final Jimple jimple=Jimple.v();
  final PatchingChain<Unit> unitChain=getUnits();
  final Chain<Local> localChain=getLocals();
  Unit lastUnit=null;
  if (!getMethod().isStatic()) {
    if (declaringClass == null)     throw new IllegalArgumentException(String.format("String_Node_Str",method.getSubSignature()));
    Local l=jimple.newLocal("String_Node_Str",RefType.v(declaringClass));
    Stmt s=jimple.newIdentityStmt(l,jimple.newThisRef((RefType)l.getType()));
    localChain.add(l);
    unitChain.addFirst(s);
    lastUnit=s;
  }
  int i=0;
  for (  Type t : getMethod().getParameterTypes()) {
    Local l=jimple.newLocal("String_Node_Str" + i,t);
    Stmt s=jimple.newIdentityStmt(l,jimple.newParameterRef(l.getType(),i));
    localChain.add(l);
    if (lastUnit == null)     unitChain.addFirst(s);
 else     unitChain.insertAfter(s,lastUnit);
    lastUnit=s;
    i++;
  }
}
Program: 85204
Project: 85204
Buggy source:
/** 
 * Validates the jimple body and saves a list of all validation errors
 * @param exceptionList the list of validation errors
 */
public void validate(List<ValidationException> exceptionList){
  super.validate(exceptionList);
  final boolean runAllValidators=Options.v().debug() || Options.v().validate();
  for (  BodyValidator validator : getValidators()) {
    if (!validator.isBasicValidator() && !runAllValidators)     continue;
    validator.validate(this,exceptionList);
  }
}

Fixed version (ground truth):
/** 
 * Validates the jimple body and saves a list of all validation errors
 * @param exceptionList the list of validation errors
 */
@Override public void validate(List<ValidationException> exceptionList){
  super.validate(exceptionList);
  final boolean runAllValidators=Options.v().debug() || Options.v().validate();
  for (  BodyValidator validator : getValidators()) {
    if (!validator.isBasicValidator() && !runAllValidators)     continue;
    validator.validate(this,exceptionList);
  }
}
Program: 85206
Project: 85206
Buggy source:
private void toInstructions(Collection<Unit> units,StmtVisitor stmtV){
  Set<ClassConstant> monitorConsts=new HashSet<ClassConstant>();
  for (  Unit u : units) {
    if (u instanceof MonitorStmt) {
      MonitorStmt monitorStmt=(MonitorStmt)u;
      if (monitorStmt.getOp() instanceof ClassConstant) {
        monitorConsts.add((ClassConstant)monitorStmt.getOp());
      }
    }
  }
  boolean monitorAllocsMade=false;
  for (  Unit u : units) {
    if (!monitorAllocsMade && !monitorConsts.isEmpty() && !(u instanceof IdentityStmt)) {
      stmtV.preAllocateMonitorConsts(monitorConsts);
      monitorAllocsMade=true;
    }
    stmtV.beginNewStmt((Stmt)u);
    u.apply(stmtV);
  }
  stmtV.finalizeInstructions();
}

Fixed version (ground truth):
private void toInstructions(Collection<Unit> units,StmtVisitor stmtV,Set<Unit> trapReferences){
  Set<ClassConstant> monitorConsts=new HashSet<ClassConstant>();
  for (  Unit u : units) {
    if (u instanceof MonitorStmt) {
      MonitorStmt monitorStmt=(MonitorStmt)u;
      if (monitorStmt.getOp() instanceof ClassConstant) {
        monitorConsts.add((ClassConstant)monitorStmt.getOp());
      }
    }
  }
  boolean monitorAllocsMade=false;
  for (  Unit u : units) {
    if (!monitorAllocsMade && !monitorConsts.isEmpty() && !(u instanceof IdentityStmt)) {
      stmtV.preAllocateMonitorConsts(monitorConsts);
      monitorAllocsMade=true;
    }
    stmtV.beginNewStmt((Stmt)u);
    u.apply(stmtV);
  }
  stmtV.finalizeInstructions(trapReferences);
}
Program: 85207
Project: 85207
Buggy source:
public void jimplify(DexBody body){
  if (getTargetInstruction(body).getUnit() != null) {
    body.add(gotoStatement());
    return;
  }
  body.addDeferredJimplification(this);
  markerUnit=Jimple.v().newNopStmt();
  unit=markerUnit;
  body.add(markerUnit);
}

Fixed version (ground truth):
public void jimplify(DexBody body){
  if (getTargetInstruction(body).getUnit() != null) {
    body.add(gotoStatement());
    return;
  }
  body.addDeferredJimplification(this);
  markerUnit=Jimple.v().newNopStmt();
  addTags(markerUnit);
  unit=markerUnit;
  body.add(markerUnit);
}
Program: 85208
Project: 85208
Buggy source:
@Override protected IfStmt ifStatement(DexBody body){
  Instruction22t i=(Instruction22t)instruction;
  Local one=body.getRegisterLocal(i.getRegisterA());
  Local other=body.getRegisterLocal(i.getRegisterB());
  BinopExpr condition=getComparisonExpr(one,other);
  IfStmt jif=Jimple.v().newIfStmt(condition,targetInstruction.getUnit());
  if (IDalvikTyper.ENABLE_DVKTYPER) {
    DalvikTyper.v().addConstraint(condition.getOp1Box(),condition.getOp2Box());
  }
  return jif;
}

Fixed version (ground truth):
@Override protected IfStmt ifStatement(DexBody body){
  Instruction22t i=(Instruction22t)instruction;
  Local one=body.getRegisterLocal(i.getRegisterA());
  Local other=body.getRegisterLocal(i.getRegisterB());
  BinopExpr condition=getComparisonExpr(one,other);
  IfStmt jif=Jimple.v().newIfStmt(condition,targetInstruction.getUnit());
  addTags(jif);
  if (IDalvikTyper.ENABLE_DVKTYPER) {
    DalvikTyper.v().addConstraint(condition.getOp1Box(),condition.getOp2Box());
  }
  return jif;
}
Program: 85209
Project: 85209
Buggy source:
@Override protected IfStmt ifStatement(DexBody body){
  Instruction21t i=(Instruction21t)instruction;
  BinopExpr condition=getComparisonExpr(body,i.getRegisterA());
  IfStmt jif=Jimple.v().newIfStmt(condition,targetInstruction.getUnit());
  if (IDalvikTyper.ENABLE_DVKTYPER) {
  }
  return jif;
}

Fixed version (ground truth):
@Override protected IfStmt ifStatement(DexBody body){
  Instruction21t i=(Instruction21t)instruction;
  BinopExpr condition=getComparisonExpr(body,i.getRegisterA());
  IfStmt jif=Jimple.v().newIfStmt(condition,targetInstruction.getUnit());
  addTags(jif);
  if (IDalvikTyper.ENABLE_DVKTYPER) {
  }
  return jif;
}
Program: 85210
Project: 85210
Buggy source:
@Override protected Stmt switchStatement(DexBody body,Instruction targetData,Local key){
  SparseSwitchPayload i=(SparseSwitchPayload)targetData;
  List<? extends SwitchElement> seList=i.getSwitchElements();
  int defaultTargetAddress=codeAddress + instruction.getCodeUnits();
  Unit defaultTarget=body.instructionAtAddress(defaultTargetAddress).getUnit();
  List<IntConstant> lookupValues=new ArrayList<IntConstant>();
  List<Unit> targets=new ArrayList<Unit>();
  for (  SwitchElement se : seList) {
    lookupValues.add(IntConstant.v(se.getKey()));
    int offset=se.getOffset();
    targets.add(body.instructionAtAddress(codeAddress + offset).getUnit());
  }
  LookupSwitchStmt switchStmt=Jimple.v().newLookupSwitchStmt(key,lookupValues,targets,defaultTarget);
  setUnit(switchStmt);
  if (IDalvikTyper.ENABLE_DVKTYPER) {
    DalvikTyper.v().setType(switchStmt.getKeyBox(),IntType.v(),true);
  }
  return switchStmt;
}

Fixed version (ground truth):
@Override protected Stmt switchStatement(DexBody body,Instruction targetData,Local key){
  SparseSwitchPayload i=(SparseSwitchPayload)targetData;
  List<? extends SwitchElement> seList=i.getSwitchElements();
  int defaultTargetAddress=codeAddress + instruction.getCodeUnits();
  Unit defaultTarget=body.instructionAtAddress(defaultTargetAddress).getUnit();
  List<IntConstant> lookupValues=new ArrayList<IntConstant>();
  List<Unit> targets=new ArrayList<Unit>();
  for (  SwitchElement se : seList) {
    lookupValues.add(IntConstant.v(se.getKey()));
    int offset=se.getOffset();
    targets.add(body.instructionAtAddress(codeAddress + offset).getUnit());
  }
  LookupSwitchStmt switchStmt=Jimple.v().newLookupSwitchStmt(key,lookupValues,targets,defaultTarget);
  setUnit(switchStmt);
  addTags(switchStmt);
  if (IDalvikTyper.ENABLE_DVKTYPER) {
    DalvikTyper.v().setType(switchStmt.getKeyBox(),IntType.v(),true);
  }
  return switchStmt;
}
Program: 85211
Project: 85211
Buggy source:
public void outputSummary(){
  out.println("String_Node_Str" + (divPerformed + mulPerformed));
  out.println("String_Node_Str" + total);
}

Fixed version (ground truth):
public void outputSummary(){
  if (!output) {
    return;
  }
  out.println("String_Node_Str" + (divPerformed + mulPerformed));
  out.println("String_Node_Str" + total);
}
Program: 85213
Project: 85213
Buggy source:
private Object[] checkNumericValue(NumericConstant nc){
  Double d=null;
  Object shift[]=new Object[3];
  if (nc instanceof IntConstant) {
    d=new Double(((IntConstant)nc).value);
  }
 else   if (nc instanceof DoubleConstant) {
    d=new Double(((DoubleConstant)nc).value);
  }
 else   if (nc instanceof FloatConstant) {
    d=new Double(((FloatConstant)nc).value);
  }
 else   if (nc instanceof LongConstant) {
    d=new Double(((LongConstant)nc).value);
  }
  if (d != null) {
    shift[2]=new Boolean(d.doubleValue() < 0);
    double tmp[]=checkShiftValue(d.doubleValue());
    if (tmp[0] != 0) {
      shift[0]=new Integer((int)tmp[0]);
      if (tmp[1] != 0)       shift[1]=new Double(tmp[1]);
 else       shift[1]=null;
    }
 else     d=null;
  }
  if (d == null) {
    shift[0]=null;
    shift[1]=null;
  }
  return shift;
}

Fixed version (ground truth):
private Object[] checkNumericValue(NumericConstant nc){
  Double dnc=null;
  if (nc instanceof IntConstant) {
    dnc=(double)((IntConstant)nc).value;
  }
 else   if (nc instanceof DoubleConstant) {
    dnc=((DoubleConstant)nc).value;
  }
 else   if (nc instanceof FloatConstant) {
    dnc=(double)((FloatConstant)nc).value;
  }
 else   if (nc instanceof LongConstant) {
    dnc=(double)((LongConstant)nc).value;
  }
  Object shift[]=new Object[3];
  if (dnc != null) {
    shift[2]=dnc < 0;
    double tmp[]=checkShiftValue(dnc);
    if (tmp[0] != 0) {
      shift[0]=(int)tmp[0];
      if (tmp[1] != 0) {
        shift[1]=tmp[1];
      }
 else {
        shift[1]=null;
      }
    }
 else {
      dnc=null;
    }
  }
  if (dnc == null) {
    shift[0]=null;
    shift[1]=null;
  }
  return shift;
}
Program: 85214
Project: 85214
Buggy source:
private double[] checkShiftValue(double val){
  double shift[]=new double[2];
  if (val == 0 || val == 1 || val == -1) {
    shift[0]=0;
    shift[1]=0;
  }
 else {
    double shift_dbl=Math.log(val) / Math.log(2);
    double shift_int=Math.rint(shift_dbl);
    if (shift_dbl == shift_int) {
      shift[1]=0;
    }
 else {
      if (Math.pow(2,shift_int) > val)       shift_int--;
      shift[1]=val - Math.pow(2,shift_int);
    }
    shift[0]=shift_int;
  }
  return shift;
}

Fixed version (ground truth):
private double[] checkShiftValue(double val){
  double shift[]=new double[2];
  if (val == 0 || val == 1 || val == -1) {
    shift[0]=0;
    shift[1]=0;
  }
 else {
    double shift_dbl=Math.log(val) / Math.log(2);
    double shift_int=Math.rint(shift_dbl);
    if (shift_dbl == shift_int) {
      shift[1]=0;
    }
 else {
      if (Math.pow(2,shift_int) > val) {
        shift_int--;
      }
      shift[1]=val - Math.pow(2,shift_int);
    }
    shift[0]=shift_int;
  }
  return shift;
}
Program: 85215
Project: 85215
Buggy source:
public UnitInterferenceGraph(Body body,Map<Local,Object> localToGroup,LiveLocals liveLocals,ExceptionalUnitGraph unitGraph){
  locals=new ArrayList<Local>();
  locals.addAll(body.getLocals());
{
    localToLocals=new HashMap<Local,Set<Local>>(body.getLocalCount() * 2 + 1,0.7f);
  }
{
    for (    Unit unit : body.getUnits()) {
      List<ValueBox> defBoxes=unit.getDefBoxes();
      if (!defBoxes.isEmpty()) {
        if (!(defBoxes.size() == 1))         throw new RuntimeException("String_Node_Str");
        Set<Local> liveLocalsAtUnit=new HashSet<Local>();
        for (        Unit succ : unitGraph.getUnexceptionalSuccsOf(unit)) {
          List<Local> beforeSucc=liveLocals.getLiveLocalsBefore(succ);
          liveLocalsAtUnit.addAll(beforeSucc);
        }
        Value defValue=((ValueBox)defBoxes.get(0)).getValue();
        if (defValue instanceof Local) {
          Local defLocal=(Local)defValue;
          for (          Local otherLocal : liveLocalsAtUnit) {
            if (localToGroup.get(otherLocal).equals(localToGroup.get(defLocal)))             setInterference(defLocal,otherLocal);
          }
        }
      }
    }
  }
}

Fixed version (ground truth):
public UnitInterferenceGraph(Body body,Map<Local,Object> localToGroup,LiveLocals liveLocals,ExceptionalUnitGraph unitGraph){
  locals=new ArrayList<Local>();
  locals.addAll(body.getLocals());
{
    localToLocals=new HashMap<Local,Set<Local>>(body.getLocalCount() * 2 + 1,0.7f);
  }
{
    for (    Unit unit : body.getUnits()) {
      List<ValueBox> defBoxes=unit.getDefBoxes();
      if (!defBoxes.isEmpty()) {
        if (!(defBoxes.size() == 1))         throw new RuntimeException("String_Node_Str");
        Set<Local> liveLocalsAtUnit=new HashSet<Local>();
        for (        Unit succ : unitGraph.getSuccsOf(unit)) {
          List<Local> beforeSucc=liveLocals.getLiveLocalsBefore(succ);
          liveLocalsAtUnit.addAll(beforeSucc);
        }
        Value defValue=defBoxes.get(0).getValue();
        if (defValue instanceof Local) {
          Local defLocal=(Local)defValue;
          for (          Local otherLocal : liveLocalsAtUnit) {
            if (localToGroup.get(otherLocal).equals(localToGroup.get(defLocal)))             setInterference(defLocal,otherLocal);
          }
        }
      }
    }
  }
}
Program: 85216
Project: 85216
Buggy source:
public int hashCode(){
  return string.hashCode() * 101 + group.hashCode() + 17;
}

Fixed version (ground truth):
@Override public int hashCode(){
  return string.hashCode() * 101 + group.hashCode() + 17;
}
Program: 85217
Project: 85217
Buggy source:
public boolean equals(Object p){
  if (p instanceof StringGroupPair) {
    return ((StringGroupPair)p).string.equals(this.string) && ((StringGroupPair)p).group.equals(this.group);
  }
  return false;
}

Fixed version (ground truth):
@Override public boolean equals(Object p){
  if (p instanceof StringGroupPair) {
    return ((StringGroupPair)p).string.equals(this.string) && ((StringGroupPair)p).group.equals(this.group);
  }
  return false;
}
Program: 85218
Project: 85218
Buggy source:
public static String getNewName(){
  int size=5;
  int tries=0;
  int index=Rand.getInt(stringChars.length);
  int length=stringChars[index].length;
  String result=null;
  char cNewName[]=new char[size];
  do {
    if (tries == size) {
      cNewName=new char[++size];
      tries=0;
    }
    do {
      cNewName[0]=stringChars[index][Rand.getInt(length)];
    }
 while (!Character.isJavaIdentifierStart(cNewName[0]));
    for (int i=1; i < cNewName.length; i++) {
      int rand=Rand.getInt(length);
      cNewName[i]=stringChars[index][rand];
    }
    result=String.copyValueOf(cNewName);
    tries++;
  }
 while (oldToNewMethodNames.containsValue(result) || BodyBuilder.nameList.contains(result));
  BodyBuilder.nameList.add(result);
  return result;
}

Fixed version (ground truth):
public static String getNewName(){
  int size=5;
  int tries=0;
  int index=Rand.getInt(stringChars.length);
  int length=stringChars[index].length;
  String result;
  char cNewName[]=new char[size];
  do {
    if (tries == size) {
      cNewName=new char[++size];
      tries=0;
    }
    do {
      cNewName[0]=stringChars[index][Rand.getInt(length)];
    }
 while (!Character.isJavaIdentifierStart(cNewName[0]));
    for (int i=1; i < cNewName.length; i++) {
      int rand=Rand.getInt(length);
      cNewName[i]=stringChars[index][rand];
    }
    result=String.copyValueOf(cNewName);
    tries++;
  }
 while (oldToNewMethodNames.containsValue(result) || BodyBuilder.nameList.contains(result));
  BodyBuilder.nameList.add(result);
  return result;
}
Program: 85219
Project: 85219
Buggy source:
private static boolean allowsRename(SootClass c,SootMethod m){
  if (soot.jbco.Main.getWeight(MethodRenamer.name,m.getName()) == 0)   return false;
  String subSig=m.getSubSignature();
  if (subSig.equals("String_Node_Str") && m.isPublic() && m.isStatic()) {
    return false;
  }
 else   if (subSig.indexOf("String_Node_Str") >= 0 || subSig.equals("String_Node_Str")) {
    return false;
  }
 else {
    for (    SootClass _c : hierarchy.getSuperclassesOfIncluding(c.getSuperclass())) {
      if (_c.isLibraryClass() && _c.declaresMethod(subSig) && hierarchy.isVisible(c,_c.getMethod(subSig))) {
        return false;
      }
    }
    do {
      if (checkInterfacesForMethod(c,m))       return false;
    }
 while (c.hasSuperclass() && (c=c.getSuperclass()) != null);
  }
  return true;
}

Fixed version (ground truth):
private static boolean allowsRename(SootClass sc,SootMethod method){
  if (soot.jbco.Main.getWeight(MethodRenamer.name,method.getName()) == 0) {
    return false;
  }
  String subSig=method.getSubSignature();
  if ("String_Node_Str".equals(subSig) && method.isPublic() && method.isStatic()) {
    return false;
  }
 else   if (subSig.contains(SootMethod.constructorName) || subSig.equals(SootMethod.staticInitializerName)) {
    return false;
  }
 else {
    return !(isOverriddenLibraryInterfaceMethod(sc,method) || isOverriddenLibrarySuperclassMethod(sc,method));
  }
}
Program: 85221
Project: 85221
Buggy source:
@Override public SootMethod next(){
  if (!hasNext())   throw new NoSuchElementException();
  SootMethod n=next;
  next=null;
  return n;
}

Fixed version (ground truth):
@Override public SootMethod next(){
  if (!hasNext())   throw new NoSuchElementException();
  SootMethod n=current;
  current=null;
  SootClass currentClass=n.getDeclaringClass();
  while (true) {
    SootClass superClass=currentClass.getSuperclassUnsafe();
    if (superClass == null)     break;
    SootMethod m=superClass.getMethodUnsafe(sigClinit);
    if (m != null) {
      current=m;
      break;
    }
    currentClass=superClass;
  }
  return n;
}
Program: 85222
Project: 85222
Buggy source:
/** 
 * Returns a list of all clinits of class cl and its superclasses. 
 */
public Iterable<SootMethod> clinitsOf(SootClass cl){
  final SootMethod initStart=cl.getMethodUnsafe(sigClinit);
  if (initStart == null)   return Collections.emptyList();
  return new Iterable<SootMethod>(){
    @Override public Iterator<SootMethod> iterator(){
      return new Iterator<SootMethod>(){
        SootMethod current=initStart;
        SootMethod next=null;
        @Override public SootMethod next(){
          if (!hasNext())           throw new NoSuchElementException();
          SootMethod n=next;
          next=null;
          return n;
        }
        @Override public boolean hasNext(){
          if (next != null)           return true;
          SootClass currentClass=current.getDeclaringClass();
          while (true) {
            SootClass superClass=currentClass.getSuperclassUnsafe();
            if (superClass == null)             return false;
            SootMethod m=superClass.getMethodUnsafe(sigClinit);
            if (m != null) {
              next=m;
              current=m;
              return true;
            }
            currentClass=superClass;
          }
        }
      }
;
    }
  }
;
}

Fixed version (ground truth):
/** 
 * Returns a list of all clinits of class cl and its superclasses. 
 */
public Iterable<SootMethod> clinitsOf(SootClass cl){
  final SootMethod initStart=cl.getMethodUnsafe(sigClinit);
  if (initStart == null)   return Collections.emptyList();
  return new Iterable<SootMethod>(){
    @Override public Iterator<SootMethod> iterator(){
      return new Iterator<SootMethod>(){
        SootMethod current=initStart;
        @Override public SootMethod next(){
          if (!hasNext())           throw new NoSuchElementException();
          SootMethod n=current;
          current=null;
          SootClass currentClass=n.getDeclaringClass();
          while (true) {
            SootClass superClass=currentClass.getSuperclassUnsafe();
            if (superClass == null)             break;
            SootMethod m=superClass.getMethodUnsafe(sigClinit);
            if (m != null) {
              current=m;
              break;
            }
            currentClass=superClass;
          }
          return n;
        }
        @Override public boolean hasNext(){
          return current != null;
        }
      }
;
    }
  }
;
}
Program: 85223
Project: 85223
Buggy source:
@Override public boolean hasNext(){
  if (next != null)   return true;
  SootClass currentClass=current.getDeclaringClass();
  while (true) {
    SootClass superClass=currentClass.getSuperclassUnsafe();
    if (superClass == null)     return false;
    SootMethod m=superClass.getMethodUnsafe(sigClinit);
    if (m != null) {
      next=m;
      current=m;
      return true;
    }
    currentClass=superClass;
  }
}

Fixed version (ground truth):
@Override public boolean hasNext(){
  return current != null;
}
Program: 85224
Project: 85224
Buggy source:
@Override public Iterator<SootMethod> iterator(){
  return new Iterator<SootMethod>(){
    SootMethod current=initStart;
    SootMethod next=null;
    @Override public SootMethod next(){
      if (!hasNext())       throw new NoSuchElementException();
      SootMethod n=next;
      next=null;
      return n;
    }
    @Override public boolean hasNext(){
      if (next != null)       return true;
      SootClass currentClass=current.getDeclaringClass();
      while (true) {
        SootClass superClass=currentClass.getSuperclassUnsafe();
        if (superClass == null)         return false;
        SootMethod m=superClass.getMethodUnsafe(sigClinit);
        if (m != null) {
          next=m;
          current=m;
          return true;
        }
        currentClass=superClass;
      }
    }
  }
;
}

Fixed version (ground truth):
@Override public Iterator<SootMethod> iterator(){
  return new Iterator<SootMethod>(){
    SootMethod current=initStart;
    @Override public SootMethod next(){
      if (!hasNext())       throw new NoSuchElementException();
      SootMethod n=current;
      current=null;
      SootClass currentClass=n.getDeclaringClass();
      while (true) {
        SootClass superClass=currentClass.getSuperclassUnsafe();
        if (superClass == null)         break;
        SootMethod m=superClass.getMethodUnsafe(sigClinit);
        if (m != null) {
          current=m;
          break;
        }
        currentClass=superClass;
      }
      return n;
    }
    @Override public boolean hasNext(){
      return current != null;
    }
  }
;
}
Program: 85226
Project: 85226
Buggy source:
private SootMethod getOrCreateInitializer(SootClass sc,Set<SootField> alreadyInitialized){
  SootMethod smInit;
  smInit=sc.getMethodByNameUnsafe("String_Node_Str");
  if (smInit == null) {
    smInit=Scene.v().makeSootMethod("String_Node_Str",Collections.<Type>emptyList(),VoidType.v());
    smInit.setActiveBody(Jimple.v().newBody(smInit));
    sc.addMethod(smInit);
    smInit.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
  }
 else {
    smInit.retrieveActiveBody();
    for (    Unit u : smInit.getActiveBody().getUnits()) {
      Stmt s=(Stmt)u;
      for (      ValueBox vb : s.getDefBoxes())       if (vb.getValue() instanceof FieldRef)       alreadyInitialized.add(((FieldRef)vb.getValue()).getField());
    }
  }
  return smInit;
}

Fixed version (ground truth):
private SootMethod getOrCreateInitializer(SootClass sc,Set<SootField> alreadyInitialized){
  SootMethod smInit;
  smInit=sc.getMethodByNameUnsafe("String_Node_Str");
  if (smInit == null) {
    smInit=Scene.v().makeSootMethod("String_Node_Str",Collections.<Type>emptyList(),VoidType.v());
    smInit.setActiveBody(Jimple.v().newBody(smInit));
    sc.addMethod(smInit);
    smInit.setModifiers(Modifier.PUBLIC | Modifier.STATIC);
  }
 else   if (smInit.isPhantom())   return null;
 else {
    smInit.retrieveActiveBody();
    for (    Unit u : smInit.getActiveBody().getUnits()) {
      Stmt s=(Stmt)u;
      for (      ValueBox vb : s.getDefBoxes())       if (vb.getValue() instanceof FieldRef)       alreadyInitialized.add(((FieldRef)vb.getValue()).getField());
    }
  }
  return smInit;
}
Program: 85227
Project: 85227
Buggy source:
private void addInitializingValue(SootClass clas,SootField f,Constant con){
  if (con instanceof NullConstant) {
    return;
  }
 else   if (con instanceof IntConstant) {
    if (((IntConstant)con).value == 0)     return;
  }
 else   if (con instanceof LongConstant) {
    if (((LongConstant)con).value == 0)     return;
  }
 else   if (con instanceof StringConstant) {
    if (((StringConstant)con).value == null)     return;
  }
 else   if (con instanceof DoubleConstant) {
    if (((DoubleConstant)con).value == 0)     return;
  }
 else   if (con instanceof FloatConstant) {
    if (((FloatConstant)con).value == 0)     return;
  }
  Body b=null;
  boolean newInit=false;
  if (!clas.declaresMethodByName("String_Node_Str")) {
    SootMethod m=Scene.v().makeSootMethod("String_Node_Str",Collections.<Type>emptyList(),VoidType.v());
    clas.addMethod(m);
    b=Jimple.v().newBody(m);
    m.setActiveBody(b);
    newInit=true;
  }
 else {
    SootMethod m=clas.getMethodByName("String_Node_Str");
    if (!m.hasActiveBody()) {
      b=Jimple.v().newBody(m);
      m.setActiveBody(b);
      newInit=true;
    }
 else {
      b=m.getActiveBody();
    }
  }
  PatchingChain<Unit> units=b.getUnits();
  units.addFirst(Jimple.v().newAssignStmt(Jimple.v().newStaticFieldRef(f.makeRef()),con));
  if (newInit)   units.addLast(Jimple.v().newReturnVoidStmt());
}

Fixed version (ground truth):
private void addInitializingValue(SootClass clas,SootField f,Constant con){
  if (con instanceof NullConstant) {
    return;
  }
 else   if (con instanceof IntConstant) {
    if (((IntConstant)con).value == 0)     return;
  }
 else   if (con instanceof LongConstant) {
    if (((LongConstant)con).value == 0)     return;
  }
 else   if (con instanceof StringConstant) {
    if (((StringConstant)con).value == null)     return;
  }
 else   if (con instanceof DoubleConstant) {
    if (((DoubleConstant)con).value == 0)     return;
  }
 else   if (con instanceof FloatConstant) {
    if (((FloatConstant)con).value == 0)     return;
  }
  Body b;
  boolean newInit=false;
  if (!clas.declaresMethodByName(SootMethod.staticInitializerName)) {
    SootMethod m=Scene.v().makeSootMethod(SootMethod.staticInitializerName,Collections.<Type>emptyList(),VoidType.v(),Modifier.STATIC);
    clas.addMethod(m);
    b=Jimple.v().newBody(m);
    m.setActiveBody(b);
    newInit=true;
  }
 else {
    SootMethod m=clas.getMethodByName(SootMethod.staticInitializerName);
    if (!m.hasActiveBody()) {
      b=Jimple.v().newBody(m);
      m.setActiveBody(b);
      newInit=true;
    }
 else {
      b=m.getActiveBody();
    }
  }
  PatchingChain<Unit> units=b.getUnits();
  units.addFirst(Jimple.v().newAssignStmt(Jimple.v().newStaticFieldRef(f.makeRef()),con));
  if (newInit)   units.addLast(Jimple.v().newReturnVoidStmt());
}
Program: 85229
Project: 85229
Buggy source:
protected void setBooleanTo(SootClass c,SootField f,boolean value){
  if (!value && f.getType() instanceof IntegerType && Rand.getInt() % 2 > 0)   return;
  Body b=null;
  boolean newInit=false;
  if (!c.declaresMethodByName("String_Node_Str")) {
    SootMethod m=Scene.v().makeSootMethod("String_Node_Str",Collections.<Type>emptyList(),VoidType.v());
    c.addMethod(m);
    b=Jimple.v().newBody(m);
    m.setActiveBody(b);
    newInit=true;
  }
 else {
    SootMethod m=c.getMethodByName("String_Node_Str");
    b=m.getActiveBody();
  }
  PatchingChain<Unit> units=b.getUnits();
  if (f.getType() instanceof IntegerType) {
    units.addFirst(Jimple.v().newAssignStmt(Jimple.v().newStaticFieldRef(f.makeRef()),IntConstant.v(value ? 1 : 0)));
  }
 else {
    Local bool=Jimple.v().newLocal("String_Node_Str",boolRef);
    b.getLocals().add(bool);
    SootMethod boolInit=boolRef.getSootClass().getMethod("String_Node_Str");
    units.addFirst(Jimple.v().newAssignStmt(Jimple.v().newStaticFieldRef(f.makeRef()),bool));
    units.addFirst(Jimple.v().newInvokeStmt(Jimple.v().newSpecialInvokeExpr(bool,boolInit.makeRef(),IntConstant.v(value ? 1 : 0))));
    units.addFirst(Jimple.v().newAssignStmt(bool,Jimple.v().newNewExpr(boolRef)));
  }
  if (newInit)   units.addLast(Jimple.v().newReturnVoidStmt());
}

Fixed version (ground truth):
protected void setBooleanTo(SootClass c,SootField f,boolean value){
  if (!value && f.getType() instanceof IntegerType && Rand.getInt() % 2 > 0)   return;
  Body b;
  boolean newInit=false;
  if (!c.declaresMethodByName(SootMethod.staticInitializerName)) {
    SootMethod m=Scene.v().makeSootMethod(SootMethod.staticInitializerName,Collections.<Type>emptyList(),VoidType.v(),Modifier.STATIC);
    c.addMethod(m);
    b=Jimple.v().newBody(m);
    m.setActiveBody(b);
    newInit=true;
  }
 else {
    SootMethod m=c.getMethodByName(SootMethod.staticInitializerName);
    b=m.getActiveBody();
  }
  PatchingChain<Unit> units=b.getUnits();
  if (f.getType() instanceof IntegerType) {
    units.addFirst(Jimple.v().newAssignStmt(Jimple.v().newStaticFieldRef(f.makeRef()),IntConstant.v(value ? 1 : 0)));
  }
 else {
    Local bool=Jimple.v().newLocal("String_Node_Str",boolRef);
    b.getLocals().add(bool);
    SootMethod boolInit=boolRef.getSootClass().getMethod("String_Node_Str");
    units.addFirst(Jimple.v().newAssignStmt(Jimple.v().newStaticFieldRef(f.makeRef()),bool));
    units.addFirst(Jimple.v().newInvokeStmt(Jimple.v().newSpecialInvokeExpr(bool,boolInit.makeRef(),IntConstant.v(value ? 1 : 0))));
    units.addFirst(Jimple.v().newAssignStmt(bool,Jimple.v().newNewExpr(boolRef)));
  }
  if (newInit)   units.addLast(Jimple.v().newReturnVoidStmt());
}
Program: 85233
Project: 85233
Buggy source:
/** 
 * @param dexSourceFile Path to a jar, apk, dex, odex, etc. file
 * @return List of dex files derived from source file
 */
public Collection<DexBackedDexFile> getDexFiles(File dexSourceFile){
  return getDexNameToFileMapping(dexSourceFile).values();
}

Fixed version (ground truth):
/** 
 * @param dexSourceFile Path to a jar, apk, dex, odex, etc. file
 * @return List of dex files derived from source file
 */
public Collection<DexBackedDexFile> getDexFiles(File dexSourceFile) throws IOException {
  return getDexNameToFileMapping(dexSourceFile).values();
}