Program: 86633
Project: 86633
Buggy source:
public void createTable(DataAccess data) throws DatabaseWriteException {
  PreparedStatement ps=null;
  try {
    StringBuilder fields=new StringBuilder();
    HashMap<Column,Object> columns=data.toDatabaseEntryList();
    Iterator<Column> it=columns.keySet().iterator();
    Column column=null;
    while (it.hasNext()) {
      column=it.next();
      fields.append("String_Node_Str").append(column.columnName()).append("String_Node_Str");
      if (column.columnType().equals(Column.ColumnType.PRIMARY) && column.autoIncrement() && column.dataType() == Column.DataType.INTEGER) {
        fields.append("String_Node_Str");
        if (it.hasNext()) {
          fields.append("String_Node_Str");
        }
        continue;
      }
 else {
        fields.append(getDataTypeSyntax(column.dataType()));
      }
      if (column.columnType() == Column.ColumnType.PRIMARY) {
        fields.append("String_Node_Str");
      }
      if (column.autoIncrement()) {
        fields.append("String_Node_Str");
      }
      if (it.hasNext()) {
        fields.append("String_Node_Str");
      }
    }
    String state="String_Node_Str" + data.getName() + "String_Node_Str"+ fields.toString()+ "String_Node_Str";
    ps=conn.prepareStatement(state);
    if (ps.execute()) {
      Canary.logDebug("String_Node_Str");
    }
  }
 catch (  SQLException ex) {
    throw new DatabaseWriteException("String_Node_Str" + data.getName() + "String_Node_Str"+ ex.getMessage());
  }
catch (  DatabaseTableInconsistencyException ex) {
    Canary.logStacktrace(ex.getMessage() + "String_Node_Str" + data.getName()+ "String_Node_Str",ex);
  }
 finally {
    closePS(ps);
  }
}

Fixed version (ground truth):
public void createTable(DataAccess data) throws DatabaseWriteException {
  PreparedStatement ps=null;
  try {
    StringBuilder fields=new StringBuilder();
    HashMap<Column,Object> columns=data.toDatabaseEntryList();
    Iterator<Column> it=columns.keySet().iterator();
    Column column;
    while (it.hasNext()) {
      column=it.next();
      fields.append("String_Node_Str").append(column.columnName()).append("String_Node_Str");
      if (column.columnType().equals(Column.ColumnType.PRIMARY) && column.autoIncrement() && column.dataType() == Column.DataType.INTEGER) {
        fields.append("String_Node_Str");
        if (it.hasNext()) {
          fields.append("String_Node_Str");
        }
        continue;
      }
 else {
        fields.append(getDataTypeSyntax(column.dataType()));
      }
      if (column.columnType() == Column.ColumnType.PRIMARY) {
        fields.append("String_Node_Str");
      }
      if (column.autoIncrement()) {
        fields.append("String_Node_Str");
      }
      if (it.hasNext()) {
        fields.append("String_Node_Str");
      }
    }
    String state="String_Node_Str" + data.getName() + "String_Node_Str"+ fields.toString()+ "String_Node_Str";
    ps=conn.prepareStatement(state);
    if (ps.execute()) {
      Canary.logDebug("String_Node_Str");
    }
  }
 catch (  SQLException ex) {
    throw new DatabaseWriteException("String_Node_Str" + data.getName() + "String_Node_Str"+ ex.getMessage());
  }
catch (  DatabaseTableInconsistencyException ex) {
    Canary.logStacktrace(ex.getMessage() + "String_Node_Str" + data.getName()+ "String_Node_Str",ex);
  }
 finally {
    closePS(ps);
  }
}