nus-yam/ex-repair huggingface dataset:
Program: 166978
Project: 166978
Buggy source:
static TransactionCache of(boolean cacheVertices,Connection connection,BatchManager batchManager){
  return new TransactionCache(cacheVertices,connection,batchManager);
}

Fixed version (ground truth):
static TransactionCache of(boolean cacheVertices,Connection connection,BatchManager batchManager,boolean lazyQueries){
  return new TransactionCache(cacheVertices,connection,batchManager,lazyQueries);
}
Program: 166979
Project: 166979
Buggy source:
private TransactionCache(boolean cacheVertices,Connection connection,BatchManager batchManager){
  this.cacheVertices=cacheVertices;
  this.connection=connection;
  this.batchManager=batchManager;
}

Fixed version (ground truth):
private TransactionCache(boolean cacheVertices,Connection connection,BatchManager batchManager,boolean lazyQueries){
  this.cacheVertices=cacheVertices;
  this.connection=connection;
  this.batchManager=batchManager;
  this.lazyQueries=lazyQueries;
}
Program: 166980
Project: 166980
Buggy source:
@Test public void testBothEOnEdgeToSelf(){
  final Vertex v1=this.sqlgGraph.addVertex("String_Node_Str","String_Node_Str");
  final Vertex v2=this.sqlgGraph.addVertex("String_Node_Str","String_Node_Str");
  v1.addEdge("String_Node_Str",v2,"String_Node_Str",2010);
  v1.addEdge("String_Node_Str",v2);
  v1.addEdge("String_Node_Str",v2,"String_Node_Str","String_Node_Str");
  v2.addEdge("String_Node_Str",v1,"String_Node_Str",2010);
  assertEquals(4,vertexTraversal(v1).bothE().count().next().intValue());
  assertEquals(4,vertexTraversal(v2).bothE().count().next().intValue());
  v1.edges(Direction.BOTH).forEachRemaining(edge -> {
    v1.addEdge("String_Node_Str",v2);
    v1.addEdge("String_Node_Str",v2,"String_Node_Str","String_Node_Str");
    edge.remove();
  }
);
  this.sqlgGraph.tx().commit();
  List<Edge> edgeList=vertexTraversal(v1).outE().toList();
  for (  Edge edge : edgeList) {
    System.out.println(edge);
  }
  assertEquals(8,vertexTraversal(v1).outE().count().next().intValue());
  assertEquals(0,vertexTraversal(v2).outE().count().next().intValue());
  v1.edges(Direction.BOTH).forEachRemaining(Edge::remove);
  assertEquals(0,vertexTraversal(v1).bothE().count().next().intValue());
  assertEquals(0,vertexTraversal(v2).bothE().count().next().intValue());
}

Fixed version (ground truth):
@Test public void testBothEOnEdgeToSelf(){
  final Vertex v1=this.sqlgGraph.addVertex("String_Node_Str","String_Node_Str");
  final Vertex v2=this.sqlgGraph.addVertex("String_Node_Str","String_Node_Str");
  v1.addEdge("String_Node_Str",v2,"String_Node_Str",2010);
  v1.addEdge("String_Node_Str",v2);
  v1.addEdge("String_Node_Str",v2,"String_Node_Str","String_Node_Str");
  v2.addEdge("String_Node_Str",v1,"String_Node_Str",2010);
  this.sqlgGraph.tx().setLazyQueries(false);
  assertEquals(4,vertexTraversal(v1).bothE().count().next().intValue());
  assertEquals(4,vertexTraversal(v2).bothE().count().next().intValue());
  v1.edges(Direction.BOTH).forEachRemaining(edge -> {
    v1.addEdge("String_Node_Str",v2);
    v1.addEdge("String_Node_Str",v2,"String_Node_Str","String_Node_Str");
    edge.remove();
  }
);
  this.sqlgGraph.tx().commit();
  List<Edge> edgeList=vertexTraversal(v1).outE().toList();
  for (  Edge edge : edgeList) {
    System.out.println(edge);
  }
  assertEquals(8,vertexTraversal(v1).outE().count().next().intValue());
  assertEquals(0,vertexTraversal(v2).outE().count().next().intValue());
  v1.edges(Direction.BOTH).forEachRemaining(Edge::remove);
  assertEquals(0,vertexTraversal(v1).bothE().count().next().intValue());
  assertEquals(0,vertexTraversal(v2).bothE().count().next().intValue());
}
Program: 166981
Project: 166981
Buggy source:
@Test public void testBothEOnEdgeToSelf(){
  final Vertex v1=this.sqlgGraph.addVertex("String_Node_Str","String_Node_Str");
  final Vertex v2=this.sqlgGraph.addVertex("String_Node_Str","String_Node_Str");
  v1.addEdge("String_Node_Str",v2,"String_Node_Str",2010);
  v1.addEdge("String_Node_Str",v2);
  v1.addEdge("String_Node_Str",v2,"String_Node_Str","String_Node_Str");
  v2.addEdge("String_Node_Str",v1,"String_Node_Str",2010);
  Assert.assertEquals(4,vertexTraversal(v1).bothE().count().next().intValue());
  Assert.assertEquals(4,vertexTraversal(v2).bothE().count().next().intValue());
  v1.edges(Direction.BOTH).forEachRemaining(edge -> {
    v1.addEdge("String_Node_Str",v2);
    v1.addEdge("String_Node_Str",v2,"String_Node_Str","String_Node_Str");
    edge.remove();
  }
);
  this.sqlgGraph.tx().commit();
  List<Edge> edgeList=vertexTraversal(v1).outE().toList();
  for (  Edge edge : edgeList) {
    System.out.println(edge);
  }
  Assert.assertEquals(8,vertexTraversal(v1).outE().count().next().intValue());
  Assert.assertEquals(0,vertexTraversal(v2).outE().count().next().intValue());
  v1.edges(Direction.BOTH).forEachRemaining(Edge::remove);
  Assert.assertEquals(0,vertexTraversal(v1).bothE().count().next().intValue());
  Assert.assertEquals(0,vertexTraversal(v2).bothE().count().next().intValue());
}

