Program: 88540
Project: 88540
Buggy source:
public soot.jimple.JimpleBody createBody(soot.SootMethod sootMethod){
  body=soot.jimple.Jimple.v().newBody(sootMethod);
  lg=new LocalGenerator(body);
  AnonClassInitMethodSource acims=(AnonClassInitMethodSource)body.getMethod().getSource();
  ArrayList fields=acims.getFinalsList();
  boolean inStaticMethod=acims.inStaticMethod();
  boolean isSubType=acims.isSubType();
  soot.Type superOuterType=acims.superOuterType();
  soot.Type thisOuterType=acims.thisOuterType();
  ArrayList fieldInits=acims.getFieldInits();
  soot.Type outerClassType=acims.outerClassType();
  polyglot.types.ClassType polyglotType=acims.polyglotType();
  boolean hasOuterRef=((AnonClassInitMethodSource)body.getMethod().getSource()).hasOuterRef();
  boolean hasQualifier=((AnonClassInitMethodSource)body.getMethod().getSource()).hasQualifier();
  soot.RefType type=sootMethod.getDeclaringClass().getType();
  specialThisLocal=soot.jimple.Jimple.v().newLocal("String_Node_Str",type);
  body.getLocals().add(specialThisLocal);
  soot.jimple.ThisRef thisRef=soot.jimple.Jimple.v().newThisRef(type);
  soot.jimple.Stmt thisStmt=soot.jimple.Jimple.v().newIdentityStmt(specialThisLocal,thisRef);
  body.getUnits().add(thisStmt);
  ArrayList invokeList=new ArrayList();
  ArrayList invokeTypeList=new ArrayList();
  int numParams=sootMethod.getParameterCount();
  int numFinals=0;
  if (fields != null) {
    numFinals=fields.size();
  }
  int startFinals=numParams - numFinals;
  ArrayList paramsForFinals=new ArrayList();
  soot.Local outerLocal=null;
  soot.Local qualifierLocal=null;
  Iterator fIt=sootMethod.getParameterTypes().iterator();
  int counter=0;
  while (fIt.hasNext()) {
    soot.Type fType=(soot.Type)fIt.next();
    soot.Local local=soot.jimple.Jimple.v().newLocal("String_Node_Str" + counter,fType);
    body.getLocals().add(local);
    soot.jimple.ParameterRef paramRef=soot.jimple.Jimple.v().newParameterRef(fType,counter);
    soot.jimple.Stmt stmt=soot.jimple.Jimple.v().newIdentityStmt(local,paramRef);
    int realArgs=0;
    if ((hasOuterRef) && (counter == 0)) {
      outerLocal=local;
      realArgs=1;
    }
    if ((hasOuterRef) && (hasQualifier) && (counter == 1)) {
      qualifierLocal=local;
      realArgs=2;
      invokeList.add(qualifierLocal);
    }
 else     if ((!hasOuterRef) && (hasQualifier) && (counter == 0)) {
      qualifierLocal=local;
      realArgs=1;
      invokeList.add(qualifierLocal);
    }
    if ((counter >= realArgs) && (counter < startFinals)) {
      invokeTypeList.add(fType);
      invokeList.add(local);
    }
 else     if (counter >= startFinals) {
      paramsForFinals.add(local);
    }
    body.getUnits().add(stmt);
    counter++;
  }
  SootClass superClass=sootMethod.getDeclaringClass().getSuperclass();
  if (needsOuterClassRef(polyglotType)) {
    invokeTypeList.add(0,superOuterType);
  }
  SootMethodRef callMethod=Scene.v().makeMethodRef(sootMethod.getDeclaringClass().getSuperclass(),"String_Node_Str",invokeTypeList,VoidType.v(),false);
  if ((!hasQualifier) && (needsOuterClassRef(polyglotType))) {
    if (isSubType) {
      invokeList.add(0,outerLocal);
    }
 else {
      invokeList.add(0,Util.getThisGivenOuter(superOuterType,new HashMap(),body,new LocalGenerator(body),outerLocal));
    }
  }
  soot.jimple.InvokeExpr invoke=soot.jimple.Jimple.v().newSpecialInvokeExpr(specialThisLocal,callMethod,invokeList);
  soot.jimple.Stmt invokeStmt=soot.jimple.Jimple.v().newInvokeStmt(invoke);
  body.getUnits().add(invokeStmt);
  if (!inStaticMethod) {
    soot.SootFieldRef field=Scene.v().makeFieldRef(sootMethod.getDeclaringClass(),"String_Node_Str",outerClassType,false);
    soot.jimple.InstanceFieldRef ref=soot.jimple.Jimple.v().newInstanceFieldRef(specialThisLocal,field);
    soot.jimple.AssignStmt assign=soot.jimple.Jimple.v().newAssignStmt(ref,outerLocal);
    body.getUnits().add(assign);
  }
  if (fields != null) {
    Iterator finalsIt=paramsForFinals.iterator();
    Iterator fieldsIt=fields.iterator();
    while (finalsIt.hasNext() && fieldsIt.hasNext()) {
      soot.Local pLocal=(soot.Local)finalsIt.next();
      soot.SootField pField=(soot.SootField)fieldsIt.next();
      soot.jimple.FieldRef pRef=soot.jimple.Jimple.v().newInstanceFieldRef(specialThisLocal,pField.makeRef());
      soot.jimple.AssignStmt pAssign=soot.jimple.Jimple.v().newAssignStmt(pRef,pLocal);
      body.getUnits().add(pAssign);
    }
  }
  if (fieldInits != null) {
    handleFieldInits(fieldInits);
  }
  ArrayList staticBlocks=((AnonClassInitMethodSource)body.getMethod().getSource()).getInitializerBlocks();
  if (staticBlocks != null) {
    handleStaticBlocks(staticBlocks);
  }
  soot.jimple.ReturnVoidStmt retStmt=soot.jimple.Jimple.v().newReturnVoidStmt();
  body.getUnits().add(retStmt);
  return body;
}

