Program: 167085
Project: 167085
Buggy source:
private String toOrderByClause(SqlgGraph sqlgGraph,MutableBoolean printedOrderBy,int counter){
  String result="String_Node_Str";
  for (  Comparator comparator : this.getComparators()) {
    if (!printedOrderBy.booleanValue()) {
      printedOrderBy.setTrue();
      result+="String_Node_Str";
    }
 else {
      result+="String_Node_Str";
    }
    if (comparator instanceof ElementValueComparator) {
      ElementValueComparator elementValueComparator=(ElementValueComparator)comparator;
      String prefix=this.getSchemaTable().getSchema();
      prefix+="String_Node_Str";
      prefix+=this.getSchemaTable().getTable();
      prefix+="String_Node_Str";
      prefix+=elementValueComparator.getPropertyKey();
      String alias;
      if (counter == -1) {
        alias=sqlgGraph.getSqlDialect().maybeWrapInQoutes(threadLocalColumnNameAliasMap.get().get(prefix).iterator().next());
      }
 else {
        alias="String_Node_Str" + counter + "String_Node_Str"+ sqlgGraph.getSqlDialect().maybeWrapInQoutes(threadLocalColumnNameAliasMap.get().get(prefix).iterator().next());
      }
      result+="String_Node_Str" + alias;
      if (elementValueComparator.getValueComparator() == Order.incr) {
        result+="String_Node_Str";
      }
 else       if (elementValueComparator.getValueComparator() == Order.decr) {
        result+="String_Node_Str";
      }
 else {
        throw new RuntimeException("String_Node_Str" + elementValueComparator.getValueComparator().toString());
      }
    }
 else     if (comparator instanceof TraversalComparator) {
      TraversalComparator traversalComparator=(TraversalComparator)comparator;
      Preconditions.checkState(traversalComparator.getTraversal().getSteps().size() == 1,"String_Node_Str");
      Preconditions.checkState(traversalComparator.getTraversal().getSteps().get(0) instanceof SelectOneStep,"String_Node_Str");
      SelectOneStep selectOneStep=(SelectOneStep)traversalComparator.getTraversal().getSteps().get(0);
      Preconditions.checkState(selectOneStep.getScopeKeys().size() == 1,"String_Node_Str");
      Preconditions.checkState(selectOneStep.getLocalChildren().size() == 1,"String_Node_Str");
      Preconditions.checkState(selectOneStep.getLocalChildren().get(0) instanceof ElementValueTraversal,"String_Node_Str");
      SchemaTableTree selectSchemaTableTree=findSelectSchemaTable((String)selectOneStep.getScopeKeys().iterator().next());
      ElementValueTraversal elementValueTraversal=(ElementValueTraversal)selectOneStep.getLocalChildren().get(0);
      String prefix;
      if (counter != -1) {
        prefix="String_Node_Str";
      }
 else {
        prefix=selectSchemaTableTree.labels.iterator().next();
        prefix+="String_Node_Str";
      }
      prefix+=selectSchemaTableTree.getSchemaTable().getSchema();
      prefix+="String_Node_Str";
      prefix+=selectSchemaTableTree.getSchemaTable().getTable();
      prefix+="String_Node_Str";
      prefix+=elementValueTraversal.getPropertyKey();
      String alias;
      if (counter == -1) {
        alias=sqlgGraph.getSqlDialect().maybeWrapInQoutes(threadLocalColumnNameAliasMap.get().get(prefix).iterator().next());
      }
 else {
        alias="String_Node_Str" + counter + "String_Node_Str"+ sqlgGraph.getSqlDialect().maybeWrapInQoutes(threadLocalColumnNameAliasMap.get().get(prefix).iterator().next());
      }
      result+="String_Node_Str" + alias;
      if (traversalComparator.getComparator() == Order.incr) {
        result+="String_Node_Str";
      }
 else       if (traversalComparator.getComparator() == Order.decr) {
        result+="String_Node_Str";
      }
 else {
        throw new RuntimeException("String_Node_Str" + traversalComparator.getComparator().toString());
      }
    }
  }
  return result;
}

