Program: 30731
Project: 30731
Buggy source:
private void parseSelectClause(QueryModel model) throws ParserException {
  CharSequence tok;
  while (true) {
    tok=tok("String_Node_Str");
    final ExprNode expr;
    final char last=tok.charAt(tok.length() - 1);
    if (last == '*') {
      expr=exprNodePool.next().of(ExprNode.LITERAL,Chars.toString(tok),0,lexer.position());
    }
 else     if (last == '.') {
      final int pos=lexer.position() + tok.length();
      columnNameAssembly.clear();
      columnNameAssembly.put(tok);
      tok=tok("String_Node_Str");
      if (Chars.equals(tok,'*')) {
        if (lexer.position() > pos) {
          throw ParserException.$(pos,"String_Node_Str");
        }
        columnNameAssembly.put('*');
        expr=exprNodePool.next().of(ExprNode.LITERAL,columnNameAssembly.toString(),0,lexer.position());
      }
 else {
        throw ParserException.$(pos,"String_Node_Str");
      }
    }
 else {
      lexer.unparse();
      expr=expr();
      if (expr == null) {
        throw ParserException.$(lexer.position(),"String_Node_Str");
      }
    }
    String alias;
    int aliasPosition=lexer.position();
    tok=tok("String_Node_Str");
    if (!columnAliasStop.contains(tok)) {
      if (Chars.indexOf(tok,'.') != -1) {
        throw ParserException.$(aliasPosition,"String_Node_Str");
      }
      alias=Chars.toString(tok);
      tok=tok("String_Node_Str");
    }
 else {
      alias=createColumnAlias(expr,model);
      aliasPosition=-1;
    }
    if (Chars.equals(tok,"String_Node_Str")) {
      expectTok('(');
      AnalyticColumn col=analyticColumnPool.next().of(alias,aliasPosition,expr);
      tok=tok("String_Node_Str");
      if (Chars.equals(tok,"String_Node_Str")) {
        expectTok("String_Node_Str");
        ObjList<ExprNode> partitionBy=col.getPartitionBy();
        do {
          partitionBy.add(expectLiteral());
          tok=tok("String_Node_Str");
        }
 while (Chars.equals(tok,','));
      }
      if (Chars.equals(tok,"String_Node_Str")) {
        expectTok("String_Node_Str");
        do {
          ExprNode e=expectLiteral();
          tok=tok("String_Node_Str");
          if (Chars.equalsIgnoreCase(tok,"String_Node_Str")) {
            col.addOrderBy(e,QueryModel.ORDER_DIRECTION_DESCENDING);
            tok=tok("String_Node_Str");
          }
 else {
            col.addOrderBy(e,QueryModel.ORDER_DIRECTION_ASCENDING);
            if (Chars.equalsIgnoreCase(tok,"String_Node_Str")) {
              tok=tok("String_Node_Str");
            }
          }
        }
 while (Chars.equals(tok,','));
      }
      expectTok(tok,lexer.position(),')');
      model.addColumn(col);
      tok=tok("String_Node_Str");
    }
 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 parseSelectClause(QueryModel model) throws ParserException {
  CharSequence tok;
  while (true) {
    tok=tok("String_Node_Str");
    final ExprNode expr;
    final char last=tok.charAt(tok.length() - 1);
    if (last == '*') {
      expr=exprNodePool.next().of(ExprNode.LITERAL,Chars.toString(tok),0,lexer.position());
    }
 else     if (last == '.') {
      final int pos=lexer.position() + tok.length();
      columnNameAssembly.clear();
      columnNameAssembly.put(tok);
      tok=tok("String_Node_Str");
      if (Chars.equals(tok,'*')) {
        if (lexer.position() > pos) {
          throw ParserException.$(pos,"String_Node_Str");
        }
        columnNameAssembly.put('*');
        expr=exprNodePool.next().of(ExprNode.LITERAL,columnNameAssembly.toString(),0,lexer.position());
      }
 else {
        throw ParserException.$(pos,"String_Node_Str");
      }
    }
 else {
      lexer.unparse();
      expr=expr();
      if (expr == null) {
        throw ParserException.$(lexer.position(),"String_Node_Str");
      }
    }
    String alias;
    tok=tok("String_Node_Str");
    if (!columnAliasStop.contains(tok)) {
      if (Chars.indexOf(tok,'.') != -1) {
        throw ParserException.$(lexer.position(),"String_Node_Str");
      }
      alias=Chars.toString(tok);
      tok=tok("String_Node_Str");
    }
 else {
      alias=createColumnAlias(expr,model);
    }
    if (Chars.equals(tok,"String_Node_Str")) {
      expectTok('(');
      AnalyticColumn col=analyticColumnPool.next().of(alias,expr);
      tok=tok("String_Node_Str");
      if (Chars.equals(tok,"String_Node_Str")) {
        expectTok("String_Node_Str");
        ObjList<ExprNode> partitionBy=col.getPartitionBy();
        do {
          partitionBy.add(expectLiteral());
          tok=tok("String_Node_Str");
        }
 while (Chars.equals(tok,','));
      }
      if (Chars.equals(tok,"String_Node_Str")) {
        expectTok("String_Node_Str");
        do {
          ExprNode e=expectLiteral();
          tok=tok("String_Node_Str");
          if (Chars.equalsIgnoreCase(tok,"String_Node_Str")) {
            col.addOrderBy(e,QueryModel.ORDER_DIRECTION_DESCENDING);
            tok=tok("String_Node_Str");
          }
 else {
            col.addOrderBy(e,QueryModel.ORDER_DIRECTION_ASCENDING);
            if (Chars.equalsIgnoreCase(tok,"String_Node_Str")) {
              tok=tok("String_Node_Str");
            }
          }
        }
 while (Chars.equals(tok,','));
      }
      expectTok(tok,lexer.position(),')');
      model.addColumn(col);
      tok=tok("String_Node_Str");
    }
 else {
      model.addColumn(queryColumnPool.next().of(alias,expr));
    }
    if (Chars.equals(tok,"String_Node_Str")) {
      break;
    }
    if (!Chars.equals(tok,',')) {
      throw err("String_Node_Str");
    }
  }
}