Program: 27156
Project: 27156
Buggy source:
public void writeLoadFromCursorDefinition(JavaWriter javaWriter,boolean isModelContainerDefinition) throws IOException {
  if (columnType == Column.FOREIGN_KEY) {
    javaWriter.emitEmptyLine();
    javaWriter.emitSingleLineComment("String_Node_Str",columnFieldName);
    if (!isModelContainer && !isModelContainerDefinition && isModel) {
      MockConditionQueryBuilder conditionQueryBuilder=new MockConditionQueryBuilder().appendForeignKeyReferences(columnFieldType + 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(columnFieldName).appendSpaceSeparated("String_Node_Str");
      adapterQueryBuilder.append(rawConditionStatement);
      javaWriter.emitStatement(adapterQueryBuilder.getQuery());
    }
 else {
      if (isModelContainerDefinition) {
        String modelContainerName=ModelUtils.getVariable(true) + columnFieldName;
        javaWriter.emitStatement("String_Node_Str",modelContainerName,ModelUtils.getVariable(true),ModelUtils.getVariable(true),columnFieldType);
        for (        ForeignKeyReference foreignKeyReference : foreignKeyReferences) {
          AdapterQueryBuilder adapterQueryBuilder=new AdapterQueryBuilder();
          adapterQueryBuilder.append(modelContainerName).appendPut(foreignKeyReference.foreignColumnName()).append(ModelUtils.getCursorStatement(ModelUtils.getClassFromAnnotation(foreignKeyReference),foreignKeyReference.columnName())).append("String_Node_Str");
          javaWriter.emitStatement(adapterQueryBuilder.getQuery());
        }
        javaWriter.emitStatement("String_Node_Str",ModelUtils.getVariable(true),columnFieldName,modelContainerName);
      }
 else {
        for (        ForeignKeyReference foreignKeyReference : foreignKeyReferences) {
          javaWriter.emitStatement(ModelUtils.getLoadFromCursorDefinitionField(manager,ModelUtils.getClassFromAnnotation(foreignKeyReference),columnFieldName,foreignKeyReference.columnName(),foreignKeyReference.foreignColumnName(),null,false,isModelContainerDefinition,isModelContainer));
        }
      }
    }
    javaWriter.emitSingleLineComment("String_Node_Str");
    javaWriter.emitEmptyLine();
  }
 else {
    javaWriter.emitStatement(ModelUtils.getLoadFromCursorDefinitionField(manager,columnFieldType,columnFieldName,columnName,"String_Node_Str",modelType,hasTypeConverter,isModelContainerDefinition,this.isModelContainer));
  }
}

Fixed version (ground truth):
public void writeLoadFromCursorDefinition(JavaWriter javaWriter,boolean isModelContainerDefinition) throws IOException {
  if (columnType == Column.FOREIGN_KEY) {
    javaWriter.emitEmptyLine();
    javaWriter.emitSingleLineComment("String_Node_Str",columnFieldName);
    if (!isModelContainer && !isModelContainerDefinition && isModel) {
      MockConditionQueryBuilder conditionQueryBuilder=new MockConditionQueryBuilder().appendForeignKeyReferences(columnFieldType + 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(columnFieldName).appendSpaceSeparated("String_Node_Str");
      adapterQueryBuilder.append(rawConditionStatement);
      javaWriter.emitStatement(adapterQueryBuilder.getQuery());
    }
 else {
      if (isModelContainerDefinition) {
        String modelContainerName=ModelUtils.getVariable(true) + columnFieldName;
        javaWriter.emitStatement("String_Node_Str",modelContainerName,ModelUtils.getVariable(true),ModelUtils.getVariable(true),columnFieldType);
        for (        ForeignKeyReference foreignKeyReference : foreignKeyReferences) {
          AdapterQueryBuilder adapterQueryBuilder=new AdapterQueryBuilder();
          adapterQueryBuilder.append(modelContainerName).appendPut(foreignKeyReference.foreignColumnName()).append(ModelUtils.getCursorStatement(ModelUtils.getClassFromAnnotation(foreignKeyReference),foreignKeyReference.columnName())).append("String_Node_Str");
          javaWriter.emitStatement(adapterQueryBuilder.getQuery());
        }
        javaWriter.emitStatement("String_Node_Str",ModelUtils.getVariable(true),columnFieldName,modelContainerName);
      }
 else {
        for (        ForeignKeyReference foreignKeyReference : foreignKeyReferences) {
          javaWriter.emitStatement(ModelUtils.getLoadFromCursorDefinitionField(manager,ModelUtils.getClassFromAnnotation(foreignKeyReference),columnFieldName,foreignKeyReference.columnName(),foreignKeyReference.foreignColumnName(),null,false,isModelContainerDefinition,isModelContainer));
        }
      }
    }
    javaWriter.emitSingleLineComment("String_Node_Str");
    javaWriter.emitEmptyLine();
  }
 else {
    String getType=columnFieldType;
    if (element.asType().getKind().isPrimitive()) {
      getType=manager.getTypeUtils().boxedClass((PrimitiveType)element.asType()).asType().toString();
    }
    javaWriter.emitStatement(ModelUtils.getLoadFromCursorDefinitionField(manager,getType,columnFieldName,columnName,"String_Node_Str",modelType,hasTypeConverter,isModelContainerDefinition,this.isModelContainer));
  }
}