Program: 84103
Project: 84103
Buggy source:
public SqlStatement[] generateStatements(Database database) throws UnsupportedChangeException {
  String schemaName=getSchemaName() == null ? database.getDefaultSchemaName() : getSchemaName();
  CreateTableStatement statement=new CreateTableStatement(schemaName,getTableName());
  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(),constraints.getPrimaryKeyName(),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) {
        if (StringUtils.trimToNull(constraints.getForeignKeyName()) == null) {
          throw new UnsupportedChangeException("String_Node_Str");
        }
        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(constraints.getUniqueConstraintName()).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()]);
}

Fixed version (ground truth):
public SqlStatement[] generateStatements(Database database) throws UnsupportedChangeException {
  String schemaName=getSchemaName() == null ? database.getDefaultSchemaName() : getSchemaName();
  CreateTableStatement statement=new CreateTableStatement(schemaName,getTableName());
  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),constraints.getPrimaryKeyName());
    }
 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) {
        if (StringUtils.trimToNull(constraints.getForeignKeyName()) == null) {
          throw new UnsupportedChangeException("String_Node_Str");
        }
        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(constraints.getUniqueConstraintName()).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()]);
}