Program: 25721
Project: 25721
Buggy source:
/** 
 * Replaces the <tt>new</tt> expression with the bytecode derived from the given source text. <p>$0 is available but the value is null.
 * @param statement         a Java statement.
 */
public void replace(String statement) throws CannotCompileException {
  final int bytecodeSize=3;
  int pos=newPos;
  int newIndex=iterator.u16bitAt(pos + 1);
  int end=pos + canReplace();
  for (int i=pos; i < end; ++i)   iterator.writeByte(NOP,i);
  ConstPool constPool=getConstPool();
  pos=currentPos;
  int methodIndex=iterator.u16bitAt(pos + 1);
  String signature=constPool.getMethodrefType(methodIndex);
  Javac jc=new Javac(thisClass);
  ClassPool cp=thisClass.getClassPool();
  CodeAttribute ca=iterator.get();
  try {
    CtClass[] params=Descriptor.getParameterTypes(signature,cp);
    CtClass newType=cp.get(newTypeName);
    int paramVar=ca.getMaxLocals();
    jc.recordParams(newTypeName,params,true,paramVar,withinStatic());
    int retVar=jc.recordReturnType(newType,true);
    jc.recordProceed(new ProceedForNew(newType,newIndex,methodIndex));
    checkResultValue(newType,statement);
    Bytecode bytecode=jc.getBytecode();
    storeStack(params,true,paramVar,bytecode);
    jc.recordLocalVariables(ca,pos);
    bytecode.addConstZero(newType);
    bytecode.addStore(retVar,newType);
    jc.compileStmnt(statement);
    bytecode.addAload(retVar);
    replace0(pos,bytecode,bytecodeSize);
  }
 catch (  CompileError e) {
    throw new CannotCompileException(e);
  }
catch (  NotFoundException e) {
    throw new CannotCompileException(e);
  }
catch (  BadBytecode e) {
    throw new CannotCompileException("String_Node_Str");
  }
}

Fixed version (ground truth):
/** 
 * Replaces the <tt>new</tt> expression with the bytecode derived from the given source text. <p>$0 is available but the value is null.
 * @param statement         a Java statement.
 */
public void replace(String statement) throws CannotCompileException {
  thisClass.getClassFile();
  final int bytecodeSize=3;
  int pos=newPos;
  int newIndex=iterator.u16bitAt(pos + 1);
  int end=pos + canReplace();
  for (int i=pos; i < end; ++i)   iterator.writeByte(NOP,i);
  ConstPool constPool=getConstPool();
  pos=currentPos;
  int methodIndex=iterator.u16bitAt(pos + 1);
  String signature=constPool.getMethodrefType(methodIndex);
  Javac jc=new Javac(thisClass);
  ClassPool cp=thisClass.getClassPool();
  CodeAttribute ca=iterator.get();
  try {
    CtClass[] params=Descriptor.getParameterTypes(signature,cp);
    CtClass newType=cp.get(newTypeName);
    int paramVar=ca.getMaxLocals();
    jc.recordParams(newTypeName,params,true,paramVar,withinStatic());
    int retVar=jc.recordReturnType(newType,true);
    jc.recordProceed(new ProceedForNew(newType,newIndex,methodIndex));
    checkResultValue(newType,statement);
    Bytecode bytecode=jc.getBytecode();
    storeStack(params,true,paramVar,bytecode);
    jc.recordLocalVariables(ca,pos);
    bytecode.addConstZero(newType);
    bytecode.addStore(retVar,newType);
    jc.compileStmnt(statement);
    bytecode.addAload(retVar);
    replace0(pos,bytecode,bytecodeSize);
  }
 catch (  CompileError e) {
    throw new CannotCompileException(e);
  }
catch (  NotFoundException e) {
    throw new CannotCompileException(e);
  }
catch (  BadBytecode e) {
    throw new CannotCompileException("String_Node_Str");
  }
}