Program: 84268
Project: 84268
Buggy source:
private void readIndexes() throws JDBCException, SQLException {
  updateListeners("String_Node_Str" + database.toString() + "String_Node_Str");
  for (  Table table : tablesMap.values()) {
    ResultSet rs;
    try {
      rs=databaseMetaData.getIndexInfo(database.getCatalogName(),database.getSchemaName(),table.getName(),true,true);
    }
 catch (    SQLException e) {
      throw e;
    }
    Map<String,Index> indexMap=new HashMap<String,Index>();
    while (rs.next()) {
      String indexName=rs.getString("String_Node_Str");
      short type=rs.getShort("String_Node_Str");
      String tableName=rs.getString("String_Node_Str");
      String columnName=rs.getString("String_Node_Str");
      boolean isPKIndex=false;
      for (      PrimaryKey pk : primaryKeys) {
        if (pk.getTableName().equalsIgnoreCase(tableName) && pk.getColumnNames().equalsIgnoreCase(columnName)) {
          isPKIndex=true;
          break;
        }
      }
      if (isPKIndex || type == DatabaseMetaData.tableIndexStatistic) {
        continue;
      }
      if (columnName == null) {
        continue;
      }
      Index indexInformation;
      if (indexMap.containsKey(indexName)) {
        indexInformation=indexMap.get(indexName);
      }
 else {
        indexInformation=new Index();
        indexInformation.setTableName(tableName);
        indexInformation.setName(indexName);
        indexMap.put(indexName,indexInformation);
      }
      indexInformation.getColumns().add(columnName);
    }
    for (    String key : indexMap.keySet()) {
      indexes.add(indexMap.get(key));
    }
    rs.close();
  }
}

Fixed version (ground truth):
private void readIndexes() throws JDBCException, SQLException {
  updateListeners("String_Node_Str" + database.toString() + "String_Node_Str");
  for (  Table table : tablesMap.values()) {
    ResultSet rs;
    try {
      rs=databaseMetaData.getIndexInfo(database.getCatalogName(),database.getSchemaName(),table.getName(),true,true);
    }
 catch (    SQLException e) {
      throw e;
    }
    Map<String,Index> indexMap=new HashMap<String,Index>();
    while (rs.next()) {
      String indexName=rs.getString("String_Node_Str");
      short type=rs.getShort("String_Node_Str");
      String tableName=rs.getString("String_Node_Str");
      String columnName=rs.getString("String_Node_Str");
      if (type == DatabaseMetaData.tableIndexStatistic) {
        continue;
      }
      if (columnName == null) {
        continue;
      }
      Index indexInformation;
      if (indexMap.containsKey(indexName)) {
        indexInformation=indexMap.get(indexName);
      }
 else {
        indexInformation=new Index();
        indexInformation.setTableName(tableName);
        indexInformation.setName(indexName);
        indexMap.put(indexName,indexInformation);
      }
      indexInformation.getColumns().add(columnName);
    }
    for (    String key : indexMap.keySet()) {
      indexes.add(indexMap.get(key));
    }
    rs.close();
  }
  Set<Index> indexesToRemove=new HashSet<Index>();
  for (  Index index : indexes) {
    for (    PrimaryKey pk : primaryKeys) {
      if (index.getTableName().equalsIgnoreCase(pk.getTableName()) && index.getColumnNames().equals(pk.getColumnNames())) {
        indexesToRemove.add(index);
      }
    }
  }
  indexes.removeAll(indexesToRemove);
}