Program: 25786
Project: 25786
Buggy source:
/** 
 * Inserts bytecode at the beginning of the body. <p>If this object represents a constructor, the bytecode is inserted before a constructor in the super class or this class is called. Therefore, the inserted bytecode is subject to constraints described in Section 4.8.2 of The Java Virtual Machine Specification (2nd ed). For example, it cannot access instance fields or methods although it can access static fields and methods. Use <code>insertBeforeBody()</code> in <code>CtConstructor</code>.
 * @param src       the source code representing the inserted bytecode.It must be a single statement or block.
 * @see CtConstructor#insertBeforeBody(String)
 */
public void insertBefore(String src) throws CannotCompileException {
  declaringClass.checkModify();
  CodeAttribute ca=methodInfo.getCodeAttribute();
  if (ca == null)   throw new CannotCompileException("String_Node_Str");
  CodeIterator iterator=ca.iterator();
  Javac jv=new Javac(declaringClass);
  try {
    int nvars=jv.recordParams(getParameterTypes(),Modifier.isStatic(getModifiers()));
    jv.recordParamNames(ca,nvars);
    jv.compileStmnt(src);
    Bytecode b=jv.getBytecode();
    int stack=b.getMaxStack();
    int locals=b.getMaxLocals();
    if (stack > ca.getMaxStack())     ca.setMaxStack(stack);
    if (locals > ca.getMaxLocals())     ca.setMaxLocals(locals);
    int pos=iterator.insertEx(b.get());
    iterator.insert(b.getExceptionTable(),pos);
  }
 catch (  NotFoundException e) {
    throw new CannotCompileException(e);
  }
catch (  CompileError e) {
    throw new CannotCompileException(e);
  }
catch (  BadBytecode e) {
    throw new CannotCompileException(e);
  }
}

Fixed version (ground truth):
/** 
 * Inserts bytecode at the beginning of the body. <p>If this object represents a constructor, the bytecode is inserted before a constructor in the super class or this class is called. Therefore, the inserted bytecode is subject to constraints described in Section 4.8.2 of The Java Virtual Machine Specification (2nd ed). For example, it cannot access instance fields or methods although it can access static fields and methods. Use <code>insertBeforeBody()</code> in <code>CtConstructor</code>.
 * @param src       the source code representing the inserted bytecode.It must be a single statement or block.
 * @see CtConstructor#insertBeforeBody(String)
 */
public void insertBefore(String src) throws CannotCompileException {
  declaringClass.checkModify();
  CodeAttribute ca=methodInfo.getCodeAttribute();
  if (ca == null)   throw new CannotCompileException("String_Node_Str");
  CodeIterator iterator=ca.iterator();
  Javac jv=new Javac(declaringClass);
  try {
    int nvars=jv.recordParams(getParameterTypes(),Modifier.isStatic(getModifiers()));
    jv.recordParamNames(ca,nvars);
    jv.recordLocalVariables(ca,0);
    jv.compileStmnt(src);
    Bytecode b=jv.getBytecode();
    int stack=b.getMaxStack();
    int locals=b.getMaxLocals();
    if (stack > ca.getMaxStack())     ca.setMaxStack(stack);
    if (locals > ca.getMaxLocals())     ca.setMaxLocals(locals);
    int pos=iterator.insertEx(b.get());
    iterator.insert(b.getExceptionTable(),pos);
  }
 catch (  NotFoundException e) {
    throw new CannotCompileException(e);
  }
catch (  CompileError e) {
    throw new CannotCompileException(e);
  }
catch (  BadBytecode e) {
    throw new CannotCompileException(e);
  }
}