Program: 167105
Project: 167105
Buggy source:
@Override public void flushVertexPropertyCache(SqlgGraph sqlgGraph,Map<SchemaTable,Pair<SortedSet<String>,Map<SqlgVertex,Map<String,Object>>>> schemaVertexPropertyCache){
  Connection conn=sqlgGraph.tx().getConnection();
  for (  SchemaTable schemaTable : schemaVertexPropertyCache.keySet()) {
    Pair<SortedSet<String>,Map<SqlgVertex,Map<String,Object>>> vertexKeysPropertyCache=schemaVertexPropertyCache.get(schemaTable);
    SortedSet<String> keys=vertexKeysPropertyCache.getLeft();
    Map<SqlgVertex,Map<String,Object>> vertexPropertyCache=vertexKeysPropertyCache.getRight();
    StringBuilder sql=new StringBuilder();
    sql.append("String_Node_Str");
    sql.append(maybeWrapInQoutes(schemaTable.getSchema()));
    sql.append("String_Node_Str");
    sql.append(maybeWrapInQoutes(SchemaManager.VERTEX_PREFIX + schemaTable.getTable()));
    sql.append("String_Node_Str");
    int count=1;
    for (    String key : keys) {
      sql.append(maybeWrapInQoutes(key));
      if (count++ < keys.size()) {
        sql.append("String_Node_Str");
      }
    }
    sql.append("String_Node_Str");
    count=1;
    for (    String key : keys) {
      sql.append("String_Node_Str");
      sql.append(maybeWrapInQoutes(key));
      if (count++ < keys.size()) {
        sql.append("String_Node_Str");
      }
    }
    sql.append("String_Node_Str");
    count=1;
    for (    SqlgVertex sqlgVertex : vertexPropertyCache.keySet()) {
      Map<String,Object> properties=vertexPropertyCache.get(sqlgVertex);
      sql.append("String_Node_Str");
      sql.append(sqlgVertex.id());
      sql.append("String_Node_Str");
      int countProperties=1;
      for (      String key : keys) {
        Object value=properties.get(key);
        if (value != null) {
          PropertyType propertyType=PropertyType.from(value);
switch (propertyType) {
case BOOLEAN:
            sql.append(value);
          break;
case BYTE:
        sql.append(value);
      break;
case SHORT:
    sql.append(value);
  break;
case INTEGER:
sql.append(value);
break;
case LONG:
sql.append(value);
break;
case FLOAT:
sql.append(value);
break;
case DOUBLE:
sql.append(value);
break;
case STRING:
sql.append("String_Node_Str");
sql.append(value);
sql.append("String_Node_Str");
break;
case BOOLEAN_ARRAY:
break;
case BYTE_ARRAY:
break;
case SHORT_ARRAY:
break;
case INTEGER_ARRAY:
break;
case LONG_ARRAY:
break;
case FLOAT_ARRAY:
break;
case DOUBLE_ARRAY:
break;
case STRING_ARRAY:
break;
default :
throw new IllegalStateException("String_Node_Str" + propertyType.name());
}
}
 else {
sql.append("String_Node_Str");
}
if (countProperties++ < keys.size()) {
sql.append("String_Node_Str");
}
}
sql.append("String_Node_Str");
if (count++ < vertexPropertyCache.size()) {
sql.append("String_Node_Str");
}
sqlgVertex.reset();
}
sql.append("String_Node_Str");
count=1;
for (String key : keys) {
sql.append(maybeWrapInQoutes(key));
if (count++ < keys.size()) {
sql.append("String_Node_Str");
}
}
sql.append("String_Node_Str");
sql.append("String_Node_Str");
if (logger.isDebugEnabled()) {
logger.debug(sql.toString());
}
try (Statement statement=conn.createStatement()){
statement.execute(sql.toString());
}
 catch (SQLException e) {
throw new RuntimeException(e);
}
}
}