Fixed version (ground truth):
@Test public void testBothEOnEdgeToSelf(){
  final Vertex v1=this.sqlgGraph.addVertex("String_Node_Str","String_Node_Str");
  final Vertex v2=this.sqlgGraph.addVertex("String_Node_Str","String_Node_Str");
  v1.addEdge("String_Node_Str",v2,"String_Node_Str",2010);
  v1.addEdge("String_Node_Str",v2);
  v1.addEdge("String_Node_Str",v2,"String_Node_Str","String_Node_Str");
  v2.addEdge("String_Node_Str",v1,"String_Node_Str",2010);
  Assert.assertEquals(4,vertexTraversal(v1).bothE().count().next().intValue());
  Assert.assertEquals(4,vertexTraversal(v2).bothE().count().next().intValue());
  this.sqlgGraph.tx().setLazyQueries(false);
  v1.edges(Direction.BOTH).forEachRemaining(edge -> {
    v1.addEdge("String_Node_Str",v2);
    v1.addEdge("String_Node_Str",v2,"String_Node_Str","String_Node_Str");
    edge.remove();
  }
);
  this.sqlgGraph.tx().commit();
  List<Edge> edgeList=vertexTraversal(v1).outE().toList();
  for (  Edge edge : edgeList) {
    System.out.println(edge);
  }
  Assert.assertEquals(8,vertexTraversal(v1).outE().count().next().intValue());
  Assert.assertEquals(0,vertexTraversal(v2).outE().count().next().intValue());
  v1.edges(Direction.BOTH).forEachRemaining(Edge::remove);
  Assert.assertEquals(0,vertexTraversal(v1).bothE().count().next().intValue());
  Assert.assertEquals(0,vertexTraversal(v2).bothE().count().next().intValue());
}
Program: 166982
Project: 166982
Buggy source:
@Test public void testVertexEdges(){
  final Vertex a1=this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  final Vertex b1=this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  final Vertex c1=this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  a1.addEdge("String_Node_Str",b1);
  a1.addEdge("String_Node_Str",c1);
  this.sqlgGraph.tx().commit();
  AtomicInteger count=new AtomicInteger(0);
  a1.edges(Direction.BOTH).forEachRemaining(e -> count.incrementAndGet());
  Assert.assertEquals(2,count.get());
  count.set(0);
  a1.edges(Direction.BOTH).forEachRemaining(edge -> {
    a1.addEdge("String_Node_Str",b1);
    count.getAndIncrement();
  }
);
  Assert.assertEquals(2,count.get());
}

Fixed version (ground truth):
private void testVertexEdges(boolean lazy){
  final Vertex a1=this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  final Vertex b1=this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  final Vertex c1=this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  a1.addEdge("String_Node_Str",b1);
  a1.addEdge("String_Node_Str",c1);
  this.sqlgGraph.tx().commit();
  this.sqlgGraph.tx().setLazyQueries(lazy);
  AtomicInteger count=new AtomicInteger(0);
  a1.edges(Direction.BOTH).forEachRemaining(e -> count.incrementAndGet());
  Assert.assertEquals(2,count.get());
  count.set(0);
  a1.edges(Direction.BOTH).forEachRemaining(edge -> {
    a1.addEdge("String_Node_Str",b1);
    count.getAndIncrement();
  }
);
  Assert.assertEquals(lazy ? 3 : 2,count.get());
}
Program: 166983
Project: 166983
Buggy source:
Map<String,PropertyType> getTableFor(SchemaTable schemaTable){
  Optional<VertexLabel> vertexLabelOptional=getVertexLabel(schemaTable.getTable());
  if (vertexLabelOptional.isPresent()) {
    return vertexLabelOptional.get().getPropertyTypeMap();
  }
 else {
    Optional<EdgeLabel> edgeLabelOptional=getEdgeLabel(schemaTable.getTable());
    if (edgeLabelOptional.isPresent()) {
      return edgeLabelOptional.get().getPropertyTypeMap();
    }
  }
  return Collections.emptyMap();
}

Fixed version (ground truth):
Map<String,PropertyType> getTableFor(SchemaTable schemaTable){
  Preconditions.checkArgument(schemaTable.getTable().startsWith(VERTEX_PREFIX) || schemaTable.getTable().startsWith(EDGE_PREFIX),"String_Node_Str",SchemaManager.VERTEX_PREFIX,SchemaManager.EDGE_PREFIX);
  if (schemaTable.isVertexTable()) {
    Optional<VertexLabel> vertexLabelOptional=getVertexLabel(schemaTable.withOutPrefix().getTable());
    if (vertexLabelOptional.isPresent()) {
      return vertexLabelOptional.get().getPropertyTypeMap();
    }
  }
 else {
    Optional<EdgeLabel> edgeLabelOptional=getEdgeLabel(schemaTable.withOutPrefix().getTable());
    if (edgeLabelOptional.isPresent()) {
      return edgeLabelOptional.get().getPropertyTypeMap();
    }
  }
  return Collections.emptyMap();
}
Program: 166984
Project: 166984
Buggy source:
public Map<String,PropertyType> getTableFor(SchemaTable schemaTable){
  z_internalReadLock();
  try {
    Optional<Schema> schemaOptional=getSchema(schemaTable.getSchema());
    if (schemaOptional.isPresent()) {
      return schemaOptional.get().getTableFor(schemaTable.withOutPrefix());
    }
    if (isWriteLockHeldByCurrentThread()) {
      Map<String,PropertyType> temporaryPropertyMap=this.temporaryTables.get(schemaTable.getTable());
      if (temporaryPropertyMap != null) {
        return Collections.unmodifiableMap(temporaryPropertyMap);
      }
    }
    return Collections.emptyMap();
  }
  finally {
    z_internalReadUnLock();
  }
}

Fixed version (ground truth):
public Map<String,PropertyType> getTableFor(SchemaTable schemaTable){
  z_internalReadLock();
  try {
    Optional<Schema> schemaOptional=getSchema(schemaTable.getSchema());
    if (schemaOptional.isPresent()) {
      return schemaOptional.get().getTableFor(schemaTable);
    }
    if (isWriteLockHeldByCurrentThread()) {
      Map<String,PropertyType> temporaryPropertyMap=this.temporaryTables.get(schemaTable.getTable());
      if (temporaryPropertyMap != null) {
        return Collections.unmodifiableMap(temporaryPropertyMap);
      }
    }
    return Collections.emptyMap();
  }
  finally {
    z_internalReadUnLock();
  }
}
Program: 166985
Project: 166985
Buggy source:
@Test public void testMultiThreadEdges() throws InterruptedException, ExecutionException {
  Vertex v1=sqlgGraph.addVertex(T.label,"String_Node_Str","String_Node_Str","String_Node_Str");
  sqlgGraph.tx().commit();
  Set<Integer> tables=new ConcurrentSkipListSet<>();
  ExecutorService executorService=newFixedThreadPool(10);
  for (int j=0; j < 100; j++) {
    executorService.submit(() -> {
      final Random random=new Random();
      int randomInt=random.nextInt();
      for (int i=0; i < 10; i++) {
        Vertex v2=sqlgGraph.addVertex(T.label,"String_Node_Str" + String.valueOf(randomInt),"String_Node_Str",String.valueOf(randomInt));
        v1.addEdge("String_Node_Str" + String.valueOf(randomInt),v2);
        tables.add(randomInt);
      }
      sqlgGraph.tx().commit();
    }
);
  }
  executorService.shutdown();
  executorService.awaitTermination(60,TimeUnit.SECONDS);
  assertEquals(100,tables.size());
  for (  Integer i : tables) {
    assertTrue(this.sqlgGraph.getSchemaManager().tableExist(this.sqlgGraph.getSqlDialect().getPublicSchema(),"String_Node_Str" + String.valueOf(i)));
    assertEquals(10,this.sqlgGraph.traversal().V().has(T.label,"String_Node_Str" + String.valueOf(i)).has("String_Node_Str",String.valueOf(i)).count().next().intValue());
    assertEquals(10,vertexTraversal(v1).out("String_Node_Str" + String.valueOf(i)).count().next().intValue());
  }
}

