Program: 27014
Project: 27014
Buggy source:
private void emitColumnAssignment(JavaWriter javaWriter,String valueStatement) throws IOException {
  boolean isContainerFieldDefinition=accessModel.isModelContainerAdapter;
  boolean isWritingForContainers=accessModel.fieldIsAModelContainer;
  AdapterQueryBuilder queryBuilder=new AdapterQueryBuilder().appendVariable(isContainerFieldDefinition);
  if (isWritingForContainers) {
    queryBuilder.append("String_Node_Str").append(accessModel.columnName);
  }
  if (isContainerFieldDefinition) {
    queryBuilder.appendPut(accessModel.containerKeyName);
  }
 else   if (isWritingForContainers) {
    queryBuilder.appendPut(accessModel.getReferencedColumnFieldName());
  }
 else {
    queryBuilder.append("String_Node_Str").append(accessModel.getSetterReferenceColumnFieldName());
    if (!accessModel.isPrivate) {
      queryBuilder.appendSpaceSeparated("String_Node_Str");
    }
  }
  if (accessModel.isEnum) {
    if (!valueStatement.equals("String_Node_Str")) {
      queryBuilder.append(accessModel.castedClass).append("String_Node_Str");
    }
  }
 else {
    if (accessModel.requiresTypeConverter && !isContainerFieldDefinition) {
      queryBuilder.appendTypeConverter(accessModel.columnFieldBoxedType,accessModel.columnFieldBoxedType,true);
    }
 else     if (accessModel.isABlob) {
      queryBuilder.append(String.format("String_Node_Str",Blob.class.getName()));
    }
  }
  queryBuilder.append(valueStatement);
  if (accessModel.requiresTypeConverter && !isContainerFieldDefinition && !accessModel.isEnum || (accessModel.isEnum && isContainerFieldDefinition && !valueStatement.equals("String_Node_Str"))) {
    queryBuilder.append("String_Node_Str");
  }
 else   if (isContainerFieldDefinition || isWritingForContainers || accessModel.isABlob|| (accessModel.isEnum && !valueStatement.equals("String_Node_Str"))) {
    queryBuilder.append("String_Node_Str");
  }
  if (accessModel.isPrivate && !isContainerFieldDefinition) {
    queryBuilder.append("String_Node_Str");
  }
  javaWriter.emitStatement(queryBuilder.toString());
}

Fixed version (ground truth):
private void emitColumnAssignment(JavaWriter javaWriter,String valueStatement) throws IOException {
  boolean isContainerFieldDefinition=accessModel.isModelContainerAdapter;
  boolean fieldIsAModelContainer=accessModel.fieldIsAModelContainer;
  boolean isNull=valueStatement.equals("String_Node_Str");
  AdapterQueryBuilder queryBuilder=new AdapterQueryBuilder();
  if (isModelContainerAdapter) {
    if (accessModel.isForeignKeyField) {
      queryBuilder.append(modelContainerName);
    }
 else {
      queryBuilder.append(ModelUtils.getVariable(true));
    }
  }
 else {
    queryBuilder.appendVariable(isContainerFieldDefinition);
  }
  if (fieldIsAModelContainer && isModelContainerAdapter) {
    queryBuilder.appendPut(accessModel.getReferencedColumnFieldName());
  }
 else   if (fieldIsAModelContainer) {
    queryBuilder.append("String_Node_Str").append(accessModel.columnFieldName).appendPut(accessModel.getReferencedColumnFieldName());
  }
 else   if (isModelContainerAdapter && accessModel.isForeignKeyField) {
    queryBuilder.appendPut(accessModel.getReferencedColumnFieldName());
  }
  if (isContainerFieldDefinition) {
    queryBuilder.appendPut(accessModel.containerKeyName);
  }
 else   if (!fieldIsAModelContainer && !isModelContainerAdapter) {
    queryBuilder.append("String_Node_Str").append(accessModel.getSetterReferenceColumnFieldName());
    if (!accessModel.isPrivate) {
      queryBuilder.appendSpaceSeparated("String_Node_Str");
    }
  }
  if (accessModel.isEnum) {
    if (!isNull) {
      queryBuilder.append(accessModel.castedClass).append("String_Node_Str");
    }
  }
 else {
    if (accessModel.requiresTypeConverter && !isNull) {
      queryBuilder.appendTypeConverter(accessModel.columnFieldBoxedType,accessModel.columnFieldBoxedType,true);
    }
 else     if (accessModel.isABlob) {
      queryBuilder.append(String.format("String_Node_Str",Blob.class.getName()));
    }
  }
  queryBuilder.append(valueStatement);
  if (accessModel.requiresTypeConverter && !isNull && !accessModel.isEnum || (accessModel.isEnum && isContainerFieldDefinition && !isNull)) {
    queryBuilder.append("String_Node_Str");
  }
 else   if (isModelContainerAdapter || isContainerFieldDefinition || fieldIsAModelContainer|| accessModel.isABlob|| (accessModel.isEnum && !isNull)) {
    queryBuilder.append("String_Node_Str");
  }
  if (accessModel.isPrivate && !isContainerFieldDefinition) {
    queryBuilder.append("String_Node_Str");
  }
  if (accessModel.requiresTypeConverter && !accessModel.isEnum() && isModelContainerAdapter&& !isNull) {
    queryBuilder.append("String_Node_Str");
  }
  javaWriter.emitStatement(queryBuilder.toString());
}