Program: 30739
Project: 30739
Buggy source:
private void parseSelectColumns(QueryModel model) throws ParserException {
  CharSequence tok;
  while (true) {
    ExprNode expr=expr();
    if (expr == null) {
      throw ParserException.$(lexer.position(),"String_Node_Str");
    }
    String alias;
    int aliasPosition=lexer.position();
    tok=tok();
    if (!columnAliasStop.contains(tok)) {
      alias=tok.toString();
      tok=tok();
    }
 else {
      alias=null;
      aliasPosition=-1;
    }
    if (Chars.equals(tok,"String_Node_Str")) {
      expectTok('(');
      AnalyticColumn col=analyticColumnPool.next().of(alias,aliasPosition,expr);
      tok=tok();
      if (Chars.equals(tok,"String_Node_Str")) {
        expectTok(tok(),"String_Node_Str");
        ObjList<ExprNode> partitionBy=col.getPartitionBy();
        do {
          partitionBy.add(expectLiteral());
          tok=tok();
        }
 while (Chars.equals(tok,','));
      }
      if (Chars.equals(tok,"String_Node_Str")) {
        expectTok(tok(),"String_Node_Str");
        do {
          ExprNode e=expectLiteral();
          tok=tok();
          if (Chars.equalsIgnoreCase(tok,"String_Node_Str")) {
            col.addOrderBy(e,QueryModel.ORDER_DIRECTION_DESCENDING);
            tok=tok();
          }
 else {
            col.addOrderBy(e,QueryModel.ORDER_DIRECTION_ASCENDING);
            if (Chars.equalsIgnoreCase(tok,"String_Node_Str")) {
              tok=tok();
            }
          }
        }
 while (Chars.equals(tok,','));
      }
      if (!Chars.equals(tok,')')) {
        throw err("String_Node_Str");
      }
      model.addColumn(col);
      tok=tok();
    }
 else {
      model.addColumn(queryColumnPool.next().of(alias,aliasPosition,expr));
    }
    if (Chars.equals(tok,"String_Node_Str")) {
      break;
    }
    if (!Chars.equals(tok,',')) {
      throw err("String_Node_Str");
    }
  }
}

Fixed version (ground truth):
private void parseSelectColumns(QueryModel model) throws ParserException {
  CharSequence tok;
  while (true) {
    ExprNode expr=expr();
    if (expr == null) {
      throw ParserException.$(lexer.position(),"String_Node_Str");
    }
    String alias;
    int aliasPosition=lexer.position();
    tok=tok();
    if (!columnAliasStop.contains(tok)) {
      alias=tok.toString();
      tok=tok();
    }
 else {
      alias=null;
      aliasPosition=-1;
    }
    if (Chars.equals(tok,"String_Node_Str")) {
      expectTok('(');
      AnalyticColumn col=analyticColumnPool.next().of(alias,aliasPosition,expr);
      tok=tok();
      if (Chars.equals(tok,"String_Node_Str")) {
        expectTok("String_Node_Str");
        ObjList<ExprNode> partitionBy=col.getPartitionBy();
        do {
          partitionBy.add(expectLiteral());
          tok=tok();
        }
 while (Chars.equals(tok,','));
      }
      if (Chars.equals(tok,"String_Node_Str")) {
        expectTok("String_Node_Str");
        do {
          ExprNode e=expectLiteral();
          tok=tok();
          if (Chars.equalsIgnoreCase(tok,"String_Node_Str")) {
            col.addOrderBy(e,QueryModel.ORDER_DIRECTION_DESCENDING);
            tok=tok();
          }
 else {
            col.addOrderBy(e,QueryModel.ORDER_DIRECTION_ASCENDING);
            if (Chars.equalsIgnoreCase(tok,"String_Node_Str")) {
              tok=tok();
            }
          }
        }
 while (Chars.equals(tok,','));
      }
      if (!Chars.equals(tok,')')) {
        throw err("String_Node_Str");
      }
      model.addColumn(col);
      tok=tok();
    }
 else {
      model.addColumn(queryColumnPool.next().of(alias,aliasPosition,expr));
    }
    if (Chars.equals(tok,"String_Node_Str")) {
      break;
    }
    if (!Chars.equals(tok,',')) {
      throw err("String_Node_Str");
    }
  }
}