Fixed version (ground truth):
@Test public void testMultiThreadEdges() throws InterruptedException, ExecutionException {
  Vertex v1=sqlgGraph.addVertex(T.label,"String_Node_Str","String_Node_Str","String_Node_Str");
  sqlgGraph.tx().commit();
  Set<Integer> tables=new ConcurrentSkipListSet<>();
  ExecutorService executorService=newFixedThreadPool(10);
  for (int j=0; j < 100; j++) {
    executorService.submit(() -> {
      final Random random=new Random();
      int randomInt=random.nextInt();
      for (int i=0; i < 10; i++) {
        Vertex v2=sqlgGraph.addVertex(T.label,"String_Node_Str" + String.valueOf(randomInt),"String_Node_Str",String.valueOf(randomInt));
        v1.addEdge("String_Node_Str" + String.valueOf(randomInt),v2);
        tables.add(randomInt);
      }
      sqlgGraph.tx().commit();
    }
);
  }
  executorService.shutdown();
  executorService.awaitTermination(60,TimeUnit.SECONDS);
  for (  Integer i : tables) {
    assertTrue(this.sqlgGraph.getSchemaManager().tableExist(this.sqlgGraph.getSqlDialect().getPublicSchema(),"String_Node_Str" + String.valueOf(i)));
    assertEquals(10,this.sqlgGraph.traversal().V().has(T.label,"String_Node_Str" + String.valueOf(i)).has("String_Node_Str",String.valueOf(i)).count().next().intValue());
    assertEquals(10,vertexTraversal(v1).out("String_Node_Str" + String.valueOf(i)).count().next().intValue());
  }
}
Program: 166986
Project: 166986
Buggy source:
@Test public void testMultiThreadVertices() throws InterruptedException, ExecutionException {
  Set<Integer> tables=new ConcurrentSkipListSet<>();
  ExecutorService executorService=newFixedThreadPool(10);
  for (int j=0; j < 100; j++) {
    executorService.submit(() -> {
      final Random random=new Random();
      int randomInt=random.nextInt();
      for (int i=0; i < 10; i++) {
        sqlgGraph.addVertex(T.label,"String_Node_Str" + String.valueOf(randomInt),"String_Node_Str",String.valueOf(randomInt));
        tables.add(randomInt);
      }
      sqlgGraph.tx().commit();
    }
);
  }
  executorService.shutdown();
  executorService.awaitTermination(6000,TimeUnit.SECONDS);
  assertEquals(100,tables.size());
  for (  Integer i : tables) {
    assertTrue(this.sqlgGraph.getSchemaManager().tableExist(this.sqlgGraph.getSqlDialect().getPublicSchema(),"String_Node_Str" + String.valueOf(i)));
    assertEquals(10,this.sqlgGraph.traversal().V().has(T.label,"String_Node_Str" + String.valueOf(i)).has("String_Node_Str",String.valueOf(i)).count().next().intValue());
  }
}

Fixed version (ground truth):
@Test public void testMultiThreadVertices() throws InterruptedException, ExecutionException {
  Set<Integer> tables=new ConcurrentSkipListSet<>();
  ExecutorService executorService=newFixedThreadPool(10);
  for (int j=0; j < 100; j++) {
    executorService.submit(() -> {
      final Random random=new Random();
      int randomInt=random.nextInt();
      for (int i=0; i < 10; i++) {
        sqlgGraph.addVertex(T.label,"String_Node_Str" + String.valueOf(randomInt),"String_Node_Str",String.valueOf(randomInt));
        tables.add(randomInt);
      }
      sqlgGraph.tx().commit();
    }
);
  }
  executorService.shutdown();
  executorService.awaitTermination(6000,TimeUnit.SECONDS);
  for (  Integer i : tables) {
    assertTrue(this.sqlgGraph.getSchemaManager().tableExist(this.sqlgGraph.getSqlDialect().getPublicSchema(),"String_Node_Str" + String.valueOf(i)));
    assertEquals(10,this.sqlgGraph.traversal().V().has(T.label,"String_Node_Str" + String.valueOf(i)).has("String_Node_Str",String.valueOf(i)).count().next().intValue());
  }
}
Program: 166987
Project: 166987
Buggy source:
default String getPublicSchema(){
  return "String_Node_Str";
}

Fixed version (ground truth):
/** 
 * A getter to return the "public" schema for the database. For postgresql it is "public" and for HSQLDB it is "PUBLIC"
 * @return the database's public schema.
 */
default String getPublicSchema(){
  return "String_Node_Str";
}
Program: 166988
Project: 166988
Buggy source:
public JsonNode toJson(){
  ArrayNode propertyArrayNode=new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory());
  for (  PropertyColumn property : this.properties.values()) {
    propertyArrayNode.add(property.toNotifyJson());
  }
  return propertyArrayNode;
}

Fixed version (ground truth):
protected JsonNode toJson(){
  ArrayNode propertyArrayNode=new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory());
  for (  PropertyColumn property : this.properties.values()) {
    propertyArrayNode.add(property.toNotifyJson());
  }
  return propertyArrayNode;
}
Program: 166989
Project: 166989
Buggy source:
public void fromPropertyNotifyJson(JsonNode vertexLabelJson){
  ArrayNode propertiesNode=(ArrayNode)vertexLabelJson.get("String_Node_Str");
  if (propertiesNode != null) {
    for (    JsonNode propertyNode : propertiesNode) {
      PropertyColumn property=PropertyColumn.fromNotifyJson(this,propertyNode);
      this.properties.put(property.getName(),property);
    }
  }
}

Fixed version (ground truth):
void fromPropertyNotifyJson(JsonNode vertexLabelJson){
  ArrayNode propertiesNode=(ArrayNode)vertexLabelJson.get("String_Node_Str");
  if (propertiesNode != null) {
    for (    JsonNode propertyNode : propertiesNode) {
      PropertyColumn property=PropertyColumn.fromNotifyJson(this,propertyNode);
      this.properties.put(property.getName(),property);
    }
  }
}
Program: 166990
Project: 166990
Buggy source:
public void addToOutVertexLabel(VertexLabel vertexLabel){
  this.outVertexLabels.add(vertexLabel);
}

Fixed version (ground truth):
void addToOutVertexLabel(VertexLabel vertexLabel){
  this.outVertexLabels.add(vertexLabel);
}
Program: 166991
Project: 166991
Buggy source:
public static EdgeLabel createEdgeLabel(SqlgGraph sqlgGraph,String edgeLabelName,VertexLabel outVertexLabel,VertexLabel inVertexLabel,Map<String,PropertyType> properties){
  EdgeLabel edgeLabel=new EdgeLabel(false,edgeLabelName,outVertexLabel,inVertexLabel,properties);
  if (!inVertexLabel.getSchema().isSqlgSchema()) {
    edgeLabel.createEdgeTable(sqlgGraph,outVertexLabel,inVertexLabel,properties);
  }
  return edgeLabel;
}

