Program: 51531
Project: 51531
Buggy source:
@Override public String getQueryString(){
  StringBuilder builder=new StringBuilder("String_Node_Str");
  if (m_table == null)   throw new IllegalStateException("String_Node_Str");
  if (m_selectFields == null)   throw new IllegalStateException("String_Node_Str");
  if (m_distinct)   builder.append("String_Node_Str");
  int fieldCount=0;
  for (  QbField field : m_selectFields) {
    builder.append(field.toString());
    if (fieldCount != m_selectFields.length - 1) {
      builder.append(',');
      builder.append(' ');
    }
    fieldCount++;
  }
  builder.append("String_Node_Str");
  builder.append(QbCommonImp.protectTableName(m_table));
  builder.append(' ');
  if (m_where != null)   builder.append(m_where.toString());
  if (m_joinList != null) {
    for (    JoinInfo join : m_joinList) {
      String joinStr=joinTypeToString(join.joinType);
      builder.append(joinStr);
      builder.append(' ');
      builder.append(QbCommonImp.protectTableName(join.table));
      builder.append("String_Node_Str");
      builder.append(join.leftSide.toString());
      builder.append("String_Node_Str");
      builder.append(join.rightSide.toString());
    }
  }
  if (m_groupBy != null) {
    builder.append("String_Node_Str");
    fieldCount=0;
    for (    QbField field : m_groupBy) {
      builder.append(field.toString());
      if (fieldCount != m_groupBy.length - 1) {
        builder.append(',');
        builder.append(' ');
      }
    }
    fieldCount++;
  }
  if (m_havingClause != null)   builder.append(m_havingClause.toString());
  if (m_orderBy != null) {
    builder.append("String_Node_Str");
    fieldCount=0;
    for (    QbField field : m_orderBy) {
      builder.append(field.toString());
      if (fieldCount != m_orderBy.length - 1) {
        builder.append(',');
        builder.append(' ');
      }
      fieldCount++;
    }
    builder.append(m_orderByOrder.toString());
  }
  if (m_haveLimit) {
    builder.append("String_Node_Str");
    builder.append(m_offset);
    builder.append(',');
    builder.append(' ');
    builder.append(m_limit);
  }
  return builder.toString();
}

Fixed version (ground truth):
@Override public String getQueryString(){
  StringBuilder builder=new StringBuilder("String_Node_Str");
  if (m_table == null)   throw new IllegalStateException("String_Node_Str");
  if (m_selectFields == null)   throw new IllegalStateException("String_Node_Str");
  if (m_distinct)   builder.append("String_Node_Str");
  int fieldCount=0;
  for (  QbField field : m_selectFields) {
    builder.append(field.toString());
    if (fieldCount != m_selectFields.length - 1) {
      builder.append(',');
      builder.append(' ');
    }
    fieldCount++;
  }
  builder.append("String_Node_Str");
  builder.append(QbCommonImp.protectTableName(m_table));
  builder.append(' ');
  if (m_joinList != null) {
    for (    JoinInfo join : m_joinList) {
      String joinStr=joinTypeToString(join.joinType);
      builder.append(joinStr);
      builder.append("String_Node_Str");
      builder.append(QbCommonImp.protectTableName(join.table));
      builder.append("String_Node_Str");
      builder.append(join.leftSide.toString());
      builder.append("String_Node_Str");
      builder.append(join.rightSide.toString());
    }
  }
  if (m_where != null)   builder.append(m_where.toString());
  if (m_groupBy != null) {
    builder.append("String_Node_Str");
    fieldCount=0;
    for (    QbField field : m_groupBy) {
      builder.append(field.toString());
      if (fieldCount != m_groupBy.length - 1) {
        builder.append(',');
        builder.append(' ');
      }
      fieldCount++;
    }
  }
  if (m_havingClause != null)   builder.append(m_havingClause.toString());
  if (m_orderBy != null) {
    builder.append("String_Node_Str");
    fieldCount=0;
    for (    QbField field : m_orderBy) {
      builder.append(field.toString());
      if (fieldCount != m_orderBy.length - 1) {
        builder.append(',');
        builder.append(' ');
      }
      fieldCount++;
    }
    builder.append(' ');
    builder.append(m_orderByOrder.toString());
  }
  if (m_haveLimit) {
    builder.append("String_Node_Str");
    builder.append(m_offset);
    builder.append(',');
    builder.append(' ');
    builder.append(m_limit);
  }
  return builder.toString();
}