Program: 168768
Project: 168768
Buggy source:
private CtConstructor createConstructor(EntityViewManager evm,ManagedViewType<?> managedViewType,CtClass cc,int superConstructorStart,int superConstructorEnd,CtField[] attributeFields,CtClass[] attributeTypes,CtField initialStateField,CtField mutableStateField,AbstractMethodAttribute<?,?>[] mutableAttributes,int mutableAttributeCount,ConstructorKind kind,CtField idField,boolean unsafe) throws CannotCompileException, NotFoundException, BadBytecode {
  CtClass[] parameterTypes;
  if (kind == ConstructorKind.CREATE) {
    parameterTypes=new CtClass[]{};
  }
 else {
    parameterTypes=attributeTypes;
  }
  CtConstructor ctConstructor=new CtConstructor(parameterTypes,cc);
  ctConstructor.setModifiers(Modifier.PUBLIC);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  if (unsafe) {
    renderFieldInitialization(evm,managedViewType,attributeFields,initialStateField,mutableStateField,mutableAttributes,mutableAttributeCount,kind,sb,idField);
    renderSuperCall(cc,superConstructorStart,superConstructorEnd,sb);
  }
 else {
    renderSuperCall(cc,superConstructorStart,superConstructorEnd,sb);
    renderFieldInitialization(evm,managedViewType,attributeFields,initialStateField,mutableStateField,mutableAttributes,mutableAttributeCount,kind,sb,idField);
  }
  renderDirtyTrackerRegistration(attributeFields,mutableStateField,mutableAttributes,kind,sb);
  Method postCreateMethod=null;
  if (kind == ConstructorKind.CREATE && managedViewType.getPostCreateMethod() != null) {
    postCreateMethod=managedViewType.getPostCreateMethod();
    if (!managedViewType.getJavaType().isInterface()) {
      if (postCreateMethod.getParameterTypes().length == 1) {
        sb.append("String_Node_Str").append(postCreateMethod.getName()).append("String_Node_Str").append(cc.getName()).append("String_Node_Str");
      }
 else {
        sb.append("String_Node_Str").append(postCreateMethod.getName()).append("String_Node_Str");
      }
      postCreateMethod=null;
    }
  }
  sb.append("String_Node_Str");
  if (unsafe) {
    compileUnsafe(ctConstructor,sb.toString());
  }
 else {
    ctConstructor.setBody(sb.toString());
  }
  if (postCreateMethod != null) {
    CodeAttribute codeAttribute=ctConstructor.getMethodInfo().getCodeAttribute();
    Bytecode bc=new Bytecode(codeAttribute.getConstPool(),codeAttribute.getMaxStack(),codeAttribute.getMaxLocals());
    byte[] instructions=codeAttribute.getCode();
    for (int i=0; i < codeAttribute.getCodeLength() - 1; i++) {
      bc.add(instructions[i]);
    }
    String postCreateMethodDescriptor;
    bc.addAload(0);
    if (postCreateMethod.getParameterTypes().length == 1) {
      bc.addAload(1);
      postCreateMethodDescriptor="String_Node_Str" + Descriptor.toJvmName(EntityViewManager.class.getName()) + "String_Node_Str";
    }
 else {
      postCreateMethodDescriptor="String_Node_Str";
    }
    bc.addInvokespecial(managedViewType.getJavaType().getName(),postCreateMethod.getName(),postCreateMethodDescriptor);
    bc.addReturn(null);
    CodeAttribute newCodeAttribute=bc.toCodeAttribute();
    newCodeAttribute.setAttribute((StackMap)codeAttribute.getAttribute(StackMap.tag));
    newCodeAttribute.setAttribute((StackMapTable)codeAttribute.getAttribute(StackMapTable.tag));
    ctConstructor.getMethodInfo().setCodeAttribute(bc.toCodeAttribute());
  }
  return ctConstructor;
}