Fixed version (ground truth):
static EdgeLabel createEdgeLabel(SqlgGraph sqlgGraph,String edgeLabelName,VertexLabel outVertexLabel,VertexLabel inVertexLabel,Map<String,PropertyType> properties){
  EdgeLabel edgeLabel=new EdgeLabel(false,edgeLabelName,outVertexLabel,inVertexLabel,properties);
  if (!inVertexLabel.getSchema().isSqlgSchema()) {
    edgeLabel.createEdgeTable(sqlgGraph,outVertexLabel,inVertexLabel,properties);
  }
  return edgeLabel;
}
Program: 166992
Project: 166992
Buggy source:
public void ensureEdgeForeignKeysExist(SqlgGraph sqlgGraph,boolean in,VertexLabel vertexLabel,SchemaTable vertexSchemaTable){
  Preconditions.checkArgument(vertexLabel.getSchema().getName().equals(vertexSchemaTable.getSchema()));
  Preconditions.checkArgument(vertexLabel.getLabel().equals(vertexSchemaTable.getTable()));
  Set<String> allEdgeForeignKeys=getAllEdgeForeignKeys();
  SchemaTable foreignKey=SchemaTable.of(vertexSchemaTable.getSchema(),vertexSchemaTable.getTable() + (in ? SchemaManager.IN_VERTEX_COLUMN_END : SchemaManager.OUT_VERTEX_COLUMN_END));
  if (!allEdgeForeignKeys.contains(foreignKey.getSchema() + "String_Node_Str" + foreignKey.getTable())) {
    Schema schema=this.getSchema();
    schema.getTopology().lock();
    allEdgeForeignKeys=getAllEdgeForeignKeys();
    if (!allEdgeForeignKeys.contains(foreignKey.getSchema() + "String_Node_Str" + foreignKey.getTable())) {
      TopologyManager.addLabelToEdge(sqlgGraph,this.getSchema().getName(),EDGE_PREFIX + getLabel(),in,foreignKey);
      if (in) {
        this.uncommittedInVertexLabels.add(vertexLabel);
        vertexLabel.addToUncommittedInEdgeLabels(schema,this);
      }
 else {
        this.uncommittedOutVertexLabels.add(vertexLabel);
        vertexLabel.addToUncommittedOutEdgeLabels(schema,this);
      }
      addEdgeForeignKey(sqlgGraph,schema.getName(),EDGE_PREFIX + getLabel(),foreignKey,vertexSchemaTable);
    }
  }
}

Fixed version (ground truth):
void ensureEdgeForeignKeysExist(SqlgGraph sqlgGraph,boolean in,VertexLabel vertexLabel,SchemaTable vertexSchemaTable){
  Preconditions.checkArgument(vertexLabel.getSchema().getName().equals(vertexSchemaTable.getSchema()));
  Preconditions.checkArgument(vertexLabel.getLabel().equals(vertexSchemaTable.getTable()));
  Set<String> allEdgeForeignKeys=getAllEdgeForeignKeys();
  SchemaTable foreignKey=SchemaTable.of(vertexSchemaTable.getSchema(),vertexSchemaTable.getTable() + (in ? SchemaManager.IN_VERTEX_COLUMN_END : SchemaManager.OUT_VERTEX_COLUMN_END));
  if (!allEdgeForeignKeys.contains(foreignKey.getSchema() + "String_Node_Str" + foreignKey.getTable())) {
    Schema schema=this.getSchema();
    schema.getTopology().lock();
    allEdgeForeignKeys=getAllEdgeForeignKeys();
    if (!allEdgeForeignKeys.contains(foreignKey.getSchema() + "String_Node_Str" + foreignKey.getTable())) {
      TopologyManager.addLabelToEdge(sqlgGraph,this.getSchema().getName(),EDGE_PREFIX + getLabel(),in,foreignKey);
      if (in) {
        this.uncommittedInVertexLabels.add(vertexLabel);
        vertexLabel.addToUncommittedInEdgeLabels(schema,this);
      }
 else {
        this.uncommittedOutVertexLabels.add(vertexLabel);
        vertexLabel.addToUncommittedOutEdgeLabels(schema,this);
      }
      addEdgeForeignKey(sqlgGraph,schema.getName(),EDGE_PREFIX + getLabel(),foreignKey,vertexSchemaTable);
    }
  }
}
Program: 166993
Project: 166993
Buggy source:
public boolean deepEquals(EdgeLabel otherEdgeLabel){
  Preconditions.checkState(this.equals(otherEdgeLabel),"String_Node_Str");
  for (  VertexLabel outVertexLabel : this.outVertexLabels) {
    boolean ok=false;
    for (    VertexLabel otherOutVertexLabel : otherEdgeLabel.outVertexLabels) {
      if (outVertexLabel.equals(otherOutVertexLabel)) {
        ok=true;
        break;
      }
    }
    if (!ok) {
      return false;
    }
  }
  for (  VertexLabel inVertexLabel : this.inVertexLabels) {
    boolean ok=false;
    for (    VertexLabel otherInVertexLabel : otherEdgeLabel.inVertexLabels) {
      if (inVertexLabel.equals(otherInVertexLabel)) {
        ok=true;
        break;
      }
    }
    if (!ok) {
      return false;
    }
  }
  return true;
}

Fixed version (ground truth):
boolean deepEquals(EdgeLabel otherEdgeLabel){
  Preconditions.checkState(this.equals(otherEdgeLabel),"String_Node_Str");
  for (  VertexLabel outVertexLabel : this.outVertexLabels) {
    boolean ok=false;
    for (    VertexLabel otherOutVertexLabel : otherEdgeLabel.outVertexLabels) {
      if (outVertexLabel.equals(otherOutVertexLabel)) {
        ok=true;
        break;
      }
    }
    if (!ok) {
      return false;
    }
  }
  for (  VertexLabel inVertexLabel : this.inVertexLabels) {
    boolean ok=false;
    for (    VertexLabel otherInVertexLabel : otherEdgeLabel.inVertexLabels) {
      if (inVertexLabel.equals(otherInVertexLabel)) {
        ok=true;
        break;
      }
    }
    if (!ok) {
      return false;
    }
  }
  return true;
}
Program: 166994
Project: 166994
Buggy source:
public static EdgeLabel loadSqlgSchemaEdgeLabel(String edgeLabelName,VertexLabel outVertexLabel,VertexLabel inVertexLabel,Map<String,PropertyType> properties){
  EdgeLabel edgeLabel=new EdgeLabel(true,edgeLabelName,outVertexLabel,inVertexLabel,properties);
  return edgeLabel;
}