Fixed version (ground truth):
public soot.jimple.JimpleBody createBody(soot.SootMethod sootMethod){
  body=soot.jimple.Jimple.v().newBody(sootMethod);
  lg=new LocalGenerator(body);
  AnonClassInitMethodSource acims=(AnonClassInitMethodSource)body.getMethod().getSource();
  ArrayList fields=acims.getFinalsList();
  boolean inStaticMethod=acims.inStaticMethod();
  boolean isSubType=acims.isSubType();
  soot.Type superOuterType=acims.superOuterType();
  soot.Type thisOuterType=acims.thisOuterType();
  ArrayList fieldInits=acims.getFieldInits();
  soot.Type outerClassType=acims.outerClassType();
  polyglot.types.ClassType polyglotType=acims.polyglotType();
  polyglot.types.ClassType anonType=acims.anonType();
  boolean hasOuterRef=((AnonClassInitMethodSource)body.getMethod().getSource()).hasOuterRef();
  boolean hasQualifier=((AnonClassInitMethodSource)body.getMethod().getSource()).hasQualifier();
  soot.RefType type=sootMethod.getDeclaringClass().getType();
  specialThisLocal=soot.jimple.Jimple.v().newLocal("String_Node_Str",type);
  body.getLocals().add(specialThisLocal);
  soot.jimple.ThisRef thisRef=soot.jimple.Jimple.v().newThisRef(type);
  soot.jimple.Stmt thisStmt=soot.jimple.Jimple.v().newIdentityStmt(specialThisLocal,thisRef);
  body.getUnits().add(thisStmt);
  ArrayList invokeList=new ArrayList();
  ArrayList invokeTypeList=new ArrayList();
  int numParams=sootMethod.getParameterCount();
  int numFinals=0;
  if (fields != null) {
    numFinals=fields.size();
  }
  int startFinals=numParams - numFinals;
  ArrayList paramsForFinals=new ArrayList();
  soot.Local outerLocal=null;
  soot.Local qualifierLocal=null;
  Iterator fIt=sootMethod.getParameterTypes().iterator();
  int counter=0;
  while (fIt.hasNext()) {
    soot.Type fType=(soot.Type)fIt.next();
    soot.Local local=soot.jimple.Jimple.v().newLocal("String_Node_Str" + counter,fType);
    body.getLocals().add(local);
    soot.jimple.ParameterRef paramRef=soot.jimple.Jimple.v().newParameterRef(fType,counter);
    soot.jimple.Stmt stmt=soot.jimple.Jimple.v().newIdentityStmt(local,paramRef);
    int realArgs=0;
    if ((hasOuterRef) && (counter == 0)) {
      outerLocal=local;
      realArgs=1;
    }
    if ((hasOuterRef) && (hasQualifier) && (counter == 1)) {
      qualifierLocal=local;
      realArgs=2;
      invokeList.add(qualifierLocal);
    }
 else     if ((!hasOuterRef) && (hasQualifier) && (counter == 0)) {
      qualifierLocal=local;
      realArgs=1;
      invokeList.add(qualifierLocal);
    }
    if ((counter >= realArgs) && (counter < startFinals)) {
      invokeTypeList.add(fType);
      invokeList.add(local);
    }
 else     if (counter >= startFinals) {
      paramsForFinals.add(local);
    }
    body.getUnits().add(stmt);
    counter++;
  }
  SootClass superClass=sootMethod.getDeclaringClass().getSuperclass();
  if (needsOuterClassRef(polyglotType)) {
    invokeTypeList.add(0,superOuterType);
  }
  SootMethodRef callMethod=Scene.v().makeMethodRef(sootMethod.getDeclaringClass().getSuperclass(),"String_Node_Str",invokeTypeList,VoidType.v(),false);
  if ((!hasQualifier) && (needsOuterClassRef(polyglotType))) {
    if (isSubType) {
      invokeList.add(0,outerLocal);
    }
 else {
      invokeList.add(0,Util.getThisGivenOuter(superOuterType,new HashMap(),body,new LocalGenerator(body),outerLocal));
    }
  }
  soot.jimple.InvokeExpr invoke=soot.jimple.Jimple.v().newSpecialInvokeExpr(specialThisLocal,callMethod,invokeList);
  soot.jimple.Stmt invokeStmt=soot.jimple.Jimple.v().newInvokeStmt(invoke);
  body.getUnits().add(invokeStmt);
  if (!inStaticMethod && needsOuterClassRef(anonType)) {
    soot.SootFieldRef field=Scene.v().makeFieldRef(sootMethod.getDeclaringClass(),"String_Node_Str",outerClassType,false);
    soot.jimple.InstanceFieldRef ref=soot.jimple.Jimple.v().newInstanceFieldRef(specialThisLocal,field);
    soot.jimple.AssignStmt assign=soot.jimple.Jimple.v().newAssignStmt(ref,outerLocal);
    body.getUnits().add(assign);
  }
  if (fields != null) {
    Iterator finalsIt=paramsForFinals.iterator();
    Iterator fieldsIt=fields.iterator();
    while (finalsIt.hasNext() && fieldsIt.hasNext()) {
      soot.Local pLocal=(soot.Local)finalsIt.next();
      soot.SootField pField=(soot.SootField)fieldsIt.next();
      soot.jimple.FieldRef pRef=soot.jimple.Jimple.v().newInstanceFieldRef(specialThisLocal,pField.makeRef());
      soot.jimple.AssignStmt pAssign=soot.jimple.Jimple.v().newAssignStmt(pRef,pLocal);
      body.getUnits().add(pAssign);
    }
  }
  if (fieldInits != null) {
    handleFieldInits(fieldInits);
  }
  ArrayList staticBlocks=((AnonClassInitMethodSource)body.getMethod().getSource()).getInitializerBlocks();
  if (staticBlocks != null) {
    handleStaticBlocks(staticBlocks);
  }
  soot.jimple.ReturnVoidStmt retStmt=soot.jimple.Jimple.v().newReturnVoidStmt();
  body.getUnits().add(retStmt);
  return body;
}