Fixed version (ground truth):
private CtConstructor createConstructor(EntityViewManager evm,ManagedViewType<?> managedViewType,CtClass cc,int superConstructorStart,int superConstructorEnd,CtField[] attributeFields,CtClass[] attributeTypes,CtField initialStateField,CtField mutableStateField,AbstractMethodAttribute<?,?>[] mutableAttributes,int mutableAttributeCount,ConstructorKind kind,CtField idField,boolean unsafe) throws CannotCompileException, NotFoundException, BadBytecode {
  CtClass[] parameterTypes;
  if (kind == ConstructorKind.CREATE) {
    parameterTypes=new CtClass[]{};
  }
 else {
    parameterTypes=attributeTypes;
  }
  CtConstructor ctConstructor=new CtConstructor(parameterTypes,cc);
  ctConstructor.setModifiers(Modifier.PUBLIC);
  StringBuilder sb=new StringBuilder();
  sb.append("String_Node_Str");
  if (unsafe) {
    renderFieldInitialization(evm,managedViewType,attributeFields,initialStateField,mutableStateField,mutableAttributes,mutableAttributeCount,kind,sb,idField);
    renderSuperCall(cc,superConstructorStart,superConstructorEnd,sb);
  }
 else {
    renderSuperCall(cc,superConstructorStart,superConstructorEnd,sb);
    renderFieldInitialization(evm,managedViewType,attributeFields,initialStateField,mutableStateField,mutableAttributes,mutableAttributeCount,kind,sb,idField);
  }
  renderDirtyTrackerRegistration(attributeFields,mutableStateField,mutableAttributes,kind,sb);
  Method postCreateMethod=null;
  if (kind == ConstructorKind.CREATE && managedViewType.getPostCreateMethod() != null) {
    postCreateMethod=managedViewType.getPostCreateMethod();
    if (!managedViewType.getJavaType().isInterface()) {
      if (postCreateMethod.getParameterTypes().length == 1) {
        sb.append("String_Node_Str").append(postCreateMethod.getName()).append("String_Node_Str").append(cc.getName()).append("String_Node_Str");
      }
 else {
        sb.append("String_Node_Str").append(postCreateMethod.getName()).append("String_Node_Str");
      }
      postCreateMethod=null;
    }
  }
  sb.append("String_Node_Str");
  if (unsafe) {
    compileUnsafe(ctConstructor,sb.toString());
  }
 else {
    ctConstructor.setBody(sb.toString());
  }
  if (postCreateMethod != null) {
    CodeAttribute codeAttribute=ctConstructor.getMethodInfo().getCodeAttribute();
    Bytecode bc=new Bytecode(codeAttribute.getConstPool(),codeAttribute.getMaxStack(),codeAttribute.getMaxLocals());
    byte[] instructions=codeAttribute.getCode();
    for (int i=0; i < codeAttribute.getCodeLength() - 1; i++) {
      bc.add(instructions[i]);
    }
    String postCreateMethodDescriptor;
    bc.addAload(0);
    if (postCreateMethod.getParameterTypes().length == 1) {
      bc.addGetstatic(cc,"String_Node_Str",Descriptor.of(EntityViewManager.class.getName()));
      postCreateMethodDescriptor="String_Node_Str" + Descriptor.toJvmName(EntityViewManager.class.getName()) + "String_Node_Str";
    }
 else {
      postCreateMethodDescriptor="String_Node_Str";
    }
    bc.addInvokespecial(managedViewType.getJavaType().getName(),postCreateMethod.getName(),postCreateMethodDescriptor);
    bc.addReturn(null);
    CodeAttribute newCodeAttribute=bc.toCodeAttribute();
    newCodeAttribute.setAttribute((StackMap)codeAttribute.getAttribute(StackMap.tag));
    newCodeAttribute.setAttribute((StackMapTable)codeAttribute.getAttribute(StackMapTable.tag));
    ctConstructor.getMethodInfo().setCodeAttribute(bc.toCodeAttribute());
  }
  return ctConstructor;
}