Fixed version (ground truth):
static EdgeLabel loadSqlgSchemaEdgeLabel(String edgeLabelName,VertexLabel outVertexLabel,VertexLabel inVertexLabel,Map<String,PropertyType> properties){
  EdgeLabel edgeLabel=new EdgeLabel(true,edgeLabelName,outVertexLabel,inVertexLabel,properties);
  return edgeLabel;
}
Program: 166995
Project: 166995
Buggy source:
@Override public Schema getSchema(){
  if (!this.outVertexLabels.isEmpty()) {
    VertexLabel vertexLabel=this.outVertexLabels.iterator().next();
    return vertexLabel.getSchema();
  }
 else   if (this.topology.isWriteLockHeldByCurrentThread() && !this.uncommittedOutVertexLabels.isEmpty()) {
    VertexLabel vertexLabel=this.uncommittedOutVertexLabels.iterator().next();
    return vertexLabel.getSchema();
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}

Fixed version (ground truth):
@Override protected Schema getSchema(){
  if (!this.outVertexLabels.isEmpty()) {
    VertexLabel vertexLabel=this.outVertexLabels.iterator().next();
    return vertexLabel.getSchema();
  }
 else   if (this.topology.isWriteLockHeldByCurrentThread() && !this.uncommittedOutVertexLabels.isEmpty()) {
    VertexLabel vertexLabel=this.uncommittedOutVertexLabels.iterator().next();
    return vertexLabel.getSchema();
  }
 else {
    throw new IllegalStateException("String_Node_Str");
  }
}
Program: 166996
Project: 166996
Buggy source:
public void ensureColumnsExist(SqlgGraph sqlgGraph,Map<String,PropertyType> columns){
  for (  Map.Entry<String,PropertyType> column : columns.entrySet()) {
    if (!this.properties.containsKey(column.getKey())) {
      if (!this.uncommittedProperties.containsKey(column.getKey())) {
        this.getSchema().getTopology().lock();
        if (!this.uncommittedProperties.containsKey(column.getKey())) {
          TopologyManager.addEdgeColumn(sqlgGraph,this.getSchema().getName(),EDGE_PREFIX + getLabel(),column);
          addColumn(sqlgGraph,this.getSchema().getName(),EDGE_PREFIX + getLabel(),ImmutablePair.of(column.getKey(),column.getValue()));
          this.uncommittedProperties.put(column.getKey(),new PropertyColumn(this,column.getKey(),column.getValue()));
        }
      }
    }
  }
}

Fixed version (ground truth):
void ensureColumnsExist(SqlgGraph sqlgGraph,Map<String,PropertyType> columns){
  for (  Map.Entry<String,PropertyType> column : columns.entrySet()) {
    if (!this.properties.containsKey(column.getKey())) {
      if (!this.uncommittedProperties.containsKey(column.getKey())) {
        this.getSchema().getTopology().lock();
        if (!this.uncommittedProperties.containsKey(column.getKey())) {
          TopologyManager.addEdgeColumn(sqlgGraph,this.getSchema().getName(),EDGE_PREFIX + getLabel(),column);
          addColumn(sqlgGraph,this.getSchema().getName(),EDGE_PREFIX + getLabel(),ImmutablePair.of(column.getKey(),column.getValue()));
          this.uncommittedProperties.put(column.getKey(),new PropertyColumn(this,column.getKey(),column.getValue()));
        }
      }
    }
  }
}
Program: 166997
Project: 166997
Buggy source:
public void addToInVertexLabel(VertexLabel vertexLabel){
  this.inVertexLabels.add(vertexLabel);
}

Fixed version (ground truth):
void addToInVertexLabel(VertexLabel vertexLabel){
  this.inVertexLabels.add(vertexLabel);
}
Program: 166999
Project: 166999
Buggy source:
public Set<String> getAllEdgeForeignKeys(){
  Set<String> result=new HashSet<>();
  for (  VertexLabel vertexLabel : this.inVertexLabels) {
    result.add(vertexLabel.getSchema().getName() + "String_Node_Str" + vertexLabel.getLabel()+ SchemaManager.IN_VERTEX_COLUMN_END);
  }
  for (  VertexLabel vertexLabel : this.outVertexLabels) {
    result.add(vertexLabel.getSchema().getName() + "String_Node_Str" + vertexLabel.getLabel()+ SchemaManager.OUT_VERTEX_COLUMN_END);
  }
  if (this.getSchema().getTopology().isWriteLockHeldByCurrentThread()) {
    for (    VertexLabel vertexLabel : this.uncommittedInVertexLabels) {
      result.add(vertexLabel.getSchema().getName() + "String_Node_Str" + vertexLabel.getLabel()+ SchemaManager.IN_VERTEX_COLUMN_END);
    }
    for (    VertexLabel vertexLabel : this.uncommittedOutVertexLabels) {
      result.add(vertexLabel.getSchema().getName() + "String_Node_Str" + vertexLabel.getLabel()+ SchemaManager.OUT_VERTEX_COLUMN_END);
    }
  }
  return result;
}

Fixed version (ground truth):
Set<String> getAllEdgeForeignKeys(){
  Set<String> result=new HashSet<>();
  for (  VertexLabel vertexLabel : this.inVertexLabels) {
    result.add(vertexLabel.getSchema().getName() + "String_Node_Str" + vertexLabel.getLabel()+ SchemaManager.IN_VERTEX_COLUMN_END);
  }
  for (  VertexLabel vertexLabel : this.outVertexLabels) {
    result.add(vertexLabel.getSchema().getName() + "String_Node_Str" + vertexLabel.getLabel()+ SchemaManager.OUT_VERTEX_COLUMN_END);
  }
  if (this.getSchema().getTopology().isWriteLockHeldByCurrentThread()) {
    for (    VertexLabel vertexLabel : this.uncommittedInVertexLabels) {
      result.add(vertexLabel.getSchema().getName() + "String_Node_Str" + vertexLabel.getLabel()+ SchemaManager.IN_VERTEX_COLUMN_END);
    }
    for (    VertexLabel vertexLabel : this.uncommittedOutVertexLabels) {
      result.add(vertexLabel.getSchema().getName() + "String_Node_Str" + vertexLabel.getLabel()+ SchemaManager.OUT_VERTEX_COLUMN_END);
    }
  }
  return result;
}
Program: 167000
Project: 167000
Buggy source:
public String getName(){
  return name;
}

Fixed version (ground truth):
String getName(){
  return name;
}
Program: 167001
Project: 167001
Buggy source:
public PropertyColumn(AbstractLabel abstractLabel,String name,PropertyType propertyType,Index index){
  this.abstractLabel=abstractLabel;
  this.name=name;
  this.propertyType=propertyType;
  this.index=index;
}

Fixed version (ground truth):
private PropertyColumn(AbstractLabel abstractLabel,String name,PropertyType propertyType,Index index){
  this.abstractLabel=abstractLabel;
  this.name=name;
  this.propertyType=propertyType;
  this.index=index;
}
Program: 167002
Project: 167002
Buggy source:
public static PropertyColumn fromNotifyJson(AbstractLabel abstractLabel,JsonNode jsonNode){
  PropertyColumn property=new PropertyColumn(abstractLabel,jsonNode.get("String_Node_Str").asText(),PropertyType.valueOf(jsonNode.get("String_Node_Str").asText()));
  return property;
}

Fixed version (ground truth):
static PropertyColumn fromNotifyJson(AbstractLabel abstractLabel,JsonNode jsonNode){
  PropertyColumn property=new PropertyColumn(abstractLabel,jsonNode.get("String_Node_Str").asText(),PropertyType.valueOf(jsonNode.get("String_Node_Str").asText()));
  return property;
}
Program: 167003
Project: 167003
Buggy source:
public JsonNode toNotifyJson(){
  ObjectNode propertyObjectNode=new ObjectNode(Topology.OBJECT_MAPPER.getNodeFactory());
  propertyObjectNode.put("String_Node_Str",this.name);
  propertyObjectNode.put("String_Node_Str",this.propertyType.name());
  return propertyObjectNode;
}

Fixed version (ground truth):
JsonNode toNotifyJson(){
  ObjectNode propertyObjectNode=new ObjectNode(Topology.OBJECT_MAPPER.getNodeFactory());
  propertyObjectNode.put("String_Node_Str",this.name);
  propertyObjectNode.put("String_Node_Str",this.propertyType.name());
  return propertyObjectNode;
}
Program: 167004
Project: 167004
Buggy source:
public PropertyType getPropertyType(){
  return propertyType;
}

Fixed version (ground truth):
PropertyType getPropertyType(){
  return propertyType;
}
Program: 167005
Project: 167005
Buggy source:
public String getName(){
  return name;
}

Fixed version (ground truth):
String getName(){
  return name;
}
Program: 167006
Project: 167006
Buggy source:
public Map<String,Set<String>> getAllEdgeForeignKeys(){
  Map<String,Set<String>> result=new HashMap<>();
  for (  Map.Entry<String,EdgeLabel> stringEdgeLabelEntry : getEdgeLabels().entrySet()) {
    String edgeSchemaAndLabel=stringEdgeLabelEntry.getKey();
    EdgeLabel edgeLabel=stringEdgeLabelEntry.getValue();
    result.put(edgeSchemaAndLabel,edgeLabel.getAllEdgeForeignKeys());
  }
  return result;
}

Fixed version (ground truth):
Map<String,Set<String>> getAllEdgeForeignKeys(){
  Map<String,Set<String>> result=new HashMap<>();
  for (  Map.Entry<String,EdgeLabel> stringEdgeLabelEntry : getEdgeLabels().entrySet()) {
    String edgeSchemaAndLabel=stringEdgeLabelEntry.getKey();
    EdgeLabel edgeLabel=stringEdgeLabelEntry.getValue();
    result.put(edgeSchemaAndLabel,edgeLabel.getAllEdgeForeignKeys());
  }
  return result;
}
Program: 167008
Project: 167008
Buggy source:
public Map<String,Map<String,PropertyType>> getAllTables(){
  this.z_internalReadLock();
  try {
    Map<String,Map<String,PropertyType>> result=new HashMap<>(this.allTableCache);
    if (this.isWriteLockHeldByCurrentThread()) {
      Map<String,AbstractLabel> uncommittedLabels=this.getUncommittedAllTables();
      for (      String table : uncommittedLabels.keySet()) {
        if (result.containsKey(table)) {
          result.get(table).putAll(uncommittedLabels.get(table).getPropertyTypeMap());
        }
 else {
          result.put(table,uncommittedLabels.get(table).getPropertyTypeMap());
        }
      }
    }
    for (    String sqlgSchemaSchemaTable : SQLG_SCHEMA_SCHEMA_TABLES) {
      result.remove(sqlgSchemaSchemaTable);
    }
    return Collections.unmodifiableMap(result);
  }
  finally {
    z_internalReadUnLock();
  }
}

Fixed version (ground truth):
public Map<String,Map<String,PropertyType>> getAllTables(){
  this.z_internalReadLock();
  try {
    Map<String,Map<String,PropertyType>> result;
    if (this.isWriteLockHeldByCurrentThread()) {
      result=new HashMap<>();
      for (      Map.Entry<String,Map<String,PropertyType>> allTableCacheMapEntry : this.allTableCache.entrySet()) {
        result.put(allTableCacheMapEntry.getKey(),new HashMap<>(allTableCacheMapEntry.getValue()));
      }
    }
 else {
      result=new HashMap<>(this.allTableCache);
    }
    if (this.isWriteLockHeldByCurrentThread()) {
      Map<String,AbstractLabel> uncommittedLabels=this.getUncommittedAllTables();
      for (      String table : uncommittedLabels.keySet()) {
        if (result.containsKey(table)) {
          result.get(table).putAll(uncommittedLabels.get(table).getPropertyTypeMap());
        }
 else {
          result.put(table,uncommittedLabels.get(table).getPropertyTypeMap());
        }
      }
    }
    for (    String sqlgSchemaSchemaTable : SQLG_SCHEMA_SCHEMA_TABLES) {
      result.remove(sqlgSchemaSchemaTable);
    }
    return Collections.unmodifiableMap(result);
  }
  finally {
    z_internalReadUnLock();
  }
}
Program: 167009
Project: 167009
Buggy source:
public boolean deepEquals(VertexLabel other){
  Preconditions.checkState(this.equals(other),"String_Node_Str");
  if (!this.outEdgeLabels.equals(other.outEdgeLabels)) {
    return false;
  }
 else {
    if (this.outEdgeLabels.size() != other.outEdgeLabels.size()) {
      return false;
    }
 else {
      for (      EdgeLabel outEdgeLabel : this.outEdgeLabels.values()) {
        for (        EdgeLabel otherOutEdgeLabel : other.outEdgeLabels.values()) {
          if (outEdgeLabel.equals(otherOutEdgeLabel)) {
            if (!outEdgeLabel.deepEquals(otherOutEdgeLabel)) {
              return false;
            }
          }
        }
      }
    }
    return true;
  }
}

Fixed version (ground truth):
boolean deepEquals(VertexLabel other){
  Preconditions.checkState(this.equals(other),"String_Node_Str");
  if (!this.outEdgeLabels.equals(other.outEdgeLabels)) {
    return false;
  }
 else {
    if (this.outEdgeLabels.size() != other.outEdgeLabels.size()) {
      return false;
    }
 else {
      for (      EdgeLabel outEdgeLabel : this.outEdgeLabels.values()) {
        for (        EdgeLabel otherOutEdgeLabel : other.outEdgeLabels.values()) {
          if (outEdgeLabel.equals(otherOutEdgeLabel)) {
            if (!outEdgeLabel.deepEquals(otherOutEdgeLabel)) {
              return false;
            }
          }
        }
      }
    }
    return true;
  }
}
Program: 167010
Project: 167010
Buggy source:
public void ensureColumnsExist(SqlgGraph sqlgGraph,Map<String,PropertyType> columns){
  for (  Map.Entry<String,PropertyType> column : columns.entrySet()) {
    if (!this.properties.containsKey(column.getKey())) {
      Preconditions.checkState(!this.schema.isSqlgSchema(),"String_Node_Str",SQLG_SCHEMA);
      if (!this.uncommittedProperties.containsKey(column.getKey())) {
        this.schema.getTopology().lock();
        if (!this.uncommittedProperties.containsKey(column.getKey())) {
          TopologyManager.addVertexColumn(sqlgGraph,this.schema.getName(),VERTEX_PREFIX + getLabel(),column);
          addColumn(sqlgGraph,this.schema.getName(),VERTEX_PREFIX + getLabel(),ImmutablePair.of(column.getKey(),column.getValue()));
          this.uncommittedProperties.put(column.getKey(),new PropertyColumn(this,column.getKey(),column.getValue()));
        }
      }
    }
  }
}

Fixed version (ground truth):
void ensureColumnsExist(SqlgGraph sqlgGraph,Map<String,PropertyType> columns){
  for (  Map.Entry<String,PropertyType> column : columns.entrySet()) {
    if (!this.properties.containsKey(column.getKey())) {
      Preconditions.checkState(!this.schema.isSqlgSchema(),"String_Node_Str",SQLG_SCHEMA);
      if (!this.uncommittedProperties.containsKey(column.getKey())) {
        this.schema.getTopology().lock();
        if (!this.uncommittedProperties.containsKey(column.getKey())) {
          TopologyManager.addVertexColumn(sqlgGraph,this.schema.getName(),VERTEX_PREFIX + getLabel(),column);
          addColumn(sqlgGraph,this.schema.getName(),VERTEX_PREFIX + getLabel(),ImmutablePair.of(column.getKey(),column.getValue()));
          this.uncommittedProperties.put(column.getKey(),new PropertyColumn(this,column.getKey(),column.getValue()));
        }
      }
    }
  }
}
Program: 167011
Project: 167011
Buggy source:
public JsonNode toJson(){
  ObjectNode vertexLabelNode=new ObjectNode(Topology.OBJECT_MAPPER.getNodeFactory());
  vertexLabelNode.put("String_Node_Str",getLabel());
  ArrayNode outEdgeLabelsArrayNode=new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory());
  for (  EdgeLabel edgeLabel : this.outEdgeLabels.values()) {
    outEdgeLabelsArrayNode.add(edgeLabel.toJson());
  }
  vertexLabelNode.set("String_Node_Str",outEdgeLabelsArrayNode);
  ArrayNode inEdgeLabelsArrayNode=new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory());
  for (  EdgeLabel edgeLabel : this.inEdgeLabels.values()) {
    inEdgeLabelsArrayNode.add(edgeLabel.toJson());
  }
  vertexLabelNode.set("String_Node_Str",inEdgeLabelsArrayNode);
  if (this.schema.getTopology().isWriteLockHeldByCurrentThread()) {
    outEdgeLabelsArrayNode=new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory());
    for (    EdgeLabel edgeLabel : this.uncommittedOutEdgeLabels.values()) {
      outEdgeLabelsArrayNode.add(edgeLabel.toJson());
    }
    vertexLabelNode.set("String_Node_Str",outEdgeLabelsArrayNode);
    inEdgeLabelsArrayNode=new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory());
    for (    EdgeLabel edgeLabel : this.uncommittedInEdgeLabels.values()) {
      inEdgeLabelsArrayNode.add(edgeLabel.toJson());
    }
    vertexLabelNode.set("String_Node_Str",inEdgeLabelsArrayNode);
  }
  return vertexLabelNode;
}

