Program: 27013
Project: 27013
Buggy source:
public void writeLoadFromCursorDefinition(BaseTableDefinition tableDefinition,JavaWriter javaWriter,boolean isModelContainerAdapter) throws IOException {
  if (isForeignKey) {
    javaWriter.emitEmptyLine();
    javaWriter.emitSingleLineComment("String_Node_Str",columnFieldName);
    if (!fieldIsModelContainer && !isModelContainerAdapter && isModel) {
      ColumnAccessModel columnAccessModel=new ColumnAccessModel(manager,this,isModelContainerAdapter);
      for (      ForeignKeyReference foreignKeyReference : foreignKeyReferences) {
        javaWriter.emitStatement(ModelUtils.getColumnIndex(foreignKeyReference.columnName()));
      }
      ModelUtils.writeColumnIndexCheckers(javaWriter,foreignKeyReferences);
      MockConditionQueryBuilder conditionQueryBuilder=new MockConditionQueryBuilder().appendForeignKeyReferences(columnFieldType + tableDefinition.databaseWriter.classSeparator + TableDefinition.DBFLOW_TABLE_TAG,columnName,foreignKeyReferences);
      String rawConditionStatement=String.format("String_Node_Str",ModelUtils.getFieldClass(columnFieldType),conditionQueryBuilder);
      AdapterQueryBuilder adapterQueryBuilder=new AdapterQueryBuilder().appendVariable(false);
      adapterQueryBuilder.append("String_Node_Str").append(columnAccessModel.getSetterReferenceColumnFieldName());
      if (!columnAccessModel.isPrivate()) {
        adapterQueryBuilder.appendSpaceSeparated("String_Node_Str");
      }
      adapterQueryBuilder.append(rawConditionStatement);
      if (columnAccessModel.isPrivate()) {
        adapterQueryBuilder.append("String_Node_Str");
      }
      javaWriter.emitStatement(adapterQueryBuilder.getQuery());
      javaWriter.endControlFlow();
    }
 else {
      if (isModelContainerAdapter) {
        javaWriter.emitSingleLineComment("String_Node_Str");
      }
 else {
        javaWriter.emitSingleLineComment("String_Node_Str");
      }
      for (      ForeignKeyReference foreignKeyReference : foreignKeyReferences) {
        javaWriter.emitStatement(ModelUtils.getColumnIndex(foreignKeyReference.columnName()));
      }
      ModelUtils.writeColumnIndexCheckers(javaWriter,foreignKeyReferences);
      String modelContainerName="String_Node_Str";
      if (isModelContainerAdapter) {
        if (isModel) {
          modelContainerName=ModelUtils.getVariable(isModelContainerAdapter) + columnFieldName;
          javaWriter.emitStatement("String_Node_Str",modelContainerName,ModelUtils.getVariable(true),ModelUtils.getVariable(true),foreignKeyTableClassName);
        }
 else {
          modelContainerName=ModelUtils.getVariable(isModelContainerAdapter);
        }
      }
 else       if (fieldIsModelContainer) {
        AdapterQueryBuilder containerBuilder=new AdapterQueryBuilder().appendVariable(isModelContainerAdapter).append("String_Node_Str").append(columnFieldName).appendSpaceSeparated("String_Node_Str").append("String_Node_Str").append(columnFieldActualType).appendParenthesisEnclosed(ModelUtils.getFieldClass(columnFieldType));
        javaWriter.emitStatement(containerBuilder.getQuery());
      }
      for (      ForeignKeyReference foreignKeyReference : foreignKeyReferences) {
        ColumnAccessModel columnAccessModel=new ColumnAccessModel(this,foreignKeyReference);
        LoadFromCursorModel loadFromCursorModel=new LoadFromCursorModel(columnAccessModel);
        loadFromCursorModel.setIsNullable(isNullable());
        loadFromCursorModel.setModelContainerName(modelContainerName);
        loadFromCursorModel.setIsModelContainerAdapter(isModelContainerAdapter);
        loadFromCursorModel.write(javaWriter);
      }
      if (isModelContainerAdapter && isModel && fieldIsModelContainer) {
        javaWriter.emitStatement("String_Node_Str",ModelUtils.getVariable(true),columnFieldName,modelContainerName);
        javaWriter.nextControlFlow("String_Node_Str");
        javaWriter.emitStatement("String_Node_Str",ModelUtils.getVariable(true),columnFieldName);
      }
      javaWriter.endControlFlow();
    }
    javaWriter.emitSingleLineComment("String_Node_Str");
    javaWriter.emitEmptyLine();
  }
 else {
    ColumnAccessModel columnAccessModel=new ColumnAccessModel(manager,this,isModelContainerAdapter);
    LoadFromCursorModel loadFromCursorModel=new LoadFromCursorModel(columnAccessModel);
    loadFromCursorModel.setModelContainerName(columnName);
    loadFromCursorModel.setIsNullable(isNullable());
    loadFromCursorModel.writeSingleField(javaWriter);
  }
}

