Program: 88527
Project: 88527
Buggy source:
/** 
 * create ArrayInit given init and the array local
 */
private soot.Local getArrayInitLocal(polyglot.ast.ArrayInit arrInit,polyglot.types.Type lhsType){
  soot.Local local=generateLocal(lhsType);
  soot.jimple.NewArrayExpr arrExpr=soot.jimple.Jimple.v().newNewArrayExpr(((soot.ArrayType)local.getType()).getElementType(),soot.jimple.IntConstant.v(arrInit.elements().size()));
  soot.jimple.Stmt assign=soot.jimple.Jimple.v().newAssignStmt(local,arrExpr);
  body.getUnits().add(assign);
  Util.addLnPosTags(assign,arrInit.position());
  Iterator it=arrInit.elements().iterator();
  int index=0;
  while (it.hasNext()) {
    polyglot.ast.Expr elemExpr=(polyglot.ast.Expr)it.next();
    soot.Value elem;
    if (elemExpr instanceof polyglot.ast.ArrayInit) {
      if (((polyglot.ast.ArrayInit)elemExpr).type() instanceof polyglot.types.NullType) {
        if (lhsType instanceof polyglot.types.ArrayType) {
          elem=getArrayInitLocal((polyglot.ast.ArrayInit)elemExpr,((polyglot.types.ArrayType)lhsType).base());
        }
 else {
          elem=getArrayInitLocal((polyglot.ast.ArrayInit)elemExpr,lhsType);
        }
      }
 else {
        elem=getArrayInitLocal((polyglot.ast.ArrayInit)elemExpr,((polyglot.ast.ArrayInit)elemExpr).type());
      }
    }
 else {
      elem=base().createExpr(elemExpr);
    }
    soot.jimple.ArrayRef arrRef=soot.jimple.Jimple.v().newArrayRef(local,soot.jimple.IntConstant.v(index));
    soot.jimple.AssignStmt elemAssign=soot.jimple.Jimple.v().newAssignStmt(arrRef,elem);
    body.getUnits().add(elemAssign);
    Util.addLnPosTags(elemAssign,elemExpr.position());
    Util.addLnPosTags(elemAssign.getRightOpBox(),elemExpr.position());
    index++;
  }
  return local;
}

Fixed version (ground truth):
/** 
 * create ArrayInit given init and the array local
 */
private soot.Local getArrayInitLocal(polyglot.ast.ArrayInit arrInit,polyglot.types.Type lhsType){
  soot.Local local=generateLocal(lhsType);
  soot.jimple.NewArrayExpr arrExpr=soot.jimple.Jimple.v().newNewArrayExpr(((soot.ArrayType)local.getType()).getElementType(),soot.jimple.IntConstant.v(arrInit.elements().size()));
  soot.jimple.Stmt assign=soot.jimple.Jimple.v().newAssignStmt(local,arrExpr);
  body.getUnits().add(assign);
  Util.addLnPosTags(assign,arrInit.position());
  Iterator it=arrInit.elements().iterator();
  int index=0;
  while (it.hasNext()) {
    polyglot.ast.Expr elemExpr=(polyglot.ast.Expr)it.next();
    soot.Value elem;
    if (elemExpr instanceof polyglot.ast.ArrayInit) {
      if (((polyglot.ast.ArrayInit)elemExpr).type() instanceof polyglot.types.NullType) {
        if (lhsType instanceof polyglot.types.ArrayType) {
          elem=getArrayInitLocal((polyglot.ast.ArrayInit)elemExpr,((polyglot.types.ArrayType)lhsType).base());
        }
 else {
          elem=getArrayInitLocal((polyglot.ast.ArrayInit)elemExpr,lhsType);
        }
      }
 else {
        elem=getArrayInitLocal((polyglot.ast.ArrayInit)elemExpr,((polyglot.types.ArrayType)lhsType).base());
      }
    }
 else {
      elem=base().createExpr(elemExpr);
    }
    soot.jimple.ArrayRef arrRef=soot.jimple.Jimple.v().newArrayRef(local,soot.jimple.IntConstant.v(index));
    soot.jimple.AssignStmt elemAssign=soot.jimple.Jimple.v().newAssignStmt(arrRef,elem);
    body.getUnits().add(elemAssign);
    Util.addLnPosTags(elemAssign,elemExpr.position());
    Util.addLnPosTags(elemAssign.getRightOpBox(),elemExpr.position());
    index++;
  }
  return local;
}