Fixed version (ground truth):
@Override protected JsonNode toJson(){
  ObjectNode vertexLabelNode=new ObjectNode(Topology.OBJECT_MAPPER.getNodeFactory());
  vertexLabelNode.put("String_Node_Str",getSchema().getName());
  vertexLabelNode.put("String_Node_Str",getLabel());
  vertexLabelNode.set("String_Node_Str",super.toJson());
  ArrayNode outEdgeLabelsArrayNode=new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory());
  for (  EdgeLabel edgeLabel : this.outEdgeLabels.values()) {
    outEdgeLabelsArrayNode.add(edgeLabel.toJson());
  }
  vertexLabelNode.set("String_Node_Str",outEdgeLabelsArrayNode);
  ArrayNode inEdgeLabelsArrayNode=new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory());
  for (  EdgeLabel edgeLabel : this.inEdgeLabels.values()) {
    inEdgeLabelsArrayNode.add(edgeLabel.toJson());
  }
  vertexLabelNode.set("String_Node_Str",inEdgeLabelsArrayNode);
  if (this.schema.getTopology().isWriteLockHeldByCurrentThread()) {
    outEdgeLabelsArrayNode=new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory());
    for (    EdgeLabel edgeLabel : this.uncommittedOutEdgeLabels.values()) {
      outEdgeLabelsArrayNode.add(edgeLabel.toJson());
    }
    vertexLabelNode.set("String_Node_Str",outEdgeLabelsArrayNode);
    inEdgeLabelsArrayNode=new ArrayNode(Topology.OBJECT_MAPPER.getNodeFactory());
    for (    EdgeLabel edgeLabel : this.uncommittedInEdgeLabels.values()) {
      inEdgeLabelsArrayNode.add(edgeLabel.toJson());
    }
    vertexLabelNode.set("String_Node_Str",inEdgeLabelsArrayNode);
  }
  return vertexLabelNode;
}
Program: 167012
Project: 167012
Buggy source:
@Override protected Traverser.Admin<E> processNextStart(){
  while (true) {
    if (this.iterator.hasNext()) {
      Traverser.Admin<E> traverser=null;
      Emit<E> emit=this.iterator.next();
      boolean first=true;
      Iterator<Set<String>> labelIter=emit.getPath().labels().iterator();
      for (      Object o : emit.getPath().objects()) {
        E e=(E)o;
        Set<String> labels=labelIter.next();
        this.labels=labels;
        if (!isStart && previousHead != null) {
          traverser=previousHead.split(e,this);
        }
 else         if (first) {
          first=false;
          traverser=B_LP_O_P_S_SE_SL_TraverserGenerator.instance().generate(e,this,1L);
        }
 else {
          traverser=((B_LP_O_P_S_SE_SL_Traverser)traverser).split(e,this);
        }
      }
      return traverser;
    }
 else {
      if (this.isStart) {
        if (this.done)         throw FastNoSuchElementException.instance();
 else {
          this.done=true;
          this.iterator=null == this.iteratorSupplier ? EmptyIterator.instance() : this.iteratorSupplier.get();
        }
      }
 else {
        this.previousHead=this.starts.next();
        this.iterator=null == this.iteratorSupplier ? EmptyIterator.instance() : this.iteratorSupplier.get();
      }
    }
  }
}

