nus-yam/ex-repair huggingface dataset:
Program: 167094
Project: 167094
Buggy source:
@Override public <S>Traverser.Admin<S> generate(final S pair,final Step<S,?> startStep,final long initialBulk){
  Pair<S,Multimap<String,Object>> p=(Pair<S,Multimap<String,Object>>)pair;
  return new SqlGraphStepTraverser<>(p.getLeft(),p.getRight(),startStep,initialBulk);
}

Fixed version (ground truth):
@Override public <S>Traverser.Admin<S> generate(final S pair,final Step<S,?> step,final long initialBulk){
  if (pair instanceof Pair) {
    Pair<S,Multimap<String,Object>> p=(Pair<S,Multimap<String,Object>>)pair;
    return new SqlGraphStepTraverser<>(p.getLeft(),p.getRight(),step,initialBulk);
  }
 else {
    Multimap<String,Object> emptyMap=ArrayListMultimap.create();
    return new SqlGraphStepTraverser<>(pair,emptyMap,step,initialBulk);
  }
}
Program: 167095
Project: 167095
Buggy source:
public Set<SchemaTableTree> getRootSchemaTableTrees(SqlgGraph sqlgGraph){
  Set<SchemaTableTree> result=new HashSet<>();
  this.hasContainers.stream().filter(h -> h.getKey().equals(T.label.getAccessor())).map(HasContainer::getValue).forEach(label -> {
    SchemaTable schemaTable=SchemaTable.from(sqlgGraph,SchemaManager.VERTEX_PREFIX + label,sqlgGraph.getSqlDialect().getPublicSchema());
    SchemaTableTree schemaTableTree=new SchemaTableTree(sqlgGraph,schemaTable,1);
    schemaTableTree.setHasContainers(this.hasContainers);
    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 -> {
      String label=(graphStep.getReturnClass().isAssignableFrom(Vertex.class) ? SchemaManager.VERTEX_PREFIX : SchemaManager.EDGE_PREFIX) + h.getValue();
      SchemaTable schemaTableForLabel=SchemaTable.from(sqlgGraph,label,sqlgGraph.getSqlDialect().getPublicSchema());
      if (sqlgGraph.getSchemaManager().getAllTables().containsKey(schemaTableForLabel.toString())) {
        SchemaTable schemaTable=SchemaTable.from(sqlgGraph,label,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;
}
Program: 167096
Project: 167096
Buggy source:
void removeNodesInvalidatedByHas(){
  Queue<SchemaTableTree> queue=new LinkedList<>();
  queue.add(this);
  while (!queue.isEmpty()) {
    SchemaTableTree current=queue.remove();
    if (invalidateByHas(current)) {
      removeNode(current);
    }
 else {
      queue.addAll(current.children);
    }
  }
}

Fixed version (ground truth):
boolean removeNodesInvalidatedByHas(){
  if (invalidateByHas(this)) {
    return true;
  }
 else {
    Queue<SchemaTableTree> queue=new LinkedList<>();
    queue.add(this);
    while (!queue.isEmpty()) {
      SchemaTableTree current=queue.remove();
      if (invalidateByHas(current)) {
        removeNode(current);
      }
 else {
        queue.addAll(current.children);
      }
    }
    return false;
  }
}
Program: 167098
Project: 167098
Buggy source:
public SqlgGraphStepCompiled(final SqlgGraph sqlgGraph,final Traversal.Admin traversal,final Class<S> returnClass,final Object... ids){
  super(traversal,returnClass,ids);
  this.sqlgGraph=sqlgGraph;
  if ((this.ids.length == 0 || !(this.ids[0] instanceof Element))) {
    if (Vertex.class.isAssignableFrom(this.returnClass)) {
      this.iteratorSupplier=this::elements;
    }
 else {
      this.iteratorSupplier=this::elements;
    }
  }
}

Fixed version (ground truth):
public SqlgGraphStepCompiled(final SqlgGraph sqlgGraph,final Traversal.Admin traversal,final Class<S> returnClass,final Object... ids){
  super(traversal,returnClass,ids);
  this.sqlgGraph=sqlgGraph;
  if ((this.ids.length == 0 || !(this.ids[0] instanceof Element))) {
    this.iteratorSupplier=this::elements;
  }
}
Program: 167099
Project: 167099
Buggy source:
private Iterator<Pair<E,Multimap<String,Object>>> elements(){
  Preconditions.checkState(this.replacedSteps.size() > 0,"String_Node_Str");
  Preconditions.checkState(this.replacedSteps.get(0).isGraphStep(),"String_Node_Str");
  Set<SchemaTableTree> rootSchemaTableTree=this.sqlgGraph.getGremlinParser().parse(this.replacedSteps);
  SqlgCompiledResultIterator<Pair<E,Multimap<String,Object>>> resultIterator=new SqlgCompiledResultIterator<>();
  for (  SchemaTableTree schemaTableTree : rootSchemaTableTree) {
    List<Pair<LinkedList<SchemaTableTree>,String>> sqlStatements=schemaTableTree.constructSql();
    for (    Pair<LinkedList<SchemaTableTree>,String> sqlPair : sqlStatements) {
      Connection conn=this.sqlgGraph.tx().getConnection();
      if (logger.isDebugEnabled()) {
        logger.debug(sqlPair.getRight());
      }
      try (PreparedStatement preparedStatement=conn.prepareStatement(sqlPair.getRight())){
        SqlgUtil.setParametersOnStatement(this.sqlgGraph,sqlPair.getLeft(),conn,preparedStatement);
        ResultSet resultSet=preparedStatement.executeQuery();
        while (resultSet.next()) {
          Pair<E,Multimap<String,Object>> result=SqlgUtil.loadElementsLabeledAndEndElements(this.sqlgGraph,resultSet,sqlPair.getLeft());
          resultIterator.add(result);
        }
      }
 catch (      SQLException e) {
        throw new RuntimeException(e);
      }
    }
  }
  return resultIterator;
}

Fixed version (ground truth):
private Iterator<Pair<E,Multimap<String,Object>>> elements(){
  Preconditions.checkState(this.replacedSteps.size() > 0,"String_Node_Str");
  Preconditions.checkState(this.replacedSteps.get(0).isGraphStep(),"String_Node_Str");
  Set<SchemaTableTree> rootSchemaTableTree=this.sqlgGraph.getGremlinParser().parse(this.replacedSteps);
  SqlgCompiledResultIterator<Pair<E,Multimap<String,Object>>> resultIterator=new SqlgCompiledResultIterator<>();
  for (  SchemaTableTree schemaTableTree : rootSchemaTableTree) {
    List<Pair<LinkedList<SchemaTableTree>,String>> sqlStatements=schemaTableTree.constructSql();
    for (    Pair<LinkedList<SchemaTableTree>,String> sqlPair : sqlStatements) {
      Connection conn=this.sqlgGraph.tx().getConnection();
      if (logger.isDebugEnabled()) {
        logger.debug(sqlPair.getRight());
      }
      try (PreparedStatement preparedStatement=conn.prepareStatement(sqlPair.getRight())){
        SqlgUtil.setParametersOnStatement(this.sqlgGraph,sqlPair.getLeft(),conn,preparedStatement,1);
        ResultSet resultSet=preparedStatement.executeQuery();
        while (resultSet.next()) {
          Pair<E,Multimap<String,Object>> result=SqlgUtil.loadElementsLabeledAndEndElements(this.sqlgGraph,resultSet,sqlPair.getLeft());
          resultIterator.add(result);
        }
      }
 catch (      SQLException e) {
        throw new RuntimeException(e);
      }
    }
  }
  return resultIterator;
}
Program: 167100
Project: 167100
Buggy source:
/** 
 * Generate a query for the replaced steps. Each replaced step translates to a join statement and a section of the where clause.
 * @param replacedSteps
 * @return The results of the query
 */
private <S,E>Iterator<Pair<E,Multimap<String,Object>>> internalGetElements(List<ReplacedStep<S,E>> replacedSteps){
  SchemaTable schemaTable=getSchemaTablePrefixed();
  SchemaTableTree schemaTableTree=this.sqlgGraph.getGremlinParser().parse(schemaTable,replacedSteps);
  List<Pair<LinkedList<SchemaTableTree>,String>> sqlStatements=schemaTableTree.constructSql();
  SqlgCompiledResultIterator<Pair<E,Multimap<String,Object>>> resultIterator=new SqlgCompiledResultIterator<>();
  for (  Pair<LinkedList<SchemaTableTree>,String> sqlPair : sqlStatements) {
    Connection conn=this.sqlgGraph.tx().getConnection();
    if (logger.isDebugEnabled()) {
      logger.debug(sqlPair.getRight());
    }
    try (PreparedStatement preparedStatement=conn.prepareStatement(sqlPair.getRight())){
      preparedStatement.setLong(1,this.recordId.getId());
      SqlgUtil.setParametersOnStatement(this.sqlgGraph,sqlPair.getLeft(),conn,preparedStatement);
      ResultSet resultSet=preparedStatement.executeQuery();
      while (resultSet.next()) {
        Pair<E,Multimap<String,Object>> result=SqlgUtil.loadElementsLabeledAndEndElements(this.sqlgGraph,resultSet,sqlPair.getLeft());
        resultIterator.add(result);
      }
    }
 catch (    SQLException e) {
      throw new RuntimeException(e);
    }
  }
  return resultIterator;
}

Fixed version (ground truth):
/** 
 * Generate a query for the replaced steps. Each replaced step translates to a join statement and a section of the where clause.
 * @param replacedSteps
 * @return The results of the query
 */
private <S,E>Iterator<Pair<E,Multimap<String,Object>>> internalGetElements(List<ReplacedStep<S,E>> replacedSteps){
  SchemaTable schemaTable=getSchemaTablePrefixed();
  SchemaTableTree schemaTableTree=this.sqlgGraph.getGremlinParser().parse(schemaTable,replacedSteps);
  List<Pair<LinkedList<SchemaTableTree>,String>> sqlStatements=schemaTableTree.constructSql();
  SqlgCompiledResultIterator<Pair<E,Multimap<String,Object>>> resultIterator=new SqlgCompiledResultIterator<>();
  for (  Pair<LinkedList<SchemaTableTree>,String> sqlPair : sqlStatements) {
    Connection conn=this.sqlgGraph.tx().getConnection();
    if (logger.isDebugEnabled()) {
      logger.debug(sqlPair.getRight());
    }
    try (PreparedStatement preparedStatement=conn.prepareStatement(sqlPair.getRight())){
      preparedStatement.setLong(1,this.recordId.getId());
      SqlgUtil.setParametersOnStatement(this.sqlgGraph,sqlPair.getLeft(),conn,preparedStatement,2);
      ResultSet resultSet=preparedStatement.executeQuery();
      while (resultSet.next()) {
        Pair<E,Multimap<String,Object>> result=SqlgUtil.loadElementsLabeledAndEndElements(this.sqlgGraph,resultSet,sqlPair.getLeft());
        resultIterator.add(result);
      }
    }
 catch (    SQLException e) {
      throw new RuntimeException(e);
    }
  }
  return resultIterator;
}
Program: 167101
Project: 167101
Buggy source:
public static void setParametersOnStatement(SqlgGraph sqlgGraph,LinkedList<SchemaTableTree> schemaTableTreeStack,Connection conn,PreparedStatement preparedStatement) throws SQLException {
  int parameterIndex=2;
  Multimap<String,Object> keyValueMap=LinkedListMultimap.create();
  for (  SchemaTableTree schemaTableTree : schemaTableTreeStack) {
    for (    HasContainer hasContainer : schemaTableTree.getHasContainers()) {
      keyValueMap.put(hasContainer.getKey(),hasContainer.getValue());
    }
  }
  SqlgUtil.setKeyValuesAsParameter(sqlgGraph,parameterIndex,conn,preparedStatement,keyValueMap);
}

Fixed version (ground truth):
public static void setParametersOnStatement(SqlgGraph sqlgGraph,LinkedList<SchemaTableTree> schemaTableTreeStack,Connection conn,PreparedStatement preparedStatement,int parameterIndex) throws SQLException {
  Multimap<String,Object> keyValueMap=LinkedListMultimap.create();
  for (  SchemaTableTree schemaTableTree : schemaTableTreeStack) {
    for (    HasContainer hasContainer : schemaTableTree.getHasContainers()) {
      keyValueMap.put(hasContainer.getKey(),hasContainer.getValue());
    }
  }
  SqlgUtil.setKeyValuesAsParameter(sqlgGraph,parameterIndex,conn,preparedStatement,keyValueMap);
}
Program: 167104
Project: 167104
Buggy source:
@Override public <V>Property<V> property(String key,V value){
  ElementHelper.validateProperty(key,value);
  this.sqlgGraph.getSqlDialect().validateProperty(key,value);
  sqlgGraph.tx().addElementPropertyRollback(this.elementPropertyRollback);
  PropertyType.from(value);
  this.sqlgGraph.getSchemaManager().ensureColumnExist(this.schema,this instanceof Vertex ? SchemaManager.VERTEX_PREFIX + this.table : SchemaManager.EDGE_PREFIX + this.table,ImmutablePair.of(key,PropertyType.from(value)));
  updateRow(key,value);
  return instantiateProperty(key,value);
}

Fixed version (ground truth):
@Override public <V>Property<V> property(String key,V value){
  ElementHelper.validateProperty(key,value);
  this.sqlgGraph.getSqlDialect().validateProperty(key,value);
  sqlgGraph.tx().addElementPropertyRollback(this.elementPropertyRollback);
  PropertyType.from(value);
  this.sqlgGraph.getSchemaManager().ensureColumnExist(this.schema,this instanceof Vertex ? SchemaManager.VERTEX_PREFIX + this.table : SchemaManager.EDGE_PREFIX + this.table,ImmutablePair.of(key,PropertyType.from(value)));
  load();
  updateRow(key,value);
  return instantiateProperty(key,value);
}
Program: 167107
Project: 167107
Buggy source:
@Override public GraphTraversal<Edge,Edge> E(){
  this.tx().readWrite();
  final GraphTraversal traversal=new DefaultGraphTraversal<Object,Edge>();
  traversal.strategies().register(SqlGGraphStepStrategy.instance());
  traversal.strategies().register(SqlgHasStepStrategy.instance());
  traversal.addStep(new SqlgGraphStep(traversal,Edge.class,this));
  traversal.sideEffects().setGraph(this);
  return traversal;
}

Fixed version (ground truth):
@Override public GraphTraversal<Edge,Edge> E(){
  this.tx().readWrite();
  final GraphTraversal traversal=new DefaultGraphTraversal<Object,Edge>();
  traversal.getStrategies().register(SqlGGraphStepStrategy.instance());
  traversal.getStrategies().register(SqlgHasStepStrategy.instance());
  traversal.addStep(new SqlgGraphStep(traversal,Edge.class,this));
  traversal.sideEffects().setGraph(this);
  return traversal;
}
Program: 167108
Project: 167108
Buggy source:
@Override public GraphTraversal<Vertex,Vertex> V(){
  this.tx().readWrite();
  final GraphTraversal traversal=new DefaultGraphTraversal<Object,Vertex>();
  traversal.strategies().register(SqlGGraphStepStrategy.instance());
  traversal.strategies().register(SqlgHasStepStrategy.instance());
  traversal.addStep(new SqlgGraphStep(traversal,Vertex.class,this));
  traversal.sideEffects().setGraph(this);
  return traversal;
}

Fixed version (ground truth):
@Override public GraphTraversal<Vertex,Vertex> V(){
  this.tx().readWrite();
  final GraphTraversal traversal=new DefaultGraphTraversal<Object,Vertex>();
  traversal.getStrategies().register(SqlGGraphStepStrategy.instance());
  traversal.getStrategies().register(SqlgHasStepStrategy.instance());
  traversal.addStep(new SqlgGraphStep(traversal,Vertex.class,this));
  traversal.sideEffects().setGraph(this);
  return traversal;
}
Program: 167109
Project: 167109
Buggy source:
@Override public <S>GraphTraversal<S,S> of(){
  final GraphTraversal<S,S> traversal=new DefaultGraphTraversal<>();
  traversal.strategies().register(SqlGGraphStepStrategy.instance());
  traversal.addStep(new StartStep<>(traversal));
  traversal.sideEffects().setGraph(this);
  return traversal;
}

Fixed version (ground truth):
@Override public <S>GraphTraversal<S,S> of(){
  final GraphTraversal<S,S> traversal=new DefaultGraphTraversal<>();
  traversal.getStrategies().register(SqlGGraphStepStrategy.instance());
  traversal.addStep(new StartStep<>(traversal));
  traversal.sideEffects().setGraph(this);
  return traversal;
}
Program: 167110
Project: 167110
Buggy source:
@Override public Edge e(final Object id){
  this.tx().readWrite();
  if (null == id)   throw Graph.Exceptions.elementNotFound(Edge.class,id);
  SqlgEdge sqlGEdge=null;
  StringBuilder sql=new StringBuilder("String_Node_Str");
  sql.append(this.getSqlDialect().maybeWrapInQoutes(this.sqlDialect.getPublicSchema()));
  sql.append("String_Node_Str");
  sql.append(this.getSqlDialect().maybeWrapInQoutes(SchemaManager.EDGES));
  sql.append("String_Node_Str");
  sql.append(this.getSchemaManager().getSqlDialect().maybeWrapInQoutes("String_Node_Str"));
  sql.append("String_Node_Str");
  if (this.getSqlDialect().needsSemicolon()) {
    sql.append("String_Node_Str");
  }
  Connection conn=this.tx().getConnection();
  if (logger.isDebugEnabled()) {
    logger.debug(sql.toString());
  }
  try (PreparedStatement preparedStatement=conn.prepareStatement(sql.toString())){
    Long idAsLong=evaluateToLong(id);
    preparedStatement.setLong(1,idAsLong);
    ResultSet resultSet=preparedStatement.executeQuery();
    while (resultSet.next()) {
      String schema=resultSet.getString("String_Node_Str");
      String table=resultSet.getString("String_Node_Str");
      sqlGEdge=new SqlgEdge(this,idAsLong,schema,table);
    }
    preparedStatement.close();
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
  if (sqlGEdge == null) {
    throw Graph.Exceptions.elementNotFound(Edge.class,id);
  }
  return sqlGEdge;
}

Fixed version (ground truth):
@Override public Edge e(final Object id){
  this.tx().readWrite();
  if (null == id)   throw Graph.Exceptions.elementNotFound(Edge.class,id);
  if (!(id instanceof Long))   throw new NoSuchElementException(id.toString());
  SqlgEdge sqlGEdge=null;
  StringBuilder sql=new StringBuilder("String_Node_Str");
  sql.append(this.getSqlDialect().maybeWrapInQoutes(this.sqlDialect.getPublicSchema()));
  sql.append("String_Node_Str");
  sql.append(this.getSqlDialect().maybeWrapInQoutes(SchemaManager.EDGES));
  sql.append("String_Node_Str");
  sql.append(this.getSchemaManager().getSqlDialect().maybeWrapInQoutes("String_Node_Str"));
  sql.append("String_Node_Str");
  if (this.getSqlDialect().needsSemicolon()) {
    sql.append("String_Node_Str");
  }
  Connection conn=this.tx().getConnection();
  if (logger.isDebugEnabled()) {
    logger.debug(sql.toString());
  }
  try (PreparedStatement preparedStatement=conn.prepareStatement(sql.toString())){
    Long idAsLong=evaluateToLong(id);
    preparedStatement.setLong(1,idAsLong);
    ResultSet resultSet=preparedStatement.executeQuery();
    while (resultSet.next()) {
      String schema=resultSet.getString("String_Node_Str");
      String table=resultSet.getString("String_Node_Str");
      sqlGEdge=new SqlgEdge(this,idAsLong,schema,table);
    }
    preparedStatement.close();
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
  if (sqlGEdge == null) {
    throw Graph.Exceptions.elementNotFound(Edge.class,id);
  }
  return sqlGEdge;
}
Program: 167111
Project: 167111
Buggy source:
@Override public Vertex v(final Object id){
  this.tx().readWrite();
  if (null == id)   throw Graph.Exceptions.elementNotFound(Vertex.class,id);
  SqlgVertex sqlGVertex=null;
  StringBuilder sql=new StringBuilder("String_Node_Str");
  sql.append(this.getSqlDialect().maybeWrapInQoutes(this.sqlDialect.getPublicSchema()));
  sql.append("String_Node_Str");
  sql.append(this.getSchemaManager().getSqlDialect().maybeWrapInQoutes(SchemaManager.VERTICES));
  sql.append("String_Node_Str");
  sql.append(this.getSchemaManager().getSqlDialect().maybeWrapInQoutes("String_Node_Str"));
  sql.append("String_Node_Str");
  if (this.getSqlDialect().needsSemicolon()) {
    sql.append("String_Node_Str");
  }
  Connection conn=this.tx().getConnection();
  if (logger.isDebugEnabled()) {
    logger.debug(sql.toString());
  }
  try (PreparedStatement preparedStatement=conn.prepareStatement(sql.toString())){
    Long idAsLong=evaluateToLong(id);
    preparedStatement.setLong(1,idAsLong);
    ResultSet resultSet=preparedStatement.executeQuery();
    while (resultSet.next()) {
      String schema=resultSet.getString("String_Node_Str");
      String table=resultSet.getString("String_Node_Str");
      sqlGVertex=SqlgVertex.of(this,idAsLong,schema,table);
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
  if (sqlGVertex == null) {
    throw Graph.Exceptions.elementNotFound(Vertex.class,id);
  }
  return sqlGVertex;
}

Fixed version (ground truth):
@Override public Vertex v(final Object id){
  this.tx().readWrite();
  if (null == id)   throw Graph.Exceptions.elementNotFound(Vertex.class,id);
  if (!(id instanceof Long))   throw new NoSuchElementException(id.toString());
  SqlgVertex sqlGVertex=null;
  StringBuilder sql=new StringBuilder("String_Node_Str");
  sql.append(this.getSqlDialect().maybeWrapInQoutes(this.sqlDialect.getPublicSchema()));
  sql.append("String_Node_Str");
  sql.append(this.getSchemaManager().getSqlDialect().maybeWrapInQoutes(SchemaManager.VERTICES));
  sql.append("String_Node_Str");
  sql.append(this.getSchemaManager().getSqlDialect().maybeWrapInQoutes("String_Node_Str"));
  sql.append("String_Node_Str");
  if (this.getSqlDialect().needsSemicolon()) {
    sql.append("String_Node_Str");
  }
  Connection conn=this.tx().getConnection();
  if (logger.isDebugEnabled()) {
    logger.debug(sql.toString());
  }
  try (PreparedStatement preparedStatement=conn.prepareStatement(sql.toString())){
    Long idAsLong=evaluateToLong(id);
    preparedStatement.setLong(1,idAsLong);
    ResultSet resultSet=preparedStatement.executeQuery();
    while (resultSet.next()) {
      String schema=resultSet.getString("String_Node_Str");
      String table=resultSet.getString("String_Node_Str");
      sqlGVertex=SqlgVertex.of(this,idAsLong,schema,table);
    }
  }
 catch (  SQLException e) {
    throw new RuntimeException(e);
  }
  if (sqlGVertex == null) {
    throw Graph.Exceptions.elementNotFound(Vertex.class,id);
  }
  return sqlGVertex;
}
Program: 167112
Project: 167112
Buggy source:
@Override public <E extends Element>E element(){
  return (E)this.element;
}

Fixed version (ground truth):
@Override public Element element(){
  return this.element;
}
Program: 167113
Project: 167113
Buggy source:
public boolean isInBatchMode(){
  return threadLocalTx.get().getBatchManager().isBatchModeOn();
}

Fixed version (ground truth):
public boolean isInBatchMode(){
  if (threadLocalTx.get() != null) {
    return threadLocalTx.get().getBatchManager().isBatchModeOn();
  }
 else {
    return false;
  }
}
Program: 167114
Project: 167114
Buggy source:
@Override public GraphTraversal<Vertex,Vertex> start(){
  final GraphTraversal<Vertex,Vertex> traversal=GraphTraversal.of();
  traversal.strategies().register(SqlGGraphStepStrategy.instance());
  traversal.strategies().register(SqlgHasStepStrategy.instance());
  traversal.strategies().register(SqlgVertexStepStrategy.instance());
  return (GraphTraversal)traversal.addStep(new StartStep<>(traversal,this));
}

Fixed version (ground truth):
@Override public GraphTraversal<Vertex,Vertex> start(){
  final GraphTraversal<Vertex,Vertex> traversal=GraphTraversal.of();
  traversal.getStrategies().register(SqlGGraphStepStrategy.instance());
  traversal.getStrategies().register(SqlgHasStepStrategy.instance());
  traversal.getStrategies().register(SqlgVertexStepStrategy.instance());
  return (GraphTraversal)traversal.addStep(new StartStep<>(traversal,this));
}
Program: 167115
Project: 167115
Buggy source:
@Override public Vertex element(){
  return super.element();
}

Fixed version (ground truth):
@Override public Vertex element(){
  return (Vertex)super.element();
}
Program: 167116
Project: 167116
Buggy source:
@Test public void testEdgeIsToDifferentLabeledVertexes(){
  Vertex v1=this.sqlgGraph.addVertex(T.label,"String_Node_Str","String_Node_Str","String_Node_Str");
  Vertex v2=this.sqlgGraph.addVertex(T.label,"String_Node_Str","String_Node_Str","String_Node_Str");
  Vertex v3=this.sqlgGraph.addVertex(T.label,"String_Node_Str","String_Node_Str","String_Node_Str");
  v1.addEdge("String_Node_Str",v2);
  v1.addEdge("String_Node_Str",v3);
  this.sqlgGraph.tx().commit();
  Assert.assertEquals(2,v1.out().count().next(),0);
  Set<String> names=new HashSet();
  v1.out().forEach(v -> names.add(v.<String>property("String_Node_Str").value()));
  Assert.assertTrue(names.contains("String_Node_Str"));
  Assert.assertTrue(names.contains("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testEdgeIsToDifferentLabeledVertexes(){
  Vertex v1=this.sqlgGraph.addVertex(T.label,"String_Node_Str","String_Node_Str","String_Node_Str");
  Vertex v2=this.sqlgGraph.addVertex(T.label,"String_Node_Str","String_Node_Str","String_Node_Str");
  Vertex v3=this.sqlgGraph.addVertex(T.label,"String_Node_Str","String_Node_Str","String_Node_Str");
  v1.addEdge("String_Node_Str",v2);
  v1.addEdge("String_Node_Str",v3);
  this.sqlgGraph.tx().commit();
  Assert.assertEquals(2,v1.out().count().next(),0);
  Set<String> names=new HashSet();
  v1.out().forEachRemaining(v -> names.add(v.<String>property("String_Node_Str").value()));
  Assert.assertTrue(names.contains("String_Node_Str"));
  Assert.assertTrue(names.contains("String_Node_Str"));
}
Program: 167117
Project: 167117
Buggy source:
@Test public void testNoResult(){
  this.sqlgGraph.addVertex(T.label,"String_Node_Str","String_Node_Str","String_Node_Str");
  this.sqlgGraph.tx().commit();
  Vertex v=this.sqlgGraph.V().<Vertex>has(T.label,"String_Node_Str").next();
  Assert.assertEquals("String_Node_Str",v.property("String_Node_Str").value());
  this.sqlgGraph.V().remove();
  this.sqlgGraph.tx().commit();
  Assert.assertEquals(0,this.sqlgGraph.V().count().next(),0);
  Assert.assertEquals(0,this.sqlgGraph.V().has(T.label,"String_Node_Str").count().next(),0);
  Set<Long> result=new HashSet<>();
  this.sqlgGraph.V().<Vertex>has(T.label,"String_Node_Str").forEach(vertex -> result.add((Long)vertex.id()));
  Assert.assertEquals(0,result.size());
}

Fixed version (ground truth):
@Test public void testNoResult(){
  this.sqlgGraph.addVertex(T.label,"String_Node_Str","String_Node_Str","String_Node_Str");
  this.sqlgGraph.tx().commit();
  Vertex v=this.sqlgGraph.V().<Vertex>has(T.label,"String_Node_Str").next();
  Assert.assertEquals("String_Node_Str",v.property("String_Node_Str").value());
  this.sqlgGraph.V().remove();
  this.sqlgGraph.tx().commit();
  Assert.assertEquals(0,this.sqlgGraph.V().count().next(),0);
  Assert.assertEquals(0,this.sqlgGraph.V().has(T.label,"String_Node_Str").count().next(),0);
  Set<Long> result=new HashSet<>();
  this.sqlgGraph.V().<Vertex>has(T.label,"String_Node_Str").forEachRemaining(vertex -> result.add((Long)vertex.id()));
  Assert.assertEquals(0,result.size());
}
Program: 167118
Project: 167118
Buggy source:
protected void printTraversalForm(final Traversal traversal){
  System.out.println("String_Node_Str" + traversal);
  traversal.strategies().apply(TraversalEngine.STANDARD);
  System.out.println("String_Node_Str" + traversal);
}

Fixed version (ground truth):
protected void printTraversalForm(final Traversal traversal){
  System.out.println("String_Node_Str" + traversal);
  traversal.getStrategies().apply(TraversalEngine.STANDARD);
  System.out.println("String_Node_Str" + traversal);
}
Program: 167119
Project: 167119
Buggy source:
private <S,E>List<Bindings<E>> toBindings(final Traversal<S,Map<String,E>> traversal){
  List<Bindings<E>> result=new LinkedList<>();
  traversal.forEach(o -> {
    result.add(new Bindings<>(o));
  }
);
  return result;
}

Fixed version (ground truth):
private <S,E>List<Bindings<E>> toBindings(final Traversal<S,Map<String,E>> traversal){
  List<Bindings<E>> result=new LinkedList<>();
  traversal.forEachRemaining(o -> {
    result.add(new Bindings<>(o));
  }
);
  return result;
}
Program: 167120
Project: 167120
Buggy source:
@Test public void shouldNotCallBaseFunctionThusNotRemovingTheVertex() throws Exception {
  Graph g=this.sqlgGraph;
  final StrategyWrappedGraph swg=new StrategyWrappedGraph(g);
  swg.strategy().setGraphStrategy(new GraphStrategy(){
    @Override public UnaryOperator<Supplier<Void>> getRemoveVertexStrategy(    final Strategy.Context<StrategyWrappedVertex> ctx){
      return (t) -> () -> {
        final Vertex v=ctx.getCurrent().getBaseVertex();
        v.bothE().remove();
        v.properties().forEachRemaining(Property::remove);
        v.property("String_Node_Str",true);
        return null;
      }
;
    }
  }
);
  final Vertex toRemove=g.addVertex("String_Node_Str","String_Node_Str");
  toRemove.addEdge("String_Node_Str",g.addVertex("String_Node_Str","String_Node_Str"));
  assertEquals(1,toRemove.properties().count().next(),0);
  assertEquals(new Long(1),toRemove.bothE().count().next());
  assertFalse(toRemove.property("String_Node_Str").isPresent());
  swg.v(toRemove.id()).remove();
  final Vertex removed=g.v(toRemove.id());
  assertNotNull(removed);
  assertEquals(1,removed.properties().count().next(),0);
  assertEquals(new Long(0),removed.bothE().count().next());
  assertTrue(toRemove.property("String_Node_Str").isPresent());
}

Fixed version (ground truth):
@Test public void shouldNotCallBaseFunctionThusNotRemovingTheVertex() throws Exception {
  Graph g=this.sqlgGraph;
  final StrategyWrappedGraph swg=new StrategyWrappedGraph(g);
  swg.getStrategy().setGraphStrategy(new GraphStrategy(){
    @Override public UnaryOperator<Supplier<Void>> getRemoveVertexStrategy(    final Strategy.Context<StrategyWrappedVertex> ctx){
      return (t) -> () -> {
        final Vertex v=ctx.getCurrent().getBaseVertex();
        v.bothE().remove();
        v.properties().forEachRemaining(Property::remove);
        v.property("String_Node_Str",true);
        return null;
      }
;
    }
  }
);
  final Vertex toRemove=g.addVertex("String_Node_Str","String_Node_Str");
  toRemove.addEdge("String_Node_Str",g.addVertex("String_Node_Str","String_Node_Str"));
  assertEquals(1,toRemove.properties().count().next(),0);
  assertEquals(new Long(1),toRemove.bothE().count().next());
  assertFalse(toRemove.property("String_Node_Str").isPresent());
  swg.v(toRemove.id()).remove();
  final Vertex removed=g.v(toRemove.id());
  assertNotNull(removed);
  assertEquals(1,removed.properties().count().next(),0);
  assertEquals(new Long(0),removed.bothE().count().next());
  assertTrue(toRemove.property("String_Node_Str").isPresent());
}
Program: 167122
Project: 167122
Buggy source:
@Test public void hasNextCountBug(){
  this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  this.sqlgGraph.tx().commit();
  GraphTraversal<Vertex,Vertex> gt=this.sqlgGraph.V().has(T.label,"String_Node_Str");
  assertTrue(gt.hasNext());
  assertEquals(3,gt.count().next().intValue());
}

Fixed version (ground truth):
@Test(expected=IllegalStateException.class) public void hasNextCountBug(){
  this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  this.sqlgGraph.addVertex(T.label,"String_Node_Str");
  this.sqlgGraph.tx().commit();
  GraphTraversal<Vertex,Vertex> gt=this.sqlgGraph.V().has(T.label,"String_Node_Str");
  assertTrue(gt.hasNext());
  assertEquals(3,gt.count().next().intValue());
}
Program: 167123
Project: 167123
Buggy source:
private String updateVertexLabels(String currentLabel,SchemaTable schemaTable){
  if (StringUtils.isEmpty(currentLabel) || currentLabel.equals(this.sqlDialect.getBatchNull())) {
    return schemaTable.toString();
  }
 else   if (currentLabel.contains(schemaTable.toString())) {
    return currentLabel;
  }
 else {
    return currentLabel + SchemaManager.LABEL_SEPERATOR + schemaTable.toString();
  }
}

Fixed version (ground truth):
private String updateVertexLabels(String currentLabel,SchemaTable schemaTable){
  if (StringUtils.isEmpty(currentLabel) || currentLabel.equals(this.sqlDialect.getBatchNull())) {
    return schemaTable.toString();
  }
 else   if (currentLabel.equals(schemaTable.toString()) || currentLabel.startsWith(schemaTable.toString() + SchemaManager.LABEL_SEPERATOR) || currentLabel.contains(SchemaManager.LABEL_SEPERATOR + schemaTable.toString() + SchemaManager.LABEL_SEPERATOR)|| currentLabel.endsWith(schemaTable.toString() + SchemaManager.LABEL_SEPERATOR)) {
    return currentLabel;
  }
 else {
    return currentLabel + SchemaManager.LABEL_SEPERATOR + schemaTable.toString();
  }
}
Program: 167124
Project: 167124
Buggy source:
@Override protected void load(){
  if (this.properties.isEmpty()) {
    StringBuilder sql=new StringBuilder("String_Node_Str");
    sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(this.schema));
    sql.append("String_Node_Str");
    sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(SchemaManager.VERTEX_PREFIX + this.table));
    sql.append("String_Node_Str");
    sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes("String_Node_Str"));
    sql.append("String_Node_Str");
    if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {
      sql.append("String_Node_Str");
    }
    Connection conn=this.sqlgGraph.tx().getConnection();
    if (logger.isDebugEnabled()) {
      logger.debug(sql.toString());
    }
    try (PreparedStatement preparedStatement=conn.prepareStatement(sql.toString())){
      preparedStatement.setLong(1,this.primaryKey);
      ResultSet resultSet=preparedStatement.executeQuery();
      if (resultSet.next()) {
        loadResultSet(resultSet);
      }
 else {
        throw new IllegalStateException(String.format("String_Node_Str",new Object[]{this.schema + "String_Node_Str" + this.table,this.primaryKey}));
      }
    }
 catch (    SQLException e) {
      throw new RuntimeException(e);
    }
  }
}

Fixed version (ground truth):
@Override protected void load(){
  if ((!this.sqlgGraph.tx().isInBatchMode() && this.properties.isEmpty()) || (this.properties.isEmpty() && this.sqlgGraph.features().supportsBatchMode() && this.sqlgGraph.tx().isInBatchMode()&& !this.sqlgGraph.tx().getBatchManager().vertexIsCached(this))) {
    StringBuilder sql=new StringBuilder("String_Node_Str");
    sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(this.schema));
    sql.append("String_Node_Str");
    sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(SchemaManager.VERTEX_PREFIX + this.table));
    sql.append("String_Node_Str");
    sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes("String_Node_Str"));
    sql.append("String_Node_Str");
    if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {
      sql.append("String_Node_Str");
    }
    Connection conn=this.sqlgGraph.tx().getConnection();
    if (logger.isDebugEnabled()) {
      logger.debug(sql.toString());
    }
    try (PreparedStatement preparedStatement=conn.prepareStatement(sql.toString())){
      preparedStatement.setLong(1,this.primaryKey);
      ResultSet resultSet=preparedStatement.executeQuery();
      if (resultSet.next()) {
        loadResultSet(resultSet);
      }
 else {
        throw new IllegalStateException(String.format("String_Node_Str",new Object[]{this.schema + "String_Node_Str" + this.table,this.primaryKey}));
      }
    }
 catch (    SQLException e) {
      throw new RuntimeException(e);
    }
  }
}
Program: 167125
Project: 167125
Buggy source:
void ensureVertexTableExist(final String schema,final String table,final Object... keyValues){
  Objects.requireNonNull(schema,"String_Node_Str");
  Objects.requireNonNull(table,"String_Node_Str");
  final String prefixedTable=VERTEX_PREFIX + table;
  final ConcurrentHashMap<String,PropertyType> columns=SqlgUtil.transformToColumnDefinitionMap(keyValues);
  if (!this.tables.containsKey(schema + "String_Node_Str" + prefixedTable)) {
    if (!this.schemaLock.isHeldByCurrentThread()) {
      this.schemaLock.lock();
    }
    if (!this.sqlDialect.getPublicSchema().equals(schema) && !this.schemas.contains(schema)) {
      if (!this.uncommittedSchemas.contains(schema)) {
        this.uncommittedSchemas.add(schema);
        createSchema(schema);
      }
    }
    if (!this.tables.containsKey(schema + "String_Node_Str" + prefixedTable)) {
      if (!this.uncommittedTables.containsKey(schema + "String_Node_Str" + prefixedTable)) {
        Set<String> schemas=this.uncommittedLabelSchemas.get(prefixedTable);
        if (schemas == null) {
          this.uncommittedLabelSchemas.put(prefixedTable,new HashSet<>(Arrays.asList(schema)));
        }
 else {
          schemas.add(schema);
          this.uncommittedLabelSchemas.put(prefixedTable,schemas);
        }
        this.uncommittedTables.put(schema + "String_Node_Str" + prefixedTable,columns);
        createVertexTable(schema,prefixedTable,columns);
      }
    }
  }
  columns.forEach((k,v) -> ensureColumnExist(schema,prefixedTable,ImmutablePair.of(k,v)));
}

Fixed version (ground truth):
void ensureVertexTableExist(final String schema,final String table,final Object... keyValues){
  Objects.requireNonNull(schema,"String_Node_Str");
  Objects.requireNonNull(table,"String_Node_Str");
  if (table.equals("String_Node_Str")) {
    System.out.println(table);
  }
  final String prefixedTable=VERTEX_PREFIX + table;
  final ConcurrentHashMap<String,PropertyType> columns=SqlgUtil.transformToColumnDefinitionMap(keyValues);
  if (!this.tables.containsKey(schema + "String_Node_Str" + prefixedTable)) {
    if (!this.schemaLock.isHeldByCurrentThread()) {
      this.schemaLock.lock();
    }
    if (!this.sqlDialect.getPublicSchema().equals(schema) && !this.schemas.contains(schema)) {
      if (!this.uncommittedSchemas.contains(schema)) {
        this.uncommittedSchemas.add(schema);
        createSchema(schema);
      }
    }
    if (!this.tables.containsKey(schema + "String_Node_Str" + prefixedTable)) {
      if (!this.uncommittedTables.containsKey(schema + "String_Node_Str" + prefixedTable)) {
        Set<String> schemas=this.uncommittedLabelSchemas.get(prefixedTable);
        if (schemas == null) {
          this.uncommittedLabelSchemas.put(prefixedTable,new HashSet<>(Arrays.asList(schema)));
        }
 else {
          schemas.add(schema);
          this.uncommittedLabelSchemas.put(prefixedTable,schemas);
        }
        this.uncommittedTables.put(schema + "String_Node_Str" + prefixedTable,columns);
        createVertexTable(schema,prefixedTable,columns);
      }
    }
  }
  columns.forEach((k,v) -> ensureColumnExist(schema,prefixedTable,ImmutablePair.of(k,v)));
}
Program: 167126
Project: 167126
Buggy source:
private SqlG(final Configuration configuration){
  try {
    Class<?> sqlDialectClass=Class.forName(configuration.getString("String_Node_Str"));
    Constructor<?> constructor=sqlDialectClass.getConstructor(Configuration.class);
    this.sqlDialect=(SqlDialect)constructor.newInstance(configuration);
    this.implementForeignKeys=configuration.getBoolean("String_Node_Str",false);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  try {
    this.jdbcUrl=configuration.getString("String_Node_Str");
    SqlgDataSource.INSTANCE.setupDataSource(sqlDialect.getJdbcDriver(),configuration.getString("String_Node_Str"),configuration.getString("String_Node_Str"),configuration.getString("String_Node_Str"));
    this.sqlDialect.prepareDB(SqlgDataSource.INSTANCE.get(configuration.getString("String_Node_Str")).getConnection());
  }
 catch (  PropertyVetoException e) {
    throw new RuntimeException(e);
  }
catch (  SQLException e) {
    throw new RuntimeException(e);
  }
  this.sqlgTransaction=new SqlgTransaction(this);
  this.tx().readWrite();
  this.schemaManager=new SchemaManager(this,sqlDialect);
  this.schemaManager.loadSchema();
  if (!this.sqlDialect.supportSchemas() && !this.schemaManager.existSchema(this.sqlDialect.getPublicSchema())) {
    this.schemaManager.createSchema(this.sqlDialect.getPublicSchema());
  }
  this.schemaManager.ensureGlobalVerticesTableExist();
  this.schemaManager.ensureGlobalEdgesTableExist();
  this.tx().commit();
}

Fixed version (ground truth):
private SqlG(final Configuration configuration){
  try {
    Class<?> sqlDialectClass=Class.forName(configuration.getString("String_Node_Str"));
    Constructor<?> constructor=sqlDialectClass.getConstructor(Configuration.class);
    this.sqlDialect=(SqlDialect)constructor.newInstance(configuration);
    this.implementForeignKeys=configuration.getBoolean("String_Node_Str",false);
  }
 catch (  Exception e) {
    throw new RuntimeException(e);
  }
  try {
    this.jdbcUrl=configuration.getString("String_Node_Str");
    SqlgDataSource.INSTANCE.setupDataSource(sqlDialect.getJdbcDriver(),configuration.getString("String_Node_Str"),configuration.getString("String_Node_Str"),configuration.getString("String_Node_Str"));
    this.sqlDialect.prepareDB(SqlgDataSource.INSTANCE.get(configuration.getString("String_Node_Str")).getConnection());
  }
 catch (  PropertyVetoException e) {
    throw new RuntimeException(e);
  }
catch (  SQLException e) {
    throw new RuntimeException(e);
  }
  this.sqlgTransaction=new SqlgTransaction(this);
  this.tx().readWrite();
  this.schemaManager=new SchemaManager(this,sqlDialect);
  this.schemaManager.loadSchema();
  if (!this.sqlDialect.supportSchemas() && !this.schemaManager.schemaExist(this.sqlDialect.getPublicSchema())) {
    this.schemaManager.createSchema(this.sqlDialect.getPublicSchema());
  }
  this.schemaManager.ensureGlobalVerticesTableExist();
  this.schemaManager.ensureGlobalEdgesTableExist();
  this.tx().commit();
}
Program: 167132
Project: 167132
Buggy source:
void ensureColumnExist(String schema,String table,ImmutablePair<String,PropertyType> keyValue){
  final Map<String,PropertyType> cachedColumns=this.tables.get(schema + "String_Node_Str" + table);
  final Map<String,PropertyType> uncommitedColumns;
  if (cachedColumns == null) {
    uncommitedColumns=this.uncommittedTables.get(schema + "String_Node_Str" + table);
  }
 else {
    uncommitedColumns=cachedColumns;
  }
  Objects.requireNonNull(uncommitedColumns,"String_Node_Str");
  if (!uncommitedColumns.containsKey(keyValue.left)) {
    if (!this.schemaLock.isHeldByCurrentThread()) {
      this.schemaLock.lock();
    }
    if (!uncommitedColumns.containsKey(keyValue.left)) {
      addColumn(schema,table,keyValue);
      uncommitedColumns.put(keyValue.left,keyValue.right);
      this.uncommittedTables.put(schema + "String_Node_Str" + table,uncommitedColumns);
    }
  }
}

Fixed version (ground truth):
void ensureColumnExist(String schema,String table,ImmutablePair<String,PropertyType> keyValue){
  final Map<String,PropertyType> cachedColumns=this.tables.get(schema + "String_Node_Str" + table);
  Map<String,PropertyType> uncommitedColumns;
  if (cachedColumns == null) {
    uncommitedColumns=this.uncommittedTables.get(schema + "String_Node_Str" + table);
  }
 else {
    uncommitedColumns=this.uncommittedTables.get(schema + "String_Node_Str" + table);
    if (uncommitedColumns != null) {
      uncommitedColumns.putAll(cachedColumns);
    }
 else {
      uncommitedColumns=new HashMap<>(cachedColumns);
    }
  }
  Objects.requireNonNull(uncommitedColumns,"String_Node_Str");
  if (!uncommitedColumns.containsKey(keyValue.left)) {
    if (!this.schemaLock.isHeldByCurrentThread()) {
      this.schemaLock.lock();
    }
    if (!uncommitedColumns.containsKey(keyValue.left)) {
      addColumn(schema,table,keyValue);
      uncommitedColumns.put(keyValue.left,keyValue.right);
      this.uncommittedTables.put(schema + "String_Node_Str" + table,uncommitedColumns);
    }
  }
}
Program: 167133
Project: 167133
Buggy source:
@Override public GraphFeatures graph(){
  return new GraphFeatures(){
    @Override public boolean supportsComputer(){
      return false;
    }
    @Override public VariableFeatures variables(){
      return new SqlVariableFeatures();
    }
    @Override public boolean supportsThreadedTransactions(){
      return false;
    }
    @Override public boolean supportsFullyIsolatedTransactions(){
      return false;
    }
  }
;
}

Fixed version (ground truth):
@Override public GraphFeatures graph(){
  return new GraphFeatures(){
    @Override public boolean supportsComputer(){
      return false;
    }
    @Override public VariableFeatures variables(){
      return new SqlVariableFeatures();
    }
    @Override public boolean supportsThreadedTransactions(){
      return false;
    }
  }
;
}
Program: 167134
Project: 167134
Buggy source:
public Features getFeatures(){
  return new SqlGFeatures();
}

Fixed version (ground truth):
@Override public Features getFeatures(){
  return new SqlGFeatures();
}
Program: 167135
Project: 167135
Buggy source:
@Override public <V extends Variables>V variables(){
  throw Graph.Exceptions.variablesNotSupported();
}

Fixed version (ground truth):
@Override public Variables variables(){
  throw Graph.Exceptions.variablesNotSupported();
}
Program: 167137
Project: 167137
Buggy source:
@Override protected void execute() throws ArchiverException {
  try {
    ModuleManagementTool mmt=new ModuleManagementTool();
    mmt.setVerbose(false);
    if (getDestFile() != null)     getLogger().info("String_Node_Str" + getDestFile());
    if (getDestDirectory() != null)     getLogger().info("String_Node_Str" + getDestDirectory());
    File destLocation=(getDestFile() == null || !getDestFile().exists()) ? getDestDirectory() : getDestFile();
    getLogger().info("String_Node_Str" + getSourceFile() + "String_Node_Str"+ destLocation);
    try {
      mmt.installModule(getSourceFile().getAbsolutePath(),destLocation.getAbsolutePath(),false,true,false);
    }
 catch (    Exception e) {
      throw new MojoExecutionException("String_Node_Str" + getSourceFile().getAbsolutePath() + "String_Node_Str"+ destLocation.getAbsolutePath(),e);
    }
    getLogger().debug("String_Node_Str" + getSourceFile().getAbsolutePath() + "String_Node_Str");
  }
 catch (  Exception e) {
    throw new ArchiverException("String_Node_Str" + getSourceFile().getAbsolutePath(),e);
  }
 finally {
  }
}

Fixed version (ground truth):
@Override protected void execute() throws ArchiverException {
  try {
    File destDirectory=getDestDirectory();
    ModuleManagementTool mmt=new ModuleManagementTool();
    mmt.setVerbose(false);
    if (getDestFile() != null)     getLogger().info("String_Node_Str" + getDestFile());
    if (getDestDirectory() != null)     getLogger().info("String_Node_Str" + destDirectory);
    File destLocation=(getDestFile() == null || !getDestFile().exists()) ? destDirectory : getDestFile();
    getLogger().info("String_Node_Str" + getSourceFile() + "String_Node_Str"+ destLocation);
    try {
      mmt.installModule(getSourceFile().getAbsolutePath(),destLocation.getAbsolutePath(),false,true,false);
    }
 catch (    Exception e) {
      throw new MojoExecutionException("String_Node_Str" + getSourceFile().getAbsolutePath() + "String_Node_Str"+ destLocation.getAbsolutePath(),e);
    }
    getLogger().debug("String_Node_Str" + getSourceFile().getAbsolutePath() + "String_Node_Str");
  }
 catch (  Exception e) {
    throw new ArchiverException("String_Node_Str" + getSourceFile().getAbsolutePath(),e);
  }
 finally {
  }
}
Program: 167138
Project: 167138
Buggy source:
@Override public File getDestDirectory(){
  MavenSession session=legacySupport.getSession();
  MavenProject project=session.getCurrentProject();
  return new File(project.getBuild().getDirectory() + File.separator + project.getBuild().getFinalName());
}

Fixed version (ground truth):
@Override public File getDestDirectory(){
  MavenSession session=legacySupport.getSession();
  MavenProject project=session.getCurrentProject();
  File location=new File(project.getBuild().getDirectory() + File.separator + project.getBuild().getFinalName());
  Plugin warPlugin=project.getPlugin("String_Node_Str");
  if (warPlugin != null) {
    Xpp3Dom warPluginConfig=(Xpp3Dom)warPlugin.getConfiguration();
    if (warPluginConfig != null) {
      Xpp3Dom warConfigElement=warPluginConfig.getChild("String_Node_Str");
      if (warConfigElement != null) {
        String webappDir=warConfigElement.getValue();
        if (webappDir != null && !webappDir.isEmpty()) {
          location=new File(webappDir);
        }
      }
    }
  }
  return location;
}