Program: 169122
Project: 169122
Buggy source:
public final Program program() throws RecognitionException {
  Program program=null;
  Token j=null;
  Token a=null;
  QueryMeta s1=null;
  QueryMeta s2=null;
  program=new Program();
  try {
{
{
        pushFollow(FOLLOW_statement_in_program42);
        s1=statement();
        state._fsp--;
      }
      program.listOfQueries.add(s1);
{
        match(input,WS,FOLLOW_WS_in_program52);
        j=input.LT(1);
        if (input.LA(1) == JOIN || input.LA(1) == LEFT_JOIN || input.LA(1) == RIGHT_JOIN) {
          input.consume();
          state.errorRecovery=false;
        }
 else {
          MismatchedSetException mse=new MismatchedSetException(null,input);
          throw mse;
        }
        program.joinTypes.add((j != null ? j.getText() : null).toUpperCase());
        int alt1=2;
        int LA1_0=input.LA(1);
        if ((LA1_0 == WS)) {
          alt1=1;
        }
switch (alt1) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_program66);
          }
        break;
    }
    match(input,LPARAN,FOLLOW_LPARAN_in_program69);
    int alt2=2;
    int LA2_0=input.LA(1);
    if ((LA2_0 == WS)) {
      alt2=1;
    }
switch (alt2) {
case 1:
{
        match(input,WS,FOLLOW_WS_in_program71);
      }
    break;
}
{
  pushFollow(FOLLOW_statement_in_program77);
  s2=statement();
  state._fsp--;
}
program.listOfQueries.add(s2);
int alt3=2;
int LA3_0=input.LA(1);
if ((LA3_0 == WS)) {
  alt3=1;
}
switch (alt3) {
case 1:
{
    match(input,WS,FOLLOW_WS_in_program82);
  }
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_program85);
int alt4=2;
int LA4_0=input.LA(1);
if ((LA4_0 == WS)) {
alt4=1;
}
switch (alt4) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program87);
}
break;
}
match(input,ON,FOLLOW_ON_in_program90);
int alt5=2;
int LA5_0=input.LA(1);
if ((LA5_0 == WS)) {
alt5=1;
}
switch (alt5) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program92);
}
break;
}
match(input,LPARAN,FOLLOW_LPARAN_in_program95);
int alt6=2;
int LA6_0=input.LA(1);
if ((LA6_0 == WS)) {
alt6=1;
}
switch (alt6) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program97);
}
break;
}
{
a=(Token)match(input,ID,FOLLOW_ID_in_program103);
program.primaryJoinableHooks.add((a != null ? a.getText() : null));
}
loop9: while (true) {
int alt9=2;
int LA9_0=input.LA(1);
if ((LA9_0 == WS)) {
int LA9_1=input.LA(2);
if ((LA9_1 == 72)) {
alt9=1;
}
}
 else if ((LA9_0 == 72)) {
alt9=1;
}
switch (alt9) {
case 1:
{
int alt7=2;
int LA7_0=input.LA(1);
if ((LA7_0 == WS)) {
alt7=1;
}
switch (alt7) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program108);
}
break;
}
match(input,72,FOLLOW_72_in_program111);
int alt8=2;
int LA8_0=input.LA(1);
if ((LA8_0 == WS)) {
alt8=1;
}
switch (alt8) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program113);
}
break;
}
a=(Token)match(input,ID,FOLLOW_ID_in_program118);
program.primaryJoinableHooks.add((a != null ? a.getText() : null));
}
break;
default :
break loop9;
}
}
int alt10=2;
int LA10_0=input.LA(1);
if ((LA10_0 == WS)) {
alt10=1;
}
switch (alt10) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program124);
}
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_program127);
int alt11=2;
int LA11_0=input.LA(1);
if ((LA11_0 == WS)) {
alt11=1;
}
switch (alt11) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program129);
}
break;
}
}
int alt12=2;
int LA12_0=input.LA(1);
if ((LA12_0 == OPT_SEMI_COLON)) {
alt12=1;
}
switch (alt12) {
case 1:
{
match(input,OPT_SEMI_COLON,FOLLOW_OPT_SEMI_COLON_in_program134);
}
break;
}
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return program;
}

