Program: 88592
Project: 88592
Buggy source:
/** 
 * Call Expression Creation
 */
private soot.Local getCallLocal(polyglot.ast.Call call){
  String name=call.name();
  polyglot.ast.Receiver receiver=call.target();
  soot.Local baseLocal;
  if ((receiver instanceof polyglot.ast.Special) && (((polyglot.ast.Special)receiver).kind() == polyglot.ast.Special.SUPER) && (((polyglot.ast.Special)receiver).qualifier() != null)) {
    baseLocal=getSpecialSuperQualifierLocal(call);
    return baseLocal;
  }
  baseLocal=(soot.Local)getBaseLocal(receiver);
  soot.Type sootRecType=Util.getSootType(receiver.type());
  soot.SootClass receiverTypeClass=soot.Scene.v().getSootClass("String_Node_Str");
  if (sootRecType instanceof soot.RefType) {
    receiverTypeClass=((soot.RefType)sootRecType).getSootClass();
  }
  polyglot.types.MethodInstance methodInstance=call.methodInstance();
  soot.Type sootRetType=Util.getSootType(methodInstance.returnType());
  ArrayList sootParamsTypes=getSootParamsTypes(call);
  ArrayList sootParams=getSootParams(call);
  soot.SootMethodRef callMethod=soot.Scene.v().makeMethodRef(receiverTypeClass,methodInstance.name(),sootParamsTypes,sootRetType,methodInstance.flags().isStatic());
  if (receiverTypeClass.isInterface()) {
    callMethod=callMethod.resolve().makeRef();
  }
  boolean isPrivateAccess=false;
  if (call.methodInstance().flags().isPrivate() && !Util.getSootType(call.methodInstance().container()).equals(body.getMethod().getDeclaringClass().getType())) {
    callMethod=addGetMethodAccessMeth(((soot.RefType)Util.getSootType(call.methodInstance().container())).getSootClass(),call).makeRef();
    if (!call.methodInstance().flags().isStatic()) {
      sootParams.add(baseLocal);
    }
    isPrivateAccess=true;
  }
  soot.jimple.InvokeExpr invokeExpr;
  if (isPrivateAccess) {
    invokeExpr=soot.jimple.Jimple.v().newStaticInvokeExpr(callMethod,sootParams);
  }
 else   if (soot.Modifier.isInterface(receiverTypeClass.getModifiers()) && methodInstance.flags().isAbstract()) {
    invokeExpr=soot.jimple.Jimple.v().newInterfaceInvokeExpr(baseLocal,callMethod,sootParams);
  }
 else   if (methodInstance.flags().isStatic()) {
    invokeExpr=soot.jimple.Jimple.v().newStaticInvokeExpr(callMethod,sootParams);
  }
 else   if (methodInstance.flags().isPrivate()) {
    invokeExpr=soot.jimple.Jimple.v().newSpecialInvokeExpr(baseLocal,callMethod,sootParams);
  }
 else   if ((receiver instanceof polyglot.ast.Special) && (((polyglot.ast.Special)receiver).kind() == polyglot.ast.Special.SUPER)) {
    invokeExpr=soot.jimple.Jimple.v().newSpecialInvokeExpr(baseLocal,callMethod,sootParams);
  }
 else {
    invokeExpr=soot.jimple.Jimple.v().newVirtualInvokeExpr(baseLocal,callMethod,sootParams);
  }
  int numParams=0;
  Iterator callParamsIt=call.arguments().iterator();
  while (callParamsIt.hasNext()) {
    Util.addLnPosTags(invokeExpr.getArgBox(numParams),((polyglot.ast.Expr)callParamsIt.next()).position());
    numParams++;
  }
  if (invokeExpr instanceof soot.jimple.InstanceInvokeExpr) {
    Util.addLnPosTags(((soot.jimple.InstanceInvokeExpr)invokeExpr).getBaseBox(),call.target().position());
  }
  if (invokeExpr.getMethodRef().returnType().equals(soot.VoidType.v())) {
    soot.jimple.Stmt invoke=soot.jimple.Jimple.v().newInvokeStmt(invokeExpr);
    body.getUnits().add(invoke);
    Util.addLnPosTags(invoke,call.position());
    return null;
  }
 else {
    soot.Local retLocal=lg.generateLocal(invokeExpr.getMethodRef().returnType());
    soot.jimple.Stmt assignStmt=soot.jimple.Jimple.v().newAssignStmt(retLocal,invokeExpr);
    body.getUnits().add(assignStmt);
    Util.addLnPosTags(assignStmt,call.position());
    return retLocal;
  }
}

Fixed version (ground truth):
/** 
 * Call Expression Creation
 */
