Program: 31246
Project: 31246
Buggy source:
private ParsedModel parseCreateJournal() throws ParserException {
  String name=tok().toString();
  CharSequence tok=tok();
  final JournalStructure struct;
  final QueryModel queryModel;
  if (Chars.equals(tok,'(')) {
    queryModel=null;
    struct=new JournalStructure(name);
    lexer.unparse();
    parseJournalFields(struct);
  }
 else   if (Chars.equals(tok,"String_Node_Str")) {
    expectTok(tok(),'(');
    queryModel=parseQuery(true);
    struct=null;
    expectTok(tok(),')');
  }
 else {
    throw QueryError.position(lexer.position()).$("String_Node_Str").$();
  }
  CreateJournalModel model=createJournalModelPool.next();
  model.setStruct(struct);
  model.setQueryModel(queryModel);
  model.setName(name);
  tok=lexer.optionTok();
  while (tok != null && Chars.equals(tok,',')) {
    expectTok(tok(),"String_Node_Str");
    expectTok(tok(),'(');
    ColumnIndexModel columnIndexModel=columnIndexModelPool.next();
    columnIndexModel.setName(expectExpr());
    tok=tok();
    if (Chars.equals(tok,"String_Node_Str")) {
      int pos=lexer.position();
      try {
        columnIndexModel.setBuckets(Numbers.ceilPow2(Numbers.parseInt(tok())) - 1);
      }
 catch (      NumericException e) {
        throw QueryError.$(pos,"String_Node_Str");
      }
      tok=tok();
    }
    expectTok(tok,')');
    model.addColumnIndexModel(columnIndexModel);
    tok=lexer.optionTok();
  }
  ExprNode timestamp=parseTimestamp(tok);
  if (timestamp != null) {
    model.setTimestamp(timestamp);
    tok=lexer.optionTok();
  }
  ExprNode partitionBy=parsePartitionBy(tok);
  if (partitionBy != null) {
    model.setPartitionBy(partitionBy);
    tok=lexer.optionTok();
  }
  ExprNode hint=parseRecordHint(tok);
  if (hint != null) {
    model.setRecordHint(hint);
    tok=lexer.optionTok();
  }
  if (tok != null) {
    throw QueryError.$(lexer.position(),"String_Node_Str");
  }
  return model;
}

Fixed version (ground truth):
private ParsedModel parseCreateJournal() throws ParserException {
  ExprNode name=exprNodePool.next();
  name.token=tok().toString();
  name.position=lexer.position();
  name.type=ExprNode.LITERAL;
  CharSequence tok=tok();
  final JournalStructure struct;
  final QueryModel queryModel;
  if (Chars.equals(tok,'(')) {
    queryModel=null;
    struct=new JournalStructure(name.token);
    lexer.unparse();
    parseJournalFields(struct);
  }
 else   if (Chars.equals(tok,"String_Node_Str")) {
    expectTok(tok(),'(');
    queryModel=parseQuery(true);
    struct=null;
    expectTok(tok(),')');
  }
 else {
    throw QueryError.position(lexer.position()).$("String_Node_Str").$();
  }
  CreateJournalModel model=createJournalModelPool.next();
  model.setStruct(struct);
  model.setQueryModel(queryModel);
  model.setName(name);
  tok=lexer.optionTok();
  while (tok != null && Chars.equals(tok,',')) {
    expectTok(tok(),"String_Node_Str");
    expectTok(tok(),'(');
    ColumnIndexModel columnIndexModel=columnIndexModelPool.next();
    columnIndexModel.setName(expectExpr());
    tok=tok();
    if (Chars.equals(tok,"String_Node_Str")) {
      int pos=lexer.position();
      try {
        columnIndexModel.setBuckets(Numbers.ceilPow2(Numbers.parseInt(tok())) - 1);
      }
 catch (      NumericException e) {
        throw QueryError.$(pos,"String_Node_Str");
      }
      tok=tok();
    }
    expectTok(tok,')');
    model.addColumnIndexModel(columnIndexModel);
    tok=lexer.optionTok();
  }
  ExprNode timestamp=parseTimestamp(tok);
  if (timestamp != null) {
    model.setTimestamp(timestamp);
    tok=lexer.optionTok();
  }
  ExprNode partitionBy=parsePartitionBy(tok);
  if (partitionBy != null) {
    model.setPartitionBy(partitionBy);
    tok=lexer.optionTok();
  }
  ExprNode hint=parseRecordHint(tok);
  if (hint != null) {
    model.setRecordHint(hint);
    tok=lexer.optionTok();
  }
  if (tok != null) {
    throw QueryError.$(lexer.position(),"String_Node_Str");
  }
  return model;
}