Fixed version (ground truth):
@Override public void flushVertexPropertyCache(SqlgGraph sqlgGraph,Map<SchemaTable,Pair<SortedSet<String>,Map<SqlgVertex,Map<String,Object>>>> schemaVertexPropertyCache){
  Connection conn=sqlgGraph.tx().getConnection();
  for (  SchemaTable schemaTable : schemaVertexPropertyCache.keySet()) {
    Pair<SortedSet<String>,Map<SqlgVertex,Map<String,Object>>> vertexKeysPropertyCache=schemaVertexPropertyCache.get(schemaTable);
    SortedSet<String> keys=vertexKeysPropertyCache.getLeft();
    Map<SqlgVertex,Map<String,Object>> vertexPropertyCache=vertexKeysPropertyCache.getRight();
    StringBuilder sql=new StringBuilder();
    sql.append("String_Node_Str");
    sql.append(maybeWrapInQoutes(schemaTable.getSchema()));
    sql.append("String_Node_Str");
    sql.append(maybeWrapInQoutes(SchemaManager.VERTEX_PREFIX + schemaTable.getTable()));
    sql.append("String_Node_Str");
    int count=1;
    for (    String key : keys) {
      sql.append(maybeWrapInQoutes(key));
      if (count++ < keys.size()) {
        sql.append("String_Node_Str");
      }
    }
    sql.append("String_Node_Str");
    count=1;
    for (    String key : keys) {
      sql.append("String_Node_Str");
      sql.append(maybeWrapInQoutes(key));
      if (count++ < keys.size()) {
        sql.append("String_Node_Str");
      }
    }
    sql.append("String_Node_Str");
    count=1;
    for (    SqlgVertex sqlgVertex : vertexPropertyCache.keySet()) {
      Map<String,Object> properties=vertexPropertyCache.get(sqlgVertex);
      sql.append("String_Node_Str");
      sql.append(sqlgVertex.id());
      sql.append("String_Node_Str");
      int countProperties=1;
      for (      String key : keys) {
        Object value=properties.get(key);
        if (value != null) {
          PropertyType propertyType=PropertyType.from(value);
switch (propertyType) {
case BOOLEAN:
            sql.append(value);
          break;
case BYTE:
        sql.append(value);
      break;
case SHORT:
    sql.append(value);
  break;
case INTEGER:
sql.append(value);
break;
case LONG:
sql.append(value);
break;
case FLOAT:
sql.append(value);
break;
case DOUBLE:
sql.append(value);
break;
case STRING:
sql.append("String_Node_Str");
sql.append(value);
sql.append("String_Node_Str");
break;
case BOOLEAN_ARRAY:
break;
case BYTE_ARRAY:
break;
case SHORT_ARRAY:
break;
case INTEGER_ARRAY:
break;
case LONG_ARRAY:
break;
case FLOAT_ARRAY:
break;
case DOUBLE_ARRAY:
break;
case STRING_ARRAY:
break;
default :
throw new IllegalStateException("String_Node_Str" + propertyType.name());
}
}
 else {
if (sqlgVertex.property(key).isPresent()) {
sql.append("String_Node_Str");
sql.append((Object)sqlgVertex.value(key));
sql.append("String_Node_Str");
}
 else {
sql.append("String_Node_Str");
}
}
if (countProperties++ < keys.size()) {
sql.append("String_Node_Str");
}
}
sql.append("String_Node_Str");
if (count++ < vertexPropertyCache.size()) {
sql.append("String_Node_Str");
}
sqlgVertex.reset();
}
sql.append("String_Node_Str");
count=1;
for (String key : keys) {
sql.append(maybeWrapInQoutes(key));
if (count++ < keys.size()) {
sql.append("String_Node_Str");
}
}
sql.append("String_Node_Str");
sql.append("String_Node_Str");
if (logger.isDebugEnabled()) {
logger.debug(sql.toString());
}
try (Statement statement=conn.createStatement()){
statement.execute(sql.toString());
}
 catch (SQLException e) {
throw new RuntimeException(e);
}
}
}