Program: 84208
Project: 84208
Buggy source:
public SqlStatement[] generateStatements(Database database) throws UnsupportedChangeException {
  CreateTableStatement statement=new CreateTableStatement(tableName);
  for (  ColumnConfig column : getColumns()) {
    ConstraintsConfig constraints=column.getConstraints();
    if (constraints != null && constraints.isPrimaryKey() != null && constraints.isPrimaryKey()) {
      boolean isAutoIncrement=column.isAutoIncrement() != null && column.isAutoIncrement();
      statement.addPrimaryKeyColumn(column.getName(),database.getColumnType(column.getType(),column.isAutoIncrement()),isAutoIncrement);
    }
 else {
      String defaultValue=null;
      if (column.hasDefaultValue()) {
        defaultValue=StringUtils.trimToNull(column.getDefaultColumnValue(database));
      }
      statement.addColumn(column.getName(),database.getColumnType(column.getType(),column.isAutoIncrement()),defaultValue);
    }
    if (constraints != null) {
      if (constraints.isNullable() != null && !constraints.isNullable()) {
        statement.addColumnConstraint(new NotNullConstraint(column.getName()));
      }
      if (constraints.getReferences() != null) {
        ForeignKeyConstraint fkConstraint=new ForeignKeyConstraint(constraints.getForeignKeyName(),constraints.getReferences());
        fkConstraint.setColumn(column.getName());
        fkConstraint.setDeleteCascade(constraints.isDeleteCascade() != null && constraints.isDeleteCascade());
        fkConstraint.setInitiallyDeferred(constraints.isInitiallyDeferred() != null && constraints.isInitiallyDeferred());
        fkConstraint.setDeferrable(constraints.isDeferrable() != null && constraints.isDeferrable());
        statement.addColumnConstraint(fkConstraint);
      }
      if (constraints.isUnique() != null && constraints.isUnique()) {
        statement.addColumnConstraint(new UniqueConstraint().addColumns(column.getName()));
      }
    }
  }
  statement.setTablespace(StringUtils.trimToNull(getTablespace()));
  List<SqlStatement> statements=new ArrayList<SqlStatement>();
  statements.add(statement);
  return statements.toArray(new SqlStatement[statements.size()]);
}

Fixed version (ground truth):
public SqlStatement[] generateStatements(Database database) throws UnsupportedChangeException {
  CreateTableStatement statement=new CreateTableStatement(tableName);
  for (  ColumnConfig column : getColumns()) {
    ConstraintsConfig constraints=column.getConstraints();
    boolean isAutoIncrement=column.isAutoIncrement() != null && column.isAutoIncrement();
    if (constraints != null && constraints.isPrimaryKey() != null && constraints.isPrimaryKey()) {
      statement.addPrimaryKeyColumn(column.getName(),database.getColumnType(column.getType(),isAutoIncrement));
    }
 else {
      String defaultValue=null;
      if (column.hasDefaultValue()) {
        defaultValue=StringUtils.trimToNull(column.getDefaultColumnValue(database));
      }
      statement.addColumn(column.getName(),database.getColumnType(column.getType(),column.isAutoIncrement()),defaultValue);
    }
    if (constraints != null) {
      if (constraints.isNullable() != null && !constraints.isNullable()) {
        statement.addColumnConstraint(new NotNullConstraint(column.getName()));
      }
      if (constraints.getReferences() != null) {
        ForeignKeyConstraint fkConstraint=new ForeignKeyConstraint(constraints.getForeignKeyName(),constraints.getReferences());
        fkConstraint.setColumn(column.getName());
        fkConstraint.setDeleteCascade(constraints.isDeleteCascade() != null && constraints.isDeleteCascade());
        fkConstraint.setInitiallyDeferred(constraints.isInitiallyDeferred() != null && constraints.isInitiallyDeferred());
        fkConstraint.setDeferrable(constraints.isDeferrable() != null && constraints.isDeferrable());
        statement.addColumnConstraint(fkConstraint);
      }
      if (constraints.isUnique() != null && constraints.isUnique()) {
        statement.addColumnConstraint(new UniqueConstraint().addColumns(column.getName()));
      }
    }
    if (isAutoIncrement) {
      statement.addColumnConstraint(new AutoIncrementConstraint(column.getName()));
    }
  }
  statement.setTablespace(StringUtils.trimToNull(getTablespace()));
  List<SqlStatement> statements=new ArrayList<SqlStatement>();
  statements.add(statement);
  return statements.toArray(new SqlStatement[statements.size()]);
}