Program: 167093
Project: 167093
Buggy source:
public Set<SchemaTableTree> getRootSchemaTableTrees(SqlgGraph sqlgGraph){
  Preconditions.checkState(this.isGraphStep(),"String_Node_Str");
  GraphStep graphStep=(GraphStep)this.step;
  Set<SchemaTableTree> result=new HashSet<>();
  List<HasContainer> hasContainerWithoutLabel=this.hasContainers.stream().filter(h -> !h.getKey().equals(T.label.getAccessor())).collect(Collectors.toList());
  List<HasContainer> hasContainerWithLabel=this.hasContainers.stream().filter(h -> h.getKey().equals(T.label.getAccessor())).collect(Collectors.toList());
  if (hasContainerWithLabel.isEmpty()) {
    sqlgGraph.getSchemaManager().getAllTables().forEach((t,p) -> {
      if ((graphStep.getReturnClass().isAssignableFrom(Vertex.class) && t.substring(t.indexOf("String_Node_Str") + 1).startsWith(SchemaManager.VERTEX_PREFIX)) || (graphStep.getReturnClass().isAssignableFrom(Edge.class) && t.substring(t.indexOf("String_Node_Str") + 1).startsWith(SchemaManager.EDGE_PREFIX))) {
        SchemaTable schemaTable=SchemaTable.from(sqlgGraph,t,sqlgGraph.getSqlDialect().getPublicSchema());
        SchemaTableTree schemaTableTree=new SchemaTableTree(sqlgGraph,schemaTable,1);
        schemaTableTree.setHasContainers(hasContainerWithoutLabel);
        schemaTableTree.setStepType(SchemaTableTree.STEP_TYPE.GRAPH_STEP);
        schemaTableTree.labels=ReplacedStep.this.labels;
        result.add(schemaTableTree);
      }
    }
);
  }
 else {
    hasContainerWithLabel.forEach(h -> {
      SchemaTable schemaTableForLabel=SqlgUtil.parseLabelMaybeNoSchema((String)h.getValue());
      if (sqlgGraph.getSchemaManager().getAllTables().containsKey(schemaTableForLabel.toString())) {
        SchemaTable schemaTable=SchemaTable.from(sqlgGraph,schemaTableForLabel.toString(),sqlgGraph.getSqlDialect().getPublicSchema());
        SchemaTableTree schemaTableTree=new SchemaTableTree(sqlgGraph,schemaTable,1);
        schemaTableTree.setHasContainers(hasContainerWithoutLabel);
        schemaTableTree.setStepType(SchemaTableTree.STEP_TYPE.GRAPH_STEP);
        schemaTableTree.labels=ReplacedStep.this.labels;
        result.add(schemaTableTree);
      }
    }
);
  }
  return result;
}

Fixed version (ground truth):
public Set<SchemaTableTree> getRootSchemaTableTrees(SqlgGraph sqlgGraph){
  Preconditions.checkState(this.isGraphStep(),"String_Node_Str");
  GraphStep graphStep=(GraphStep)this.step;
  Set<SchemaTableTree> result=new HashSet<>();
  List<HasContainer> hasContainerWithoutLabel=this.hasContainers.stream().filter(h -> !h.getKey().equals(T.label.getAccessor())).collect(Collectors.toList());
  List<HasContainer> hasContainerWithLabel=this.hasContainers.stream().filter(h -> h.getKey().equals(T.label.getAccessor())).collect(Collectors.toList());
  if (hasContainerWithLabel.isEmpty()) {
    sqlgGraph.getSchemaManager().getAllTables().forEach((t,p) -> {
      if ((graphStep.getReturnClass().isAssignableFrom(Vertex.class) && t.substring(t.indexOf("String_Node_Str") + 1).startsWith(SchemaManager.VERTEX_PREFIX)) || (graphStep.getReturnClass().isAssignableFrom(Edge.class) && t.substring(t.indexOf("String_Node_Str") + 1).startsWith(SchemaManager.EDGE_PREFIX))) {
        SchemaTable schemaTable=SchemaTable.from(sqlgGraph,t,sqlgGraph.getSqlDialect().getPublicSchema());
        SchemaTableTree schemaTableTree=new SchemaTableTree(sqlgGraph,schemaTable,1);
        schemaTableTree.setHasContainers(hasContainerWithoutLabel);
        schemaTableTree.setStepType(SchemaTableTree.STEP_TYPE.GRAPH_STEP);
        schemaTableTree.labels=ReplacedStep.this.labels;
        result.add(schemaTableTree);
      }
    }
);
  }
 else {
    hasContainerWithLabel.forEach(h -> {
      SchemaTable schemaTableForLabel=SqlgUtil.parseLabelMaybeNoSchema((String)h.getValue());
      String table=(graphStep.getReturnClass().isAssignableFrom(Vertex.class) ? SchemaManager.VERTEX_PREFIX : SchemaManager.EDGE_PREFIX) + schemaTableForLabel.getTable();
      schemaTableForLabel=SchemaTable.from(sqlgGraph,schemaTableForLabel.getSchema() == null ? table : schemaTableForLabel.getSchema() + "String_Node_Str" + table,sqlgGraph.getSqlDialect().getPublicSchema());
      if (sqlgGraph.getSchemaManager().getAllTables().containsKey(schemaTableForLabel.toString())) {
        SchemaTableTree schemaTableTree=new SchemaTableTree(sqlgGraph,schemaTableForLabel,1);
        schemaTableTree.setHasContainers(hasContainerWithoutLabel);
        schemaTableTree.setStepType(SchemaTableTree.STEP_TYPE.GRAPH_STEP);
        schemaTableTree.labels=ReplacedStep.this.labels;
        result.add(schemaTableTree);
      }
    }
);
  }
  return result;
}