Program: 167041
Project: 167041
Buggy source:
static void addEdgeLabel(SqlgGraph sqlgGraph,String schema,String prefixedTable,SchemaTable foreignKeyIn,SchemaTable foreignKeyOut,Map<String,PropertyType> columns){
  BatchManager.BatchModeType batchModeType=flushAndSetTxToNone(sqlgGraph);
  try {
    GraphTraversalSource traversalSource=sqlgGraph.traversal().withStrategies(TopologyStrategy.build().selectFrom(SchemaManager.SQLG_SCHEMA_SCHEMA_TABLES).create());
    List<Vertex> schemas=traversalSource.V().hasLabel(SchemaManager.SQLG_SCHEMA + "String_Node_Str" + SchemaManager.SQLG_SCHEMA_SCHEMA).has("String_Node_Str",schema).toList();
    Preconditions.checkState(!schemas.isEmpty(),"String_Node_Str" + schema + "String_Node_Str");
    Preconditions.checkState(schemas.size() == 1,"String_Node_Str" + schema + "String_Node_Str");
    Vertex schemaVertex=schemas.get(0);
    List<Vertex> outVertices=traversalSource.V(schemaVertex).out(SchemaManager.SQLG_SCHEMA_SCHEMA_VERTEX_EDGE).has("String_Node_Str",foreignKeyOut.getTable()).toList();
    Preconditions.checkState(!outVertices.isEmpty(),"String_Node_Str" + foreignKeyOut.toString() + "String_Node_Str");
    Preconditions.checkState(outVertices.size() == 1,"String_Node_Str" + foreignKeyOut.toString() + "String_Node_Str");
    Preconditions.checkState(prefixedTable.startsWith(SchemaManager.EDGE_PREFIX));
    Vertex outVertex=outVertices.get(0);
    schemas=traversalSource.V().hasLabel(SchemaManager.SQLG_SCHEMA + "String_Node_Str" + SchemaManager.SQLG_SCHEMA_SCHEMA).has("String_Node_Str",foreignKeyIn.getSchema()).toList();
    Preconditions.checkState(!schemas.isEmpty(),"String_Node_Str" + schema + "String_Node_Str");
    Preconditions.checkState(schemas.size() == 1,"String_Node_Str" + schema + "String_Node_Str");
    Vertex schemaInVertex=schemas.get(0);
    List<Vertex> inVertices=traversalSource.V(schemaInVertex).out(SchemaManager.SQLG_SCHEMA_SCHEMA_VERTEX_EDGE).has("String_Node_Str",foreignKeyIn.getTable()).toList();
    Preconditions.checkState(!inVertices.isEmpty(),"String_Node_Str" + foreignKeyIn.toString() + "String_Node_Str");
    Preconditions.checkState(inVertices.size() == 1,"String_Node_Str" + foreignKeyIn.toString() + "String_Node_Str");
    Vertex inVertex=inVertices.get(0);
    Vertex edgeVertex=sqlgGraph.addVertex(T.label,SchemaManager.SQLG_SCHEMA + "String_Node_Str" + SchemaManager.SQLG_SCHEMA_EDGE_LABEL,"String_Node_Str",prefixedTable.substring(SchemaManager.EDGE_PREFIX.length()),"String_Node_Str",LocalDateTime.now());
    outVertex.addEdge(SchemaManager.SQLG_SCHEMA_OUT_EDGES_EDGE,edgeVertex);
    inVertex.addEdge(SchemaManager.SQLG_SCHEMA_IN_EDGES_EDGE,edgeVertex);
    for (    Map.Entry<String,PropertyType> columnEntry : columns.entrySet()) {
      Vertex property=sqlgGraph.addVertex(T.label,SchemaManager.SQLG_SCHEMA + "String_Node_Str" + SchemaManager.SQLG_SCHEMA_PROPERTY,"String_Node_Str",columnEntry.getKey(),"String_Node_Str",columnEntry.getValue().name(),"String_Node_Str",LocalDateTime.now());
      edgeVertex.addEdge(SchemaManager.SQLG_SCHEMA_EDGE_PROPERTIES_EDGE,property);
    }
  }
  finally {
    sqlgGraph.tx().batchMode(batchModeType);
  }
}

