Program: 66805
Project: 66805
Buggy source:
/** 
 * Add an internal empty constructor, and new method. This is used to avoid unnecessary initialization and avoid reflection. public void _persistence_new(PersistenceObject factory) { return new ClassType(factory); } public ClassType(PersistenceObject factory) { super(); }
 */
public void addPersistenceNew(ClassDetails classDetails){
  CodeVisitor cv_new=cv.visitMethod(ACC_PUBLIC,"String_Node_Str","String_Node_Str" + PERSISTENCE_OBJECT_SIGNATURE + "String_Node_Str",null,null);
  cv_new.visitTypeInsn(NEW,classDetails.getClassName());
  cv_new.visitInsn(DUP);
  cv_new.visitVarInsn(ALOAD,1);
  cv_new.visitMethodInsn(INVOKESPECIAL,classDetails.getClassName(),"String_Node_Str","String_Node_Str" + PERSISTENCE_OBJECT_SIGNATURE + "String_Node_Str");
  cv_new.visitInsn(ARETURN);
  cv_new.visitMaxs(0,0);
  CodeVisitor cv_constructor=cv.visitMethod(ACC_PUBLIC,"String_Node_Str","String_Node_Str" + PERSISTENCE_OBJECT_SIGNATURE + "String_Node_Str",null,null);
  cv_constructor.visitVarInsn(ALOAD,0);
  if (classDetails.getSuperClassDetails() == null) {
    cv_constructor.visitMethodInsn(INVOKESPECIAL,classDetails.getSuperClassName(),"String_Node_Str","String_Node_Str");
  }
 else {
    cv_constructor.visitVarInsn(ALOAD,1);
    cv_constructor.visitMethodInsn(INVOKESPECIAL,classDetails.getSuperClassName(),"String_Node_Str","String_Node_Str" + PERSISTENCE_OBJECT_SIGNATURE + "String_Node_Str");
  }
  cv_constructor.visitInsn(RETURN);
  cv_constructor.visitMaxs(0,0);
}

Fixed version (ground truth):
/** 
 * Add an internal empty constructor, and new method. This is used to avoid unnecessary initialization and avoid reflection. public void _persistence_new(PersistenceObject factory) { return new ClassType(factory); } public ClassType(PersistenceObject factory) { super(); }
 */
public void addPersistenceNew(ClassDetails classDetails){
  CodeVisitor cv_new=cv.visitMethod(ACC_PUBLIC,"String_Node_Str","String_Node_Str" + PERSISTENCE_OBJECT_SIGNATURE + "String_Node_Str",null,null);
  cv_new.visitTypeInsn(NEW,classDetails.getClassName());
  cv_new.visitInsn(DUP);
  if (!classDetails.canWeaveConstructorOptimization()) {
    cv_new.visitMethodInsn(INVOKESPECIAL,classDetails.getClassName(),"String_Node_Str","String_Node_Str");
    cv_new.visitInsn(ARETURN);
    cv_new.visitMaxs(0,0);
    return;
  }
 else {
    cv_new.visitVarInsn(ALOAD,1);
    cv_new.visitMethodInsn(INVOKESPECIAL,classDetails.getClassName(),"String_Node_Str","String_Node_Str" + PERSISTENCE_OBJECT_SIGNATURE + "String_Node_Str");
  }
  cv_new.visitInsn(ARETURN);
  cv_new.visitMaxs(0,0);
  CodeVisitor cv_constructor=cv.visitMethod(ACC_PUBLIC,"String_Node_Str","String_Node_Str" + PERSISTENCE_OBJECT_SIGNATURE + "String_Node_Str",null,null);
  cv_constructor.visitVarInsn(ALOAD,0);
  if (classDetails.getSuperClassDetails() == null) {
    cv_constructor.visitMethodInsn(INVOKESPECIAL,classDetails.getSuperClassName(),"String_Node_Str","String_Node_Str");
  }
 else {
    cv_constructor.visitVarInsn(ALOAD,1);
    cv_constructor.visitMethodInsn(INVOKESPECIAL,classDetails.getSuperClassName(),"String_Node_Str","String_Node_Str" + PERSISTENCE_OBJECT_SIGNATURE + "String_Node_Str");
  }
  cv_constructor.visitInsn(RETURN);
  cv_constructor.visitMaxs(0,0);
}