Program: 167090
Project: 167090
Buggy source:
void loadSchema(){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str");
  }
  Connection conn=this.sqlgGraph.tx().getConnection();
  try {
    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);
        Map<String,PropertyType> uncommittedColumns=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.localSchemas.put(schema,schema);
          if (!previousSchema.equals(schema)) {
            foreignKeys=new HashSet<>();
            uncommittedColumns=new ConcurrentHashMap<>();
          }
          previousSchema=schema;
          String column=columnsRs.getString(4);
          if (!column.equals(SchemaManager.ID)) {
            int columnType=columnsRs.getInt(5);
            String typeName=columnsRs.getString("String_Node_Str");
            PropertyType propertyType=this.sqlDialect.sqlTypeToPropertyType(columnType,typeName);
            uncommittedColumns.put(column,propertyType);
          }
          this.localTables.put(schema + "String_Node_Str" + table,uncommittedColumns);
          Set<String> schemas=this.localLabelSchemas.get(table);
          if (schemas == null) {
            schemas=new HashSet<>();
          }
          schemas.add(schema);
          this.localLabelSchemas.put(table,schemas);
          if (table.startsWith(EDGE_PREFIX) && (column.endsWith(SchemaManager.IN_VERTEX_COLUMN_END) || column.endsWith(SchemaManager.OUT_VERTEX_COLUMN_END))) {
            foreignKeys.add(column);
            this.localEdgeForeignKeys.put(schema + "String_Node_Str" + table,foreignKeys);
            SchemaTable schemaTable=SchemaTable.of(column.split("String_Node_Str")[0],SchemaManager.VERTEX_PREFIX + column.split("String_Node_Str")[1].replace(SchemaManager.IN_VERTEX_COLUMN_END,"String_Node_Str").replace(SchemaManager.OUT_VERTEX_COLUMN_END,"String_Node_Str"));
            Pair<Set<SchemaTable>,Set<SchemaTable>> labels=this.localTableLabels.get(schemaTable);
            if (labels == null) {
              labels=Pair.of(new HashSet<>(),new HashSet<>());
              this.localTableLabels.put(schemaTable,labels);
            }
            if (column.endsWith(SchemaManager.IN_VERTEX_COLUMN_END)) {
              labels.getLeft().add(SchemaTable.of(schema,table));
            }
 else             if (column.endsWith(SchemaManager.OUT_VERTEX_COLUMN_END)) {
              labels.getRight().add(SchemaTable.of(schema,table));
            }
          }
        }
      }
    }
 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.localSchemas.put(schema,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.localTables.put(schema + "String_Node_Str" + table,uncomitedColumns);
            Set<String> schemas=this.localLabelSchemas.get(table);
            if (schemas == null) {
              schemas=new HashSet<>();
              this.localLabelSchemas.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.localEdgeForeignKeys.put(schema + "String_Node_Str" + table,foreignKeys);
            }
          }
        }
      }
    }
    if (distributed) {
      this.schemas.putAll(this.localSchemas);
      this.labelSchemas.putAll(this.localLabelSchemas);
      this.tables.putAll(this.localTables);
      this.edgeForeignKeys.putAll(this.localEdgeForeignKeys);
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
}

Fixed version (ground truth):
void loadSchema(){
  if (logger.isDebugEnabled()) {
    logger.debug("String_Node_Str");
  }
  Connection conn=this.sqlgGraph.tx().getConnection();
  try {
    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);
        if (this.sqlDialect.getSpacialRefTable().contains(table)) {
          continue;
        }
        Map<String,PropertyType> uncommittedColumns=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);
          if (this.sqlDialect.getGisSchemas().contains(schema)) {
            continue;
          }
          this.localSchemas.put(schema,schema);
          if (!previousSchema.equals(schema)) {
            foreignKeys=new HashSet<>();
            uncommittedColumns=new ConcurrentHashMap<>();
          }
          previousSchema=schema;
          String column=columnsRs.getString(4);
          if (!column.equals(SchemaManager.ID)) {
            int columnType=columnsRs.getInt(5);
            String typeName=columnsRs.getString("String_Node_Str");
            PropertyType propertyType=this.sqlDialect.sqlTypeToPropertyType(columnType,typeName);
            uncommittedColumns.put(column,propertyType);
          }
          this.localTables.put(schema + "String_Node_Str" + table,uncommittedColumns);
          Set<String> schemas=this.localLabelSchemas.get(table);
          if (schemas == null) {
            schemas=new HashSet<>();
          }
          schemas.add(schema);
          this.localLabelSchemas.put(table,schemas);
          if (table.startsWith(EDGE_PREFIX) && (column.endsWith(SchemaManager.IN_VERTEX_COLUMN_END) || column.endsWith(SchemaManager.OUT_VERTEX_COLUMN_END))) {
            foreignKeys.add(column);
            this.localEdgeForeignKeys.put(schema + "String_Node_Str" + table,foreignKeys);
            SchemaTable schemaTable=SchemaTable.of(column.split("String_Node_Str")[0],SchemaManager.VERTEX_PREFIX + column.split("String_Node_Str")[1].replace(SchemaManager.IN_VERTEX_COLUMN_END,"String_Node_Str").replace(SchemaManager.OUT_VERTEX_COLUMN_END,"String_Node_Str"));
            Pair<Set<SchemaTable>,Set<SchemaTable>> labels=this.localTableLabels.get(schemaTable);
            if (labels == null) {
              labels=Pair.of(new HashSet<>(),new HashSet<>());
              this.localTableLabels.put(schemaTable,labels);
            }
            if (column.endsWith(SchemaManager.IN_VERTEX_COLUMN_END)) {
              labels.getLeft().add(SchemaTable.of(schema,table));
            }
 else             if (column.endsWith(SchemaManager.OUT_VERTEX_COLUMN_END)) {
              labels.getRight().add(SchemaTable.of(schema,table));
            }
          }
        }
      }
    }
 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.localSchemas.put(schema,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.localTables.put(schema + "String_Node_Str" + table,uncomitedColumns);
            Set<String> schemas=this.localLabelSchemas.get(table);
            if (schemas == null) {
              schemas=new HashSet<>();
              this.localLabelSchemas.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.localEdgeForeignKeys.put(schema + "String_Node_Str" + table,foreignKeys);
            }
          }
        }
      }
    }
    if (distributed) {
      this.schemas.putAll(this.localSchemas);
      this.labelSchemas.putAll(this.localLabelSchemas);
      this.tables.putAll(this.localTables);
      this.edgeForeignKeys.putAll(this.localEdgeForeignKeys);
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
}