Fixed version (ground truth):
static void addEdgeLabel(SqlgGraph sqlgGraph,String schema,String prefixedTable,SchemaTable foreignKeyIn,SchemaTable foreignKeyOut,Map<String,PropertyType> columns){
  BatchManager.BatchModeType batchModeType=flushAndSetTxToNone(sqlgGraph);
  try {
    GraphTraversalSource traversalSource=sqlgGraph.topology();
    List<Vertex> schemas=traversalSource.V().hasLabel(SchemaManager.SQLG_SCHEMA + "String_Node_Str" + SchemaManager.SQLG_SCHEMA_SCHEMA).has("String_Node_Str",schema).toList();
    Preconditions.checkState(!schemas.isEmpty(),"String_Node_Str" + schema + "String_Node_Str");
    Preconditions.checkState(schemas.size() == 1,"String_Node_Str" + schema + "String_Node_Str");
    Vertex schemaVertex=schemas.get(0);
    List<Vertex> outVertices=traversalSource.V(schemaVertex).out(SchemaManager.SQLG_SCHEMA_SCHEMA_VERTEX_EDGE).has("String_Node_Str",foreignKeyOut.getTable()).toList();
    Preconditions.checkState(!outVertices.isEmpty(),"String_Node_Str" + foreignKeyOut.toString() + "String_Node_Str");
    Preconditions.checkState(outVertices.size() == 1,"String_Node_Str" + foreignKeyOut.toString() + "String_Node_Str");
    Preconditions.checkState(prefixedTable.startsWith(SchemaManager.EDGE_PREFIX));
    Vertex outVertex=outVertices.get(0);
    schemas=traversalSource.V().hasLabel(SchemaManager.SQLG_SCHEMA + "String_Node_Str" + SchemaManager.SQLG_SCHEMA_SCHEMA).has("String_Node_Str",foreignKeyIn.getSchema()).toList();
    Preconditions.checkState(!schemas.isEmpty(),"String_Node_Str" + schema + "String_Node_Str");
    Preconditions.checkState(schemas.size() == 1,"String_Node_Str" + schema + "String_Node_Str");
    Vertex schemaInVertex=schemas.get(0);
    List<Vertex> inVertices=traversalSource.V(schemaInVertex).out(SchemaManager.SQLG_SCHEMA_SCHEMA_VERTEX_EDGE).has("String_Node_Str",foreignKeyIn.getTable()).toList();
    Preconditions.checkState(!inVertices.isEmpty(),"String_Node_Str" + foreignKeyIn.toString() + "String_Node_Str");
    Preconditions.checkState(inVertices.size() == 1,"String_Node_Str" + foreignKeyIn.toString() + "String_Node_Str");
    Vertex inVertex=inVertices.get(0);
    Vertex edgeVertex=sqlgGraph.addVertex(T.label,SchemaManager.SQLG_SCHEMA + "String_Node_Str" + SchemaManager.SQLG_SCHEMA_EDGE_LABEL,"String_Node_Str",prefixedTable.substring(SchemaManager.EDGE_PREFIX.length()),"String_Node_Str",LocalDateTime.now());
    outVertex.addEdge(SchemaManager.SQLG_SCHEMA_OUT_EDGES_EDGE,edgeVertex);
    inVertex.addEdge(SchemaManager.SQLG_SCHEMA_IN_EDGES_EDGE,edgeVertex);
    for (    Map.Entry<String,PropertyType> columnEntry : columns.entrySet()) {
      Vertex property=sqlgGraph.addVertex(T.label,SchemaManager.SQLG_SCHEMA + "String_Node_Str" + SchemaManager.SQLG_SCHEMA_PROPERTY,"String_Node_Str",columnEntry.getKey(),"String_Node_Str",columnEntry.getValue().name(),"String_Node_Str",LocalDateTime.now());
      edgeVertex.addEdge(SchemaManager.SQLG_SCHEMA_EDGE_PROPERTIES_EDGE,property);
    }
  }
  finally {
    sqlgGraph.tx().batchMode(batchModeType);
  }
}