Fixed version (ground truth):
public final Program program() throws RecognitionException {
  Program program=null;
  Token j=null;
  Token a=null;
  QueryMeta s1=null;
  QueryMeta s2=null;
  program=new Program();
  try {
{
{
        pushFollow(FOLLOW_statement_in_program42);
        s1=statement();
        state._fsp--;
      }
      program.listOfQueries.add(s1);
      int alt11=2;
      int LA11_0=input.LA(1);
      if ((LA11_0 == WS)) {
        int LA11_1=input.LA(2);
        if ((LA11_1 == JOIN || LA11_1 == LEFT_JOIN || LA11_1 == RIGHT_JOIN)) {
          alt11=1;
        }
      }
switch (alt11) {
case 1:
{
          match(input,WS,FOLLOW_WS_in_program52);
          j=input.LT(1);
          if (input.LA(1) == JOIN || input.LA(1) == LEFT_JOIN || input.LA(1) == RIGHT_JOIN) {
            input.consume();
            state.errorRecovery=false;
          }
 else {
            MismatchedSetException mse=new MismatchedSetException(null,input);
            throw mse;
          }
          program.joinTypes.add((j != null ? j.getText() : null).toUpperCase());
          int alt1=2;
          int LA1_0=input.LA(1);
          if ((LA1_0 == WS)) {
            alt1=1;
          }
switch (alt1) {
case 1:
{
              match(input,WS,FOLLOW_WS_in_program77);
            }
          break;
      }
      match(input,LPARAN,FOLLOW_LPARAN_in_program80);
      int alt2=2;
      int LA2_0=input.LA(1);
      if ((LA2_0 == WS)) {
        alt2=1;
      }
switch (alt2) {
case 1:
{
          match(input,WS,FOLLOW_WS_in_program82);
        }
      break;
  }
{
    pushFollow(FOLLOW_statement_in_program88);
    s2=statement();
    state._fsp--;
  }
  program.listOfQueries.add(s2);
  int alt3=2;
  int LA3_0=input.LA(1);
  if ((LA3_0 == WS)) {
    alt3=1;
  }
switch (alt3) {
case 1:
{
      match(input,WS,FOLLOW_WS_in_program93);
    }
  break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_program96);
int alt4=2;
int LA4_0=input.LA(1);
if ((LA4_0 == WS)) {
alt4=1;
}
switch (alt4) {
case 1:
{
  match(input,WS,FOLLOW_WS_in_program98);
}
break;
}
match(input,ON,FOLLOW_ON_in_program101);
int alt5=2;
int LA5_0=input.LA(1);
if ((LA5_0 == WS)) {
alt5=1;
}
switch (alt5) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program108);
}
break;
}
match(input,LPARAN,FOLLOW_LPARAN_in_program111);
int alt6=2;
int LA6_0=input.LA(1);
if ((LA6_0 == WS)) {
alt6=1;
}
switch (alt6) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program113);
}
break;
}
{
a=(Token)match(input,ID,FOLLOW_ID_in_program119);
program.primaryJoinableHooks.add((a != null ? a.getText() : null));
}
loop9: while (true) {
int alt9=2;
int LA9_0=input.LA(1);
if ((LA9_0 == WS)) {
int LA9_1=input.LA(2);
if ((LA9_1 == 72)) {
alt9=1;
}
}
 else if ((LA9_0 == 72)) {
alt9=1;
}
switch (alt9) {
case 1:
{
int alt7=2;
int LA7_0=input.LA(1);
if ((LA7_0 == WS)) {
alt7=1;
}
switch (alt7) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program124);
}
break;
}
match(input,72,FOLLOW_72_in_program127);
int alt8=2;
int LA8_0=input.LA(1);
if ((LA8_0 == WS)) {
alt8=1;
}
switch (alt8) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program129);
}
break;
}
a=(Token)match(input,ID,FOLLOW_ID_in_program134);
program.primaryJoinableHooks.add((a != null ? a.getText() : null));
}
break;
default :
break loop9;
}
}
int alt10=2;
int LA10_0=input.LA(1);
if ((LA10_0 == WS)) {
alt10=1;
}
switch (alt10) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program140);
}
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_program143);
}
break;
}
int alt12=2;
int LA12_0=input.LA(1);
if ((LA12_0 == WS)) {
alt12=1;
}
switch (alt12) {
case 1:
{
match(input,WS,FOLLOW_WS_in_program162);
}
break;
}
int alt13=2;
int LA13_0=input.LA(1);
if ((LA13_0 == OPT_SEMI_COLON)) {
alt13=1;
}
switch (alt13) {
case 1:
{
match(input,OPT_SEMI_COLON,FOLLOW_OPT_SEMI_COLON_in_program165);
}
break;
}
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return program;
}