Program: 25720
Project: 25720
Buggy source:
private void replace2(String statement) throws CompileError, NotFoundException, BadBytecode, CannotCompileException {
  ConstPool constPool=getConstPool();
  int pos=currentPos;
  CtClass retType;
  int codeLength;
  int index=0;
  int dim=1;
  String desc;
  if (opcode == Opcode.NEWARRAY) {
    index=iterator.byteAt(currentPos + 1);
    CtPrimitiveType cpt=(CtPrimitiveType)getPrimitiveType(index);
    desc="String_Node_Str" + cpt.getDescriptor();
    codeLength=2;
  }
 else   if (opcode == Opcode.ANEWARRAY) {
    index=iterator.u16bitAt(pos + 1);
    desc=constPool.getClassInfo(index);
    if (desc.startsWith("String_Node_Str"))     desc="String_Node_Str" + desc;
 else     desc="String_Node_Str" + desc + "String_Node_Str";
    codeLength=3;
  }
 else   if (opcode == Opcode.MULTIANEWARRAY) {
    index=iterator.u16bitAt(currentPos + 1);
    desc=constPool.getClassInfo(index);
    dim=iterator.byteAt(currentPos + 3);
    codeLength=4;
  }
 else   throw new RuntimeException("String_Node_Str" + opcode);
  retType=Descriptor.toCtClass(desc,thisClass.getClassPool());
  Javac jc=new Javac(thisClass);
  CodeAttribute ca=iterator.get();
  CtClass[] params=new CtClass[dim];
  for (int i=0; i < dim; ++i)   params[i]=CtClass.intType;
  int paramVar=ca.getMaxLocals();
  jc.recordParams(javaLangObject,params,true,paramVar,withinStatic());
  checkResultValue(retType,statement);
  int retVar=jc.recordReturnType(retType,true);
  jc.recordProceed(new ProceedForArray(retType,opcode,index,dim));
  Bytecode bytecode=jc.getBytecode();
  storeStack(params,true,paramVar,bytecode);
  jc.recordLocalVariables(ca,pos);
  bytecode.addOpcode(ACONST_NULL);
  bytecode.addAstore(retVar);
  jc.compileStmnt(statement);
  bytecode.addAload(retVar);
  replace0(pos,bytecode,codeLength);
}

Fixed version (ground truth):
private void replace2(String statement) throws CompileError, NotFoundException, BadBytecode, CannotCompileException {
  thisClass.getClassFile();
  ConstPool constPool=getConstPool();
  int pos=currentPos;
  CtClass retType;
  int codeLength;
  int index=0;
  int dim=1;
  String desc;
  if (opcode == Opcode.NEWARRAY) {
    index=iterator.byteAt(currentPos + 1);
    CtPrimitiveType cpt=(CtPrimitiveType)getPrimitiveType(index);
    desc="String_Node_Str" + cpt.getDescriptor();
    codeLength=2;
  }
 else   if (opcode == Opcode.ANEWARRAY) {
    index=iterator.u16bitAt(pos + 1);
    desc=constPool.getClassInfo(index);
    if (desc.startsWith("String_Node_Str"))     desc="String_Node_Str" + desc;
 else     desc="String_Node_Str" + desc + "String_Node_Str";
    codeLength=3;
  }
 else   if (opcode == Opcode.MULTIANEWARRAY) {
    index=iterator.u16bitAt(currentPos + 1);
    desc=constPool.getClassInfo(index);
    dim=iterator.byteAt(currentPos + 3);
    codeLength=4;
  }
 else   throw new RuntimeException("String_Node_Str" + opcode);
  retType=Descriptor.toCtClass(desc,thisClass.getClassPool());
  Javac jc=new Javac(thisClass);
  CodeAttribute ca=iterator.get();
  CtClass[] params=new CtClass[dim];
  for (int i=0; i < dim; ++i)   params[i]=CtClass.intType;
  int paramVar=ca.getMaxLocals();
  jc.recordParams(javaLangObject,params,true,paramVar,withinStatic());
  checkResultValue(retType,statement);
  int retVar=jc.recordReturnType(retType,true);
  jc.recordProceed(new ProceedForArray(retType,opcode,index,dim));
  Bytecode bytecode=jc.getBytecode();
  storeStack(params,true,paramVar,bytecode);
  jc.recordLocalVariables(ca,pos);
  bytecode.addOpcode(ACONST_NULL);
  bytecode.addAstore(retVar);
  jc.compileStmnt(statement);
  bytecode.addAload(retVar);
  replace0(pos,bytecode,codeLength);
}