Fixed version (ground truth):
@Override protected Traverser.Admin<E> processNextStart(){
  while (true) {
    if (this.iterator.hasNext()) {
      Traverser.Admin<E> traverser=null;
      Emit<E> emit=this.iterator.next();
      if (emitToList && emitted != null) {
        emitted.add(emit);
      }
      boolean first=true;
      Iterator<Set<String>> labelIter=emit.getPath().labels().iterator();
      for (      Object o : emit.getPath().objects()) {
        E e=(E)o;
        Set<String> labels=labelIter.next();
        this.labels=labels;
        if (!isStart && previousHead != null && traverser == null) {
          traverser=previousHead.split(e,this);
        }
 else         if (first) {
          first=false;
          traverser=B_LP_O_P_S_SE_SL_TraverserGenerator.instance().generate(e,this,1L);
        }
 else {
          traverser=((B_LP_O_P_S_SE_SL_Traverser)traverser).split(e,this);
        }
      }
      return traverser;
    }
 else {
      if (this.isStart) {
        if (this.done)         throw FastNoSuchElementException.instance();
 else {
          this.done=true;
          this.iterator=null == this.iteratorSupplier ? EmptyIterator.instance() : this.iteratorSupplier.get();
        }
      }
 else {
        this.previousHead=this.starts.next();
        if (emitted != null) {
          emitToList=false;
          this.iterator=emitted.iterator();
        }
 else {
          this.iterator=null == this.iteratorSupplier ? EmptyIterator.instance() : this.iteratorSupplier.get();
          this.emitted=new LinkedList<>();
        }
      }
    }
  }
}
Program: 167013
Project: 167013
Buggy source:
SqlgGraphStepCompiled(final SqlgGraph sqlgGraph,final Traversal.Admin traversal,final Class<E> returnClass,final boolean isStart,final Object... ids){
  super(traversal,returnClass,isStart,ids);
  this.sqlgGraph=sqlgGraph;
  this.iteratorSupplier=new SqlgRawIteratorToEmitIterator<>(this::elements);
}