private soot.Local getCallLocal(polyglot.ast.Call call){
  String name=call.name();
  polyglot.ast.Receiver receiver=call.target();
  soot.Local baseLocal;
  if ((receiver instanceof polyglot.ast.Special) && (((polyglot.ast.Special)receiver).kind() == polyglot.ast.Special.SUPER) && (((polyglot.ast.Special)receiver).qualifier() != null)) {
    baseLocal=getSpecialSuperQualifierLocal(call);
    return baseLocal;
  }
  baseLocal=(soot.Local)getBaseLocal(receiver);
  soot.Type sootRecType=Util.getSootType(receiver.type());
  soot.SootClass receiverTypeClass=soot.Scene.v().getSootClass("String_Node_Str");
  if (sootRecType instanceof soot.RefType) {
    receiverTypeClass=((soot.RefType)sootRecType).getSootClass();
  }
  polyglot.types.MethodInstance methodInstance=call.methodInstance();
  soot.Type sootRetType=Util.getSootType(methodInstance.returnType());
  ArrayList sootParamsTypes=getSootParamsTypes(call);
  ArrayList sootParams=getSootParams(call);
  soot.SootMethodRef callMethod=soot.Scene.v().makeMethodRef(receiverTypeClass,methodInstance.name(),sootParamsTypes,sootRetType,methodInstance.flags().isStatic());
  if (receiverTypeClass.isInterface()) {
    callMethod=callMethod.resolve().makeRef();
  }
  boolean isPrivateAccess=false;
  if (call.methodInstance().flags().isPrivate() && !Util.getSootType(call.methodInstance().container()).equals(body.getMethod().getDeclaringClass().getType())) {
    callMethod=addGetMethodAccessMeth(((soot.RefType)Util.getSootType(call.methodInstance().container())).getSootClass(),call).makeRef();
    if (!call.methodInstance().flags().isStatic()) {
      if (body.getMethod().getDeclaringClass().declaresFieldByName("String_Node_Str")) {
        sootParams.add(0,getThis(Util.getSootType(call.methodInstance().container())));
      }
 else {
        sootParams.add(0,baseLocal);
      }
    }
    isPrivateAccess=true;
  }
  soot.jimple.InvokeExpr invokeExpr;
  if (isPrivateAccess) {
    invokeExpr=soot.jimple.Jimple.v().newStaticInvokeExpr(callMethod,sootParams);
  }
 else   if (soot.Modifier.isInterface(receiverTypeClass.getModifiers()) && methodInstance.flags().isAbstract()) {
    invokeExpr=soot.jimple.Jimple.v().newInterfaceInvokeExpr(baseLocal,callMethod,sootParams);
  }
 else   if (methodInstance.flags().isStatic()) {
    invokeExpr=soot.jimple.Jimple.v().newStaticInvokeExpr(callMethod,sootParams);
  }
 else   if (methodInstance.flags().isPrivate()) {
    invokeExpr=soot.jimple.Jimple.v().newSpecialInvokeExpr(baseLocal,callMethod,sootParams);
  }
 else   if ((receiver instanceof polyglot.ast.Special) && (((polyglot.ast.Special)receiver).kind() == polyglot.ast.Special.SUPER)) {
    invokeExpr=soot.jimple.Jimple.v().newSpecialInvokeExpr(baseLocal,callMethod,sootParams);
  }
 else {
    invokeExpr=soot.jimple.Jimple.v().newVirtualInvokeExpr(baseLocal,callMethod,sootParams);
  }
  int numParams=0;
  Iterator callParamsIt=call.arguments().iterator();
  while (callParamsIt.hasNext()) {
    Util.addLnPosTags(invokeExpr.getArgBox(numParams),((polyglot.ast.Expr)callParamsIt.next()).position());
    numParams++;
  }
  if (invokeExpr instanceof soot.jimple.InstanceInvokeExpr) {
    Util.addLnPosTags(((soot.jimple.InstanceInvokeExpr)invokeExpr).getBaseBox(),call.target().position());
  }
  if (invokeExpr.getMethodRef().returnType().equals(soot.VoidType.v())) {
    soot.jimple.Stmt invoke=soot.jimple.Jimple.v().newInvokeStmt(invokeExpr);
    body.getUnits().add(invoke);
    Util.addLnPosTags(invoke,call.position());
    return null;
  }
 else {
    soot.Local retLocal=lg.generateLocal(invokeExpr.getMethodRef().returnType());
    soot.jimple.Stmt assignStmt=soot.jimple.Jimple.v().newAssignStmt(retLocal,invokeExpr);
    body.getUnits().add(assignStmt);
    Util.addLnPosTags(assignStmt,call.position());
    return retLocal;
  }
}