Program: 167106
Project: 167106
Buggy source:
void loadSchema(){
  try {
    Connection conn=SqlgDataSource.INSTANCE.get(this.sqlgGraph.getJdbcUrl()).getConnection();
    DatabaseMetaData metadata;
    metadata=conn.getMetaData();
    if (this.sqlDialect.supportSchemas()) {
      String catalog=null;
      String schemaPattern=null;
      String tableNamePattern=null;
      String[] types=new String[]{"String_Node_Str"};
      ResultSet tablesRs=metadata.getTables(catalog,schemaPattern,tableNamePattern,types);
      while (tablesRs.next()) {
        String table=tablesRs.getString(3);
        final Map<String,PropertyType> uncomitedColumns=new ConcurrentHashMap<>();
        final Set<String> foreignKeys=new HashSet<>();
        ResultSet columnsRs=metadata.getColumns(catalog,schemaPattern,table,null);
        while (columnsRs.next()) {
          String schema=columnsRs.getString(2);
          this.schemas.add(schema);
          String column=columnsRs.getString(4);
          int columnType=columnsRs.getInt(5);
          String typeName=columnsRs.getString("String_Node_Str");
          PropertyType propertyType=this.sqlDialect.sqlTypeToPropertyType(columnType,typeName);
          uncomitedColumns.put(column,propertyType);
          this.tables.put(schema + "String_Node_Str" + table,uncomitedColumns);
          Set<String> schemas=this.labelSchemas.get(table);
          if (schemas == null) {
            schemas=new HashSet<>();
            this.labelSchemas.put(table,schemas);
          }
          schemas.add(schema);
          if (table.startsWith(EDGE_PREFIX) && (column.endsWith(SchemaManager.IN_VERTEX_COLUMN_END) || column.endsWith(SchemaManager.OUT_VERTEX_COLUMN_END))) {
            foreignKeys.add(column);
            this.edgeForeignKeys.put(schema + "String_Node_Str" + table,foreignKeys);
          }
        }
      }
    }
 else {
      String catalog=null;
      String schemaPattern=null;
      String tableNamePattern=null;
      String[] types=new String[]{"String_Node_Str"};
      ResultSet tablesRs=metadata.getTables(catalog,schemaPattern,tableNamePattern,types);
      while (tablesRs.next()) {
        String db=tablesRs.getString(1);
        if (!sqlDialect.getDefaultSchemas().contains(db)) {
          String table=tablesRs.getString(3);
          final Map<String,PropertyType> uncomitedColumns=new ConcurrentHashMap<>();
          final Set<String> foreignKeys=new HashSet<>();
          ResultSet columnsRs=metadata.getColumns(catalog,schemaPattern,table,null);
          while (columnsRs.next()) {
            String schema=columnsRs.getString(1);
            this.schemas.add(schema);
            String column=columnsRs.getString(4);
            int columnType=columnsRs.getInt(5);
            String typeName=columnsRs.getString("String_Node_Str");
            PropertyType propertyType=this.sqlDialect.sqlTypeToPropertyType(columnType,typeName);
            uncomitedColumns.put(column,propertyType);
            this.tables.put(schema + "String_Node_Str" + table,uncomitedColumns);
            Set<String> schemas=this.labelSchemas.get(table);
            if (schemas == null) {
              schemas=new HashSet<>();
              this.labelSchemas.put(table,schemas);
            }
            schemas.add(schema);
            if (table.startsWith(EDGE_PREFIX) && (column.endsWith(SchemaManager.IN_VERTEX_COLUMN_END) || column.endsWith(SchemaManager.OUT_VERTEX_COLUMN_END))) {
              foreignKeys.add(column);
              this.edgeForeignKeys.put(schema + "String_Node_Str" + table,foreignKeys);
            }
          }
        }
      }
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
void loadSchema(){
  try {
    Connection conn=SqlgDataSource.INSTANCE.get(this.sqlgGraph.getJdbcUrl()).getConnection();
    DatabaseMetaData metadata;
    metadata=conn.getMetaData();
    if (this.sqlDialect.supportSchemas()) {
      String catalog=null;
      String schemaPattern=null;
      String tableNamePattern=null;
      String[] types=new String[]{"String_Node_Str"};
      ResultSet tablesRs=metadata.getTables(catalog,schemaPattern,tableNamePattern,types);
      while (tablesRs.next()) {
        String table=tablesRs.getString(3);
        final Map<String,PropertyType> uncomittedColumns=new ConcurrentHashMap<>();
        Set<String> foreignKeys=null;
        String previousSchema="String_Node_Str";
        ResultSet columnsRs=metadata.getColumns(catalog,schemaPattern,table,null);
        while (columnsRs.next()) {
          String schema=columnsRs.getString(2);
          this.schemas.add(schema);
          if (!previousSchema.equals(schema)) {
            foreignKeys=new HashSet<>();
          }
          previousSchema=schema;
          String column=columnsRs.getString(4);
          int columnType=columnsRs.getInt(5);
          String typeName=columnsRs.getString("String_Node_Str");
          PropertyType propertyType=this.sqlDialect.sqlTypeToPropertyType(columnType,typeName);
          uncomittedColumns.put(column,propertyType);
          this.tables.put(schema + "String_Node_Str" + table,uncomittedColumns);
          Set<String> schemas=this.labelSchemas.get(table);
          if (schemas == null) {
            schemas=new HashSet<>();
            this.labelSchemas.put(table,schemas);
          }
          schemas.add(schema);
          if (table.startsWith(EDGE_PREFIX) && (column.endsWith(SchemaManager.IN_VERTEX_COLUMN_END) || column.endsWith(SchemaManager.OUT_VERTEX_COLUMN_END))) {
            foreignKeys.add(column);
            this.edgeForeignKeys.put(schema + "String_Node_Str" + table,foreignKeys);
          }
        }
      }
    }
 else {
      String catalog=null;
      String schemaPattern=null;
      String tableNamePattern=null;
      String[] types=new String[]{"String_Node_Str"};
      ResultSet tablesRs=metadata.getTables(catalog,schemaPattern,tableNamePattern,types);
      while (tablesRs.next()) {
        String db=tablesRs.getString(1);
        if (!sqlDialect.getDefaultSchemas().contains(db)) {
          String table=tablesRs.getString(3);
          final Map<String,PropertyType> uncomitedColumns=new ConcurrentHashMap<>();
          final Set<String> foreignKeys=new HashSet<>();
          ResultSet columnsRs=metadata.getColumns(catalog,schemaPattern,table,null);
          while (columnsRs.next()) {
            String schema=columnsRs.getString(1);
            this.schemas.add(schema);
            String column=columnsRs.getString(4);
            int columnType=columnsRs.getInt(5);
            String typeName=columnsRs.getString("String_Node_Str");
            PropertyType propertyType=this.sqlDialect.sqlTypeToPropertyType(columnType,typeName);
            uncomitedColumns.put(column,propertyType);
            this.tables.put(schema + "String_Node_Str" + table,uncomitedColumns);
            Set<String> schemas=this.labelSchemas.get(table);
            if (schemas == null) {
              schemas=new HashSet<>();
              this.labelSchemas.put(table,schemas);
            }
            schemas.add(schema);
            if (table.startsWith(EDGE_PREFIX) && (column.endsWith(SchemaManager.IN_VERTEX_COLUMN_END) || column.endsWith(SchemaManager.OUT_VERTEX_COLUMN_END))) {
              foreignKeys.add(column);
              this.edgeForeignKeys.put(schema + "String_Node_Str" + table,foreignKeys);
            }
          }
        }
      }
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
}