Program: 84118
Project: 84118
Buggy source:
private void readIndexes(String schema) throws JDBCException, SQLException {
  updateListeners("String_Node_Str" + database.toString() + "String_Node_Str");
  for (  Table table : tablesMap.values()) {
    ResultSet rs;
    Statement statement=null;
    if (database instanceof OracleDatabase) {
      statement=database.getConnection().createStatement();
      String sql="String_Node_Str" + database.convertRequestedSchemaToSchema(schema) + "String_Node_Str"+ table.getName()+ "String_Node_Str";
      rs=statement.executeQuery(sql);
    }
 else {
      rs=databaseMetaData.getIndexInfo(database.convertRequestedSchemaToCatalog(schema),database.convertRequestedSchemaToSchema(schema),table.getName(),false,true);
    }
    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 columnName=rs.getString("String_Node_Str");
      short position=rs.getShort("String_Node_Str");
      String filterCondition=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.setTable(table);
        indexInformation.setName(indexName);
        indexInformation.setFilterCondition(filterCondition);
        indexMap.put(indexName,indexInformation);
      }
      indexInformation.getColumns().add(position - 1,columnName);
    }
    for (    String key : indexMap.keySet()) {
      indexes.add(indexMap.get(key));
    }
    rs.close();
    if (statement != null) {
      statement.close();
    }
  }
  Set<Index> indexesToRemove=new HashSet<Index>();
  for (  Index index : indexes) {
    for (    PrimaryKey pk : primaryKeys) {
      if (index.getTable().getName().equalsIgnoreCase(pk.getTable().getName()) && index.getColumnNames().equals(pk.getColumnNames())) {
        indexesToRemove.add(index);
      }
    }
  }
  indexes.removeAll(indexesToRemove);
}

Fixed version (ground truth):
private void readIndexes(String schema) throws JDBCException, SQLException {
  updateListeners("String_Node_Str" + database.toString() + "String_Node_Str");
  for (  Table table : tablesMap.values()) {
    ResultSet rs;
    Statement statement=null;
    if (database instanceof OracleDatabase) {
      statement=database.getConnection().createStatement();
      String sql="String_Node_Str" + database.convertRequestedSchemaToSchema(schema) + "String_Node_Str"+ table.getName()+ "String_Node_Str";
      rs=statement.executeQuery(sql);
    }
 else {
      rs=databaseMetaData.getIndexInfo(database.convertRequestedSchemaToCatalog(schema),database.convertRequestedSchemaToSchema(schema),table.getName(),false,true);
    }
    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 columnName=rs.getString("String_Node_Str");
      short position=rs.getShort("String_Node_Str");
      String filterCondition=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.setTable(table);
        indexInformation.setName(indexName);
        indexInformation.setFilterCondition(filterCondition);
        indexMap.put(indexName,indexInformation);
      }
      indexInformation.getColumns().add(position - 1,columnName);
    }
    for (    Map.Entry<String,Index> entry : indexMap.entrySet()) {
      indexes.add(entry.getValue());
    }
    rs.close();
    if (statement != null) {
      statement.close();
    }
  }
  Set<Index> indexesToRemove=new HashSet<Index>();
  for (  Index index : indexes) {
    for (    PrimaryKey pk : primaryKeys) {
      if (index.getTable().getName().equalsIgnoreCase(pk.getTable().getName()) && index.getColumnNames().equals(pk.getColumnNames())) {
        indexesToRemove.add(index);
      }
    }
  }
  indexes.removeAll(indexesToRemove);
}