Fixed version (ground truth):
private String toOrderByClause(SqlgGraph sqlgGraph,MutableBoolean printedOrderBy,int counter){
  String result="String_Node_Str";
  for (  Comparator comparator : this.getComparators()) {
    if (!printedOrderBy.booleanValue()) {
      printedOrderBy.setTrue();
      result+="String_Node_Str";
    }
 else {
      result+="String_Node_Str";
    }
    if (comparator instanceof ElementValueComparator) {
      ElementValueComparator elementValueComparator=(ElementValueComparator)comparator;
      String prefix=this.getSchemaTable().getSchema();
      prefix+="String_Node_Str";
      prefix+=this.getSchemaTable().getTable();
      prefix+="String_Node_Str";
      prefix+=elementValueComparator.getPropertyKey();
      String alias;
      if (counter == -1) {
        alias=sqlgGraph.getSqlDialect().maybeWrapInQoutes(threadLocalColumnNameAliasMap.get().get(prefix).iterator().next());
      }
 else {
        alias="String_Node_Str" + counter + "String_Node_Str"+ sqlgGraph.getSqlDialect().maybeWrapInQoutes(threadLocalColumnNameAliasMap.get().get(prefix).iterator().next());
      }
      result+="String_Node_Str" + alias;
      if (elementValueComparator.getValueComparator() == Order.incr) {
        result+="String_Node_Str";
      }
 else       if (elementValueComparator.getValueComparator() == Order.decr) {
        result+="String_Node_Str";
      }
 else {
        throw new RuntimeException("String_Node_Str" + elementValueComparator.getValueComparator().toString());
      }
    }
 else     if (comparator instanceof TraversalComparator) {
      TraversalComparator traversalComparator=(TraversalComparator)comparator;
      Preconditions.checkState(traversalComparator.getTraversal().getSteps().size() == 1,"String_Node_Str");
      Preconditions.checkState(traversalComparator.getTraversal().getSteps().get(0) instanceof SelectOneStep,"String_Node_Str");
      SelectOneStep selectOneStep=(SelectOneStep)traversalComparator.getTraversal().getSteps().get(0);
      Preconditions.checkState(selectOneStep.getScopeKeys().size() == 1,"String_Node_Str");
      Preconditions.checkState(selectOneStep.getLocalChildren().size() == 1,"String_Node_Str");
      Preconditions.checkState(selectOneStep.getLocalChildren().get(0) instanceof ElementValueTraversal,"String_Node_Str");
      SchemaTableTree selectSchemaTableTree=findSelectSchemaTable((String)selectOneStep.getScopeKeys().iterator().next());
      ElementValueTraversal elementValueTraversal=(ElementValueTraversal)selectOneStep.getLocalChildren().get(0);
      String prefix;
      if (selectSchemaTableTree.children.isEmpty()) {
        prefix="String_Node_Str";
      }
 else {
        prefix=selectSchemaTableTree.labels.iterator().next();
        prefix+="String_Node_Str";
      }
      prefix+=selectSchemaTableTree.getSchemaTable().getSchema();
      prefix+="String_Node_Str";
      prefix+=selectSchemaTableTree.getSchemaTable().getTable();
      prefix+="String_Node_Str";
      prefix+=elementValueTraversal.getPropertyKey();
      String alias;
      if (counter == -1) {
        alias=sqlgGraph.getSqlDialect().maybeWrapInQoutes(threadLocalColumnNameAliasMap.get().get(prefix).iterator().next());
      }
 else {
        alias="String_Node_Str" + selectSchemaTableTree.stepDepth + "String_Node_Str"+ sqlgGraph.getSqlDialect().maybeWrapInQoutes(threadLocalColumnNameAliasMap.get().get(prefix).iterator().next());
      }
      result+="String_Node_Str" + alias;
      if (traversalComparator.getComparator() == Order.incr) {
        result+="String_Node_Str";
      }
 else       if (traversalComparator.getComparator() == Order.decr) {
        result+="String_Node_Str";
      }
 else {
        throw new RuntimeException("String_Node_Str" + traversalComparator.getComparator().toString());
      }
    }
  }
  return result;
}