Fixed version (ground truth):
SqlgGraphStepCompiled(final SqlgGraph sqlgGraph,final Traversal.Admin traversal,final Class<E> returnClass,final boolean isStart,final Object... ids){
  super(traversal,returnClass,isStart,ids);
  this.sqlgGraph=sqlgGraph;
  this.iteratorSupplier=new SqlgRawIteratorToEmitIterator<>(this::elements);
  this.emitToList=!isStart;
}
Program: 167017
Project: 167017
Buggy source:
void flushEdgeCache(SqlgGraph sqlgGraph,Map<SchemaTable,Pair<SortedSet<String>,Map<SqlgEdge,Triple<SqlgVertex,SqlgVertex,Map<String,Object>>>>> edgeCache);

Fixed version (ground truth):
void flushEdgeCache(SqlgGraph sqlgGraph,Map<MetaEdge,Pair<SortedSet<String>,Map<SqlgEdge,Triple<SqlgVertex,SqlgVertex,Map<String,Object>>>>> edgeCache);
Program: 167018
Project: 167018
Buggy source:
public SchemaTable getStreamingBatchModeEdgeSchemaTable(){
  return streamingBatchModeEdgeSchemaTable;
}

Fixed version (ground truth):
SchemaTable getStreamingBatchModeEdgeSchemaTable(){
  return streamingBatchModeEdgeSchemaTable;
}
Program: 167019
Project: 167019
Buggy source:
public boolean vertexIsCached(SqlgVertex vertex){
  Pair<SortedSet<String>,Map<SqlgVertex,Map<String,Object>>> map=this.vertexCache.get(SchemaTable.of(vertex.getSchema(),vertex.getTable()));
  return map != null && map.getRight().containsKey(vertex);
}

Fixed version (ground truth):
boolean vertexIsCached(SqlgVertex vertex){
  Pair<SortedSet<String>,Map<SqlgVertex,Map<String,Object>>> map=this.vertexCache.get(SchemaTable.of(vertex.getSchema(),vertex.getTable()));
  return map != null && map.getRight().containsKey(vertex);
}
Program: 167020
Project: 167020
Buggy source:
public List<String> getStreamingBatchModeEdgeKeys(){
  return streamingBatchModeEdgeKeys;
}

Fixed version (ground truth):
List<String> getStreamingBatchModeEdgeKeys(){
  return streamingBatchModeEdgeKeys;
}
Program: 167021
Project: 167021
Buggy source:
public SchemaTable getStreamingBatchModeVertexSchemaTable(){
  return streamingBatchModeVertexSchemaTable;
}

Fixed version (ground truth):
SchemaTable getStreamingBatchModeVertexSchemaTable(){
  return streamingBatchModeVertexSchemaTable;
}
Program: 167022
Project: 167022
Buggy source:
public void removeEdge(String schema,String table,SqlgEdge edge){
  SchemaTable schemaTable=SchemaTable.of(schema,table);
  Pair<SortedSet<String>,Map<SqlgEdge,Triple<SqlgVertex,SqlgVertex,Map<String,Object>>>> sqlgEdgeTripleMap=this.edgeCache.get(schemaTable);
  if (sqlgEdgeTripleMap != null && sqlgEdgeTripleMap.getRight().containsKey(edge)) {
    sqlgEdgeTripleMap.getRight().remove(edge);
  }
 else {
    List<SqlgEdge> edges=this.removeEdgeCache.get(schemaTable);
    if (edges == null) {
      edges=new ArrayList<>();
      this.removeEdgeCache.put(schemaTable,edges);
    }
    edges.add(edge);
  }
}

Fixed version (ground truth):
void removeEdge(String schema,String table,SqlgEdge edge){
  SchemaTable schemaTable=SchemaTable.of(schema,table);
  MetaEdge metaEdge=MetaEdge.from(schemaTable,edge.getOutVertex(),edge.getInVertex());
  Pair<SortedSet<String>,Map<SqlgEdge,Triple<SqlgVertex,SqlgVertex,Map<String,Object>>>> sqlgEdgeTripleMap=this.edgeCache.get(metaEdge);
  if (sqlgEdgeTripleMap != null && sqlgEdgeTripleMap.getRight().containsKey(edge)) {
    sqlgEdgeTripleMap.getRight().remove(edge);
  }
 else {
    List<SqlgEdge> edges=this.removeEdgeCache.get(schemaTable);
    if (edges == null) {
      edges=new ArrayList<>();
      this.removeEdgeCache.put(schemaTable,edges);
    }
    edges.add(edge);
  }
}
Program: 167025
Project: 167025
Buggy source:
public void clear(){
  this.vertexCache.clear();
  this.edgeCache.clear();
  this.vertexInEdgeCache.clear();
  this.vertexOutEdgeCache.clear();
  this.removeEdgeCache.clear();
  this.removeVertexCache.clear();
  this.edgePropertyCache.clear();
  this.vertexPropertyCache.clear();
}

Fixed version (ground truth):
public void clear(){
  this.vertexCache.clear();
  this.edgeCache.clear();
  this.removeEdgeCache.clear();
  this.removeVertexCache.clear();
  this.edgePropertyCache.clear();
  this.vertexPropertyCache.clear();
}
Program: 167026
Project: 167026
Buggy source:
public List<String> getStreamingBatchModeVertexKeys(){
  return streamingBatchModeVertexKeys;
}

Fixed version (ground truth):
List<String> getStreamingBatchModeVertexKeys(){
  return streamingBatchModeVertexKeys;
}