Program: 167075
Project: 167075
Buggy source:
public void addVertex(boolean complete,SqlgVertex vertex,Map<String,Object> keyValueMap){
  SchemaTable schemaTable=SchemaTable.of(vertex.getSchema(),vertex.getTable());
  if (!complete) {
    Pair<SortedSet<String>,Map<SqlgVertex,Triple<String,String,Map<String,Object>>>> pairs=this.vertexCache.get(schemaTable);
    if (pairs == null) {
      pairs=Pair.of(new TreeSet<>(keyValueMap.keySet()),new LinkedHashMap<>());
      pairs.getRight().put(vertex,Triple.of(this.sqlDialect.getBatchNull(),this.sqlDialect.getBatchNull(),keyValueMap));
      this.vertexCache.put(schemaTable,pairs);
    }
 else {
      pairs.getLeft().addAll(keyValueMap.keySet());
      pairs.getRight().put(vertex,Triple.of(this.sqlDialect.getBatchNull(),this.sqlDialect.getBatchNull(),keyValueMap));
    }
  }
 else {
    if (this.streamingBatchModeVertexSchemaTable == null) {
      this.streamingBatchModeVertexSchemaTable=vertex.getSchemaTable();
    }
    if (this.streamingBatchModeVertexKeys == null) {
      this.streamingBatchModeVertexKeys=new ArrayList<>(keyValueMap.keySet());
    }
    if (isStreamingEdges()) {
      throw new IllegalStateException("String_Node_Str");
    }
    if (isBatchModeBatchStreaming() && this.batchCount == this.batchSize) {
      throw new IllegalStateException("String_Node_Str" + this.batchCount + "String_Node_Str"+ this.batchSize);
    }
    if (isBatchModeBatchStreaming() && this.batchCount == 0) {
      this.batchedElements=new ArrayList<>();
      this.sqlDialect.lockTable(sqlgGraph,schemaTable,SchemaManager.VERTEX_PREFIX);
      this.sequenceName=this.sqlDialect.sequenceName(sqlgGraph,schemaTable,SchemaManager.VERTEX_PREFIX);
      this.batchIndex=this.sqlDialect.nextSequenceVal(sqlgGraph,schemaTable,SchemaManager.VERTEX_PREFIX);
    }
    if (isBatchModeBatchStreaming()) {
      vertex.setInternalPrimaryKey(RecordId.from(schemaTable,++this.batchIndex));
      this.batchedElements.add(vertex);
    }
    OutputStream out=this.streamingVertexCache.get(schemaTable);
    if (out == null) {
      String sql=this.sqlDialect.constructCompleteCopyCommandSqlVertex(sqlgGraph,vertex,keyValueMap);
      out=this.sqlDialect.streamSql(this.sqlgGraph,sql);
      this.streamingVertexCache.put(schemaTable,out);
    }
    try {
      this.sqlDialect.flushStreamingVertex(out,keyValueMap);
      if (isBatchModeBatchStreaming()) {
        this.batchCount++;
      }
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
    if (isBatchModeBatchStreaming() && this.batchCount == this.batchSize) {
      this.flush();
      if (this.batchCallback != null) {
        this.batchCallback.callBack(this.batchedElements);
        this.batchedElements.clear();
      }
    }
  }
}

Fixed version (ground truth):
public void addVertex(boolean streaming,SqlgVertex vertex,Map<String,Object> keyValueMap){
  SchemaTable schemaTable=SchemaTable.of(vertex.getSchema(),vertex.getTable());
  if (!streaming) {
    Pair<SortedSet<String>,Map<SqlgVertex,Map<String,Object>>> pairs=this.vertexCache.get(schemaTable);
    if (pairs == null) {
      pairs=Pair.of(new TreeSet<>(keyValueMap.keySet()),new LinkedHashMap<>());
      pairs.getRight().put(vertex,keyValueMap);
      this.vertexCache.put(schemaTable,pairs);
    }
 else {
      pairs.getLeft().addAll(keyValueMap.keySet());
      pairs.getRight().put(vertex,keyValueMap);
    }
  }
 else {
    if (this.streamingBatchModeVertexSchemaTable == null) {
      this.streamingBatchModeVertexSchemaTable=vertex.getSchemaTable();
    }
    if (this.streamingBatchModeVertexKeys == null) {
      this.streamingBatchModeVertexKeys=new ArrayList<>(keyValueMap.keySet());
    }
    if (isStreamingEdges()) {
      throw new IllegalStateException("String_Node_Str");
    }
    if (isBatchModeBatchStreaming() && this.batchCount == this.batchSize) {
      throw new IllegalStateException("String_Node_Str" + this.batchCount + "String_Node_Str"+ this.batchSize);
    }
    if (isBatchModeBatchStreaming() && this.batchCount == 0) {
      this.batchedElements=new ArrayList<>();
      this.sqlDialect.lockTable(sqlgGraph,schemaTable,SchemaManager.VERTEX_PREFIX);
      this.sequenceName=this.sqlDialect.sequenceName(sqlgGraph,schemaTable,SchemaManager.VERTEX_PREFIX);
      this.batchIndex=this.sqlDialect.nextSequenceVal(sqlgGraph,schemaTable,SchemaManager.VERTEX_PREFIX);
    }
    if (isBatchModeBatchStreaming()) {
      vertex.setInternalPrimaryKey(RecordId.from(schemaTable,++this.batchIndex));
      this.batchedElements.add(vertex);
    }
    OutputStream out=this.streamingVertexCache.get(schemaTable);
    if (out == null) {
      String sql=this.sqlDialect.constructCompleteCopyCommandSqlVertex(sqlgGraph,vertex,keyValueMap);
      out=this.sqlDialect.streamSql(this.sqlgGraph,sql);
      this.streamingVertexCache.put(schemaTable,out);
    }
    try {
      this.sqlDialect.flushStreamingVertex(out,keyValueMap);
      if (isBatchModeBatchStreaming()) {
        this.batchCount++;
      }
    }
 catch (    IOException e) {
      throw new RuntimeException(e);
    }
    if (isBatchModeBatchStreaming() && this.batchCount == this.batchSize) {
      this.flush();
      if (this.batchCallback != null) {
        this.batchCallback.callBack(this.batchedElements);
        this.batchedElements.clear();
      }
    }
  }
}