Program: 25787
Project: 25787
Buggy source:
/** 
 * Adds a catch clause that handles an exception thrown in the body.  The catch clause must end with a return or throw statement.
 * @param src       the source code representing the catch clause.It must be a single statement or block.
 * @param exceptionType     the type of the exception handled by thecatch clause.
 * @param exceptionName     the name of the variable containing thecaught exception, for example, <code>$e</code>.
 */
public void addCatch(String src,CtClass exceptionType,String exceptionName) throws CannotCompileException {
  declaringClass.checkModify();
  ConstPool cp=methodInfo.getConstPool();
  CodeAttribute ca=methodInfo.getCodeAttribute();
  CodeIterator iterator=ca.iterator();
  Bytecode b=new Bytecode(cp,ca.getMaxStack(),ca.getMaxLocals());
  b.setStackDepth(1);
  Javac jv=new Javac(b,declaringClass);
  try {
    jv.recordParams(getParameterTypes(),Modifier.isStatic(getModifiers()));
    int var=jv.recordVariable(exceptionType,exceptionName);
    b.addAstore(var);
    jv.compileStmnt(src);
    int stack=b.getMaxStack();
    int locals=b.getMaxLocals();
    if (stack > ca.getMaxStack())     ca.setMaxStack(stack);
    if (locals > ca.getMaxLocals())     ca.setMaxLocals(locals);
    int len=iterator.getCodeLength();
    int pos=iterator.append(b.get());
    ca.getExceptionTable().add(0,len,len,cp.addClassInfo(exceptionType));
    iterator.append(b.getExceptionTable(),pos);
  }
 catch (  NotFoundException e) {
    throw new CannotCompileException(e);
  }
catch (  CompileError e) {
    throw new CannotCompileException(e);
  }
}

Fixed version (ground truth):
/** 
 * Adds a catch clause that handles an exception thrown in the body.  The catch clause must end with a return or throw statement.
 * @param src       the source code representing the catch clause.It must be a single statement or block.
 * @param exceptionType     the type of the exception handled by thecatch clause.
 * @param exceptionName     the name of the variable containing thecaught exception, for example, <code>$e</code>.
 */
public void addCatch(String src,CtClass exceptionType,String exceptionName) throws CannotCompileException {
  declaringClass.checkModify();
  ConstPool cp=methodInfo.getConstPool();
  CodeAttribute ca=methodInfo.getCodeAttribute();
  CodeIterator iterator=ca.iterator();
  Bytecode b=new Bytecode(cp,ca.getMaxStack(),ca.getMaxLocals());
  b.setStackDepth(1);
  Javac jv=new Javac(b,declaringClass);
  try {
    jv.recordParams(getParameterTypes(),Modifier.isStatic(getModifiers()));
    int var=jv.recordVariable(exceptionType,exceptionName);
    b.addAstore(var);
    jv.compileStmnt(src);
    int stack=b.getMaxStack();
    int locals=b.getMaxLocals();
    if (stack > ca.getMaxStack())     ca.setMaxStack(stack);
    if (locals > ca.getMaxLocals())     ca.setMaxLocals(locals);
    int len=iterator.getCodeLength();
    int pos=iterator.append(b.get());
    ca.getExceptionTable().add(getStartPosOfBody(ca),len,len,cp.addClassInfo(exceptionType));
    iterator.append(b.getExceptionTable(),pos);
  }
 catch (  NotFoundException e) {
    throw new CannotCompileException(e);
  }
catch (  CompileError e) {
    throw new CannotCompileException(e);
  }
}