Fixed version (ground truth):
public void writeLoadFromCursorDefinition(BaseTableDefinition tableDefinition,JavaWriter javaWriter,boolean isModelContainerAdapter) throws IOException {
  if (isForeignKey) {
    javaWriter.emitEmptyLine();
    javaWriter.emitSingleLineComment("String_Node_Str",columnFieldName);
    if (!fieldIsModelContainer && !isModelContainerAdapter && isModel) {
      ColumnAccessModel columnAccessModel=new ColumnAccessModel(manager,this,isModelContainerAdapter);
      for (      ForeignKeyReference foreignKeyReference : foreignKeyReferences) {
        javaWriter.emitStatement(ModelUtils.getColumnIndex(foreignKeyReference.columnName()));
      }
      ModelUtils.writeColumnIndexCheckers(javaWriter,foreignKeyReferences);
      MockConditionQueryBuilder conditionQueryBuilder=new MockConditionQueryBuilder().appendForeignKeyReferences(columnFieldType + tableDefinition.databaseWriter.classSeparator + TableDefinition.DBFLOW_TABLE_TAG,columnName,foreignKeyReferences);
      String rawConditionStatement=String.format("String_Node_Str",ModelUtils.getFieldClass(columnFieldType),conditionQueryBuilder);
      AdapterQueryBuilder adapterQueryBuilder=new AdapterQueryBuilder().appendVariable(false);
      adapterQueryBuilder.append("String_Node_Str").append(columnAccessModel.getSetterReferenceColumnFieldName());
      if (!columnAccessModel.isPrivate()) {
        adapterQueryBuilder.appendSpaceSeparated("String_Node_Str");
      }
      adapterQueryBuilder.append(rawConditionStatement);
      if (columnAccessModel.isPrivate()) {
        adapterQueryBuilder.append("String_Node_Str");
      }
      javaWriter.emitStatement(adapterQueryBuilder.getQuery());
      javaWriter.endControlFlow();
    }
 else {
      if (isModelContainerAdapter) {
        javaWriter.emitSingleLineComment("String_Node_Str");
      }
 else {
        javaWriter.emitSingleLineComment("String_Node_Str");
      }
      for (      ForeignKeyReference foreignKeyReference : foreignKeyReferences) {
        javaWriter.emitStatement(ModelUtils.getColumnIndex(foreignKeyReference.columnName()));
      }
      ModelUtils.writeColumnIndexCheckers(javaWriter,foreignKeyReferences);
      String modelContainerName="String_Node_Str";
      if (isModelContainerAdapter) {
        if (isModel) {
          modelContainerName=ModelUtils.getVariable(isModelContainerAdapter) + columnFieldName;
          javaWriter.emitStatement("String_Node_Str",modelContainerName,ModelUtils.getVariable(true),ModelUtils.getVariable(true),foreignKeyTableClassName);
        }
 else {
          modelContainerName=ModelUtils.getVariable(isModelContainerAdapter);
        }
      }
 else       if (fieldIsModelContainer) {
        AdapterQueryBuilder containerBuilder=new AdapterQueryBuilder().appendVariable(isModelContainerAdapter).append("String_Node_Str").append(columnFieldName).appendSpaceSeparated("String_Node_Str").append("String_Node_Str").append(columnFieldActualType).appendParenthesisEnclosed(ModelUtils.getFieldClass(columnFieldType));
        javaWriter.emitStatement(containerBuilder.getQuery());
      }
      for (      ForeignKeyReference foreignKeyReference : foreignKeyReferences) {
        ColumnAccessModel columnAccessModel=new ColumnAccessModel(this,foreignKeyReference);
        LoadFromCursorModel loadFromCursorModel=new LoadFromCursorModel(columnAccessModel);
        loadFromCursorModel.setIsNullable(isNullable());
        loadFromCursorModel.setModelContainerName(modelContainerName);
        loadFromCursorModel.setIsModelContainerAdapter(isModelContainerAdapter);
        loadFromCursorModel.write(javaWriter);
      }
      if (isModelContainerAdapter && isModel) {
        javaWriter.emitStatement("String_Node_Str",ModelUtils.getVariable(true),columnFieldName,modelContainerName);
        javaWriter.nextControlFlow("String_Node_Str");
        javaWriter.emitStatement("String_Node_Str",ModelUtils.getVariable(true),columnFieldName);
      }
      javaWriter.endControlFlow();
    }
    javaWriter.emitSingleLineComment("String_Node_Str");
    javaWriter.emitEmptyLine();
  }
 else {
    ColumnAccessModel columnAccessModel=new ColumnAccessModel(manager,this,isModelContainerAdapter);
    LoadFromCursorModel loadFromCursorModel=new LoadFromCursorModel(columnAccessModel);
    loadFromCursorModel.setModelContainerName(columnName);
    loadFromCursorModel.setIsModelContainerAdapter(isModelContainerAdapter);
    loadFromCursorModel.setIsNullable(isNullable());
    loadFromCursorModel.writeSingleField(javaWriter);
  }
}