Program: 65308
Project: 65308
Buggy source:
/** 
 * Print the SQL representation of the statement on a stream.
 */
public Vector printSQL(ExpressionSQLPrinter printer){
  try {
    Vector selectFields=null;
    printer.setRequiresDistinct(shouldDistinctBeUsed());
    printer.printString("String_Node_Str");
    if (getHintString() != null) {
      printer.printString(getHintString());
      printer.printString("String_Node_Str");
    }
    if (shouldDistinctBeUsed()) {
      printer.printString("String_Node_Str");
    }
    selectFields=writeFieldsIn(printer);
    setUseUniqueFieldAliases(false);
    appendFromClauseToWriter(printer);
    if (!(getWhereClause() == null)) {
      printer.printString("String_Node_Str");
      printer.printExpression(getWhereClause());
    }
    if (hasHierarchicalQueryExpressions()) {
      appendHierarchicalQueryClauseToWriter(printer);
    }
    if (hasGroupByExpressions()) {
      appendGroupByClauseToWriter(printer);
    }
    if (hasHavingExpression()) {
      printer.printString("String_Node_Str");
      printer.printExpression(getHavingExpression());
    }
    if (hasOrderByExpressions()) {
      appendOrderClauseToWriter(printer);
    }
    if (printer.getPlatform().shouldPrintLockingClauseAfterWhereClause()) {
      if (getForUpdateClause() != null) {
        getForUpdateClause().printSQL(printer,this);
      }
    }
    if (hasUnionExpressions()) {
      appendUnionClauseToWriter(printer);
    }
    return selectFields;
  }
 catch (  IOException exception) {
    throw ValidationException.fileError(exception);
  }
}

Fixed version (ground truth):
/** 
 * Print the SQL representation of the statement on a stream.
 */
public Vector printSQL(ExpressionSQLPrinter printer){
  try {
    Vector selectFields=null;
    printer.setRequiresDistinct(shouldDistinctBeUsed());
    if (hasUnionExpressions()) {
      int size=getUnionExpressions().size();
      for (int index=0; index < size; index++) {
        printer.printString("String_Node_Str");
      }
    }
    printer.printString("String_Node_Str");
    if (getHintString() != null) {
      printer.printString(getHintString());
      printer.printString("String_Node_Str");
    }
    if (shouldDistinctBeUsed()) {
      printer.printString("String_Node_Str");
    }
    selectFields=writeFieldsIn(printer);
    setUseUniqueFieldAliases(false);
    appendFromClauseToWriter(printer);
    if (!(getWhereClause() == null)) {
      printer.printString("String_Node_Str");
      printer.printExpression(getWhereClause());
    }
    if (hasHierarchicalQueryExpressions()) {
      appendHierarchicalQueryClauseToWriter(printer);
    }
    if (hasGroupByExpressions()) {
      appendGroupByClauseToWriter(printer);
    }
    if (hasHavingExpression()) {
      printer.printString("String_Node_Str");
      printer.printExpression(getHavingExpression());
    }
    if (hasOrderByExpressions()) {
      appendOrderClauseToWriter(printer);
    }
    if (printer.getPlatform().shouldPrintLockingClauseAfterWhereClause()) {
      if (getForUpdateClause() != null) {
        getForUpdateClause().printSQL(printer,this);
      }
    }
    if (hasUnionExpressions()) {
      appendUnionClauseToWriter(printer);
    }
    return selectFields;
  }
 catch (  IOException exception) {
    throw ValidationException.fileError(exception);
  }
}