Program: 169123
Project: 169123
Buggy source:
public final void granularityClause(QueryMeta qMeta) throws RecognitionException {
  Token s=null;
  Token dur=null;
  Token orig=null;
  Token per=null;
  Token tz=null;
  qMeta.granularity=new Granularity();
  try {
    int alt77=2;
    int LA77_0=input.LA(1);
    if ((LA77_0 == SINGLE_QUOTE_STRING)) {
      alt77=1;
    }
 else     if ((LA77_0 == DURATION || LA77_0 == PERIOD)) {
      alt77=2;
    }
 else {
      NoViableAltException nvae=new NoViableAltException("String_Node_Str",77,0,input);
      throw nvae;
    }
switch (alt77) {
case 1:
{
{
{
            s=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1088);
          }
          qMeta.granularity=new Granularity((s != null ? s.getText() : null));
        }
      }
    break;
case 2:
{
    int alt76=2;
    int LA76_0=input.LA(1);
    if ((LA76_0 == DURATION)) {
      alt76=1;
    }
 else     if ((LA76_0 == PERIOD)) {
      alt76=2;
    }
 else {
      NoViableAltException nvae=new NoViableAltException("String_Node_Str",76,0,input);
      throw nvae;
    }
switch (alt76) {
case 1:
{
{
          match(input,DURATION,FOLLOW_DURATION_in_granularityClause1112);
          qMeta.granularity.type="String_Node_Str";
          int alt55=2;
          int LA55_0=input.LA(1);
          if ((LA55_0 == WS)) {
            alt55=1;
          }
switch (alt55) {
case 1:
{
              match(input,WS,FOLLOW_WS_in_granularityClause1116);
            }
          break;
      }
      match(input,LPARAN,FOLLOW_LPARAN_in_granularityClause1119);
      int alt56=2;
      int LA56_0=input.LA(1);
      if ((LA56_0 == WS)) {
        alt56=1;
      }
switch (alt56) {
case 1:
{
          match(input,WS,FOLLOW_WS_in_granularityClause1121);
        }
      break;
  }
  dur=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1126);
  qMeta.granularity.setDuration((dur != null ? dur.getText() : null));
  int alt57=2;
  int LA57_0=input.LA(1);
  if ((LA57_0 == WS)) {
    alt57=1;
  }
switch (alt57) {
case 1:
{
      match(input,WS,FOLLOW_WS_in_granularityClause1130);
    }
  break;
}
int alt59=2;
int LA59_0=input.LA(1);
if ((LA59_0 == 72)) {
int LA59_1=input.LA(2);
if ((LA59_1 == WS)) {
  int LA59_4=input.LA(3);
  if ((LA59_4 == SINGLE_QUOTE_STRING)) {
    alt59=1;
  }
}
 else if ((LA59_1 == SINGLE_QUOTE_STRING)) {
  alt59=1;
}
}
switch (alt59) {
case 1:
{
  match(input,72,FOLLOW_72_in_granularityClause1134);
  int alt58=2;
  int LA58_0=input.LA(1);
  if ((LA58_0 == WS)) {
    alt58=1;
  }
switch (alt58) {
case 1:
{
      match(input,WS,FOLLOW_WS_in_granularityClause1136);
    }
  break;
}
orig=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1141);
qMeta.granularity.setOrigin((orig != null ? orig.getText() : null));
}
break;
}
int alt63=2;
int LA63_0=input.LA(1);
if ((LA63_0 == WS || LA63_0 == 72)) {
alt63=1;
}
switch (alt63) {
case 1:
{
int alt60=2;
int LA60_0=input.LA(1);
if ((LA60_0 == WS)) {
alt60=1;
}
switch (alt60) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1148);
}
break;
}
match(input,72,FOLLOW_72_in_granularityClause1151);
int alt61=2;
int LA61_0=input.LA(1);
if ((LA61_0 == WS)) {
int LA61_1=input.LA(2);
if ((LA61_1 == WS)) {
alt61=1;
}
}
switch (alt61) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1153);
}
break;
}
pushFollow(FOLLOW_granularityInclude_in_granularityClause1156);
granularityInclude(qMeta);
state._fsp--;
int alt62=2;
int LA62_0=input.LA(1);
if ((LA62_0 == WS)) {
alt62=1;
}
switch (alt62) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1159);
}
break;
}
}
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_granularityClause1164);
}
}
break;
case 2:
{
{
match(input,PERIOD,FOLLOW_PERIOD_in_granularityClause1183);
qMeta.granularity.type="String_Node_Str";
int alt64=2;
int LA64_0=input.LA(1);
if ((LA64_0 == WS)) {
alt64=1;
}
switch (alt64) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1187);
}
break;
}
match(input,LPARAN,FOLLOW_LPARAN_in_granularityClause1190);
int alt65=2;
int LA65_0=input.LA(1);
if ((LA65_0 == WS)) {
alt65=1;
}
switch (alt65) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1192);
}
break;
}
per=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1197);
qMeta.granularity.setPeriod((per != null ? per.getText() : null));
int alt66=2;
int LA66_0=input.LA(1);
if ((LA66_0 == WS)) {
alt66=1;
}
switch (alt66) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1201);
}
break;
}
int alt68=2;
int LA68_0=input.LA(1);
if ((LA68_0 == 72)) {
int LA68_1=input.LA(2);
if ((LA68_1 == WS)) {
int LA68_4=input.LA(3);
if ((LA68_4 == SINGLE_QUOTE_STRING)) {
alt68=1;
}
}
 else if ((LA68_1 == SINGLE_QUOTE_STRING)) {
alt68=1;
}
}
switch (alt68) {
case 1:
{
match(input,72,FOLLOW_72_in_granularityClause1205);
int alt67=2;
int LA67_0=input.LA(1);
if ((LA67_0 == WS)) {
alt67=1;
}
switch (alt67) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1207);
}
break;
}
tz=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1212);
qMeta.granularity.setTimeZone((tz != null ? tz.getText() : null));
}
break;
}
int alt69=2;
int LA69_0=input.LA(1);
if ((LA69_0 == WS)) {
alt69=1;
}
switch (alt69) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1218);
}
break;
}
int alt71=2;
int LA71_0=input.LA(1);
if ((LA71_0 == 72)) {
int LA71_1=input.LA(2);
if ((LA71_1 == WS)) {
int LA71_4=input.LA(3);
if ((LA71_4 == SINGLE_QUOTE_STRING)) {
alt71=1;
}
}
 else if ((LA71_1 == SINGLE_QUOTE_STRING)) {
alt71=1;
}
}
switch (alt71) {
case 1:
{
match(input,72,FOLLOW_72_in_granularityClause1222);
int alt70=2;
int LA70_0=input.LA(1);
if ((LA70_0 == WS)) {
alt70=1;
}
switch (alt70) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1224);
}
break;
}
orig=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1229);
qMeta.granularity.setOrigin((orig != null ? orig.getText() : null));
}
break;
}
int alt75=2;
int LA75_0=input.LA(1);
if ((LA75_0 == WS || LA75_0 == 72)) {
alt75=1;
}
switch (alt75) {
case 1:
{
int alt72=2;
int LA72_0=input.LA(1);
if ((LA72_0 == WS)) {
alt72=1;
}
switch (alt72) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1236);
}
break;
}
match(input,72,FOLLOW_72_in_granularityClause1239);
int alt73=2;
int LA73_0=input.LA(1);
if ((LA73_0 == WS)) {
int LA73_1=input.LA(2);
if ((LA73_1 == WS)) {
alt73=1;
}
}
switch (alt73) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1241);
}
break;
}
pushFollow(FOLLOW_granularityInclude_in_granularityClause1244);
granularityInclude(qMeta);
state._fsp--;
int alt74=2;
int LA74_0=input.LA(1);
if ((LA74_0 == WS)) {
alt74=1;
}
switch (alt74) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1247);
}
break;
}
}
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_granularityClause1252);
}
}
break;
}
}
break;
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
}

Fixed version (ground truth):
public final void granularityClause(QueryMeta qMeta) throws RecognitionException {
  Token s=null;
  Token dur=null;
  Token orig=null;
  Token per=null;
  Token tz=null;
  qMeta.granularity=new Granularity();
  try {
    int alt78=2;
    int LA78_0=input.LA(1);
    if ((LA78_0 == SINGLE_QUOTE_STRING)) {
      alt78=1;
    }
 else     if ((LA78_0 == DURATION || LA78_0 == PERIOD)) {
      alt78=2;
    }
 else {
      NoViableAltException nvae=new NoViableAltException("String_Node_Str",78,0,input);
      throw nvae;
    }
switch (alt78) {
case 1:
{
{
{
            s=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1119);
          }
          qMeta.granularity=new Granularity((s != null ? s.getText() : null));
        }
      }
    break;
case 2:
{
    int alt77=2;
    int LA77_0=input.LA(1);
    if ((LA77_0 == DURATION)) {
      alt77=1;
    }
 else     if ((LA77_0 == PERIOD)) {
      alt77=2;
    }
 else {
      NoViableAltException nvae=new NoViableAltException("String_Node_Str",77,0,input);
      throw nvae;
    }
switch (alt77) {
case 1:
{
{
          match(input,DURATION,FOLLOW_DURATION_in_granularityClause1143);
          qMeta.granularity.type="String_Node_Str";
          int alt56=2;
          int LA56_0=input.LA(1);
          if ((LA56_0 == WS)) {
            alt56=1;
          }
switch (alt56) {
case 1:
{
              match(input,WS,FOLLOW_WS_in_granularityClause1147);
            }
          break;
      }
      match(input,LPARAN,FOLLOW_LPARAN_in_granularityClause1150);
      int alt57=2;
      int LA57_0=input.LA(1);
      if ((LA57_0 == WS)) {
        alt57=1;
      }
switch (alt57) {
case 1:
{
          match(input,WS,FOLLOW_WS_in_granularityClause1152);
        }
      break;
  }
  dur=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1157);
  qMeta.granularity.setDuration((dur != null ? dur.getText() : null));
  int alt58=2;
  int LA58_0=input.LA(1);
  if ((LA58_0 == WS)) {
    alt58=1;
  }
switch (alt58) {
case 1:
{
      match(input,WS,FOLLOW_WS_in_granularityClause1161);
    }
  break;
}
int alt60=2;
int LA60_0=input.LA(1);
if ((LA60_0 == 72)) {
int LA60_1=input.LA(2);
if ((LA60_1 == WS)) {
  int LA60_4=input.LA(3);
  if ((LA60_4 == SINGLE_QUOTE_STRING)) {
    alt60=1;
  }
}
 else if ((LA60_1 == SINGLE_QUOTE_STRING)) {
  alt60=1;
}
}
switch (alt60) {
case 1:
{
  match(input,72,FOLLOW_72_in_granularityClause1165);
  int alt59=2;
  int LA59_0=input.LA(1);
  if ((LA59_0 == WS)) {
    alt59=1;
  }
switch (alt59) {
case 1:
{
      match(input,WS,FOLLOW_WS_in_granularityClause1167);
    }
  break;
}
orig=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1172);
qMeta.granularity.setOrigin((orig != null ? orig.getText() : null));
}
break;
}
int alt64=2;
int LA64_0=input.LA(1);
if ((LA64_0 == WS || LA64_0 == 72)) {
alt64=1;
}
switch (alt64) {
case 1:
{
int alt61=2;
int LA61_0=input.LA(1);
if ((LA61_0 == WS)) {
alt61=1;
}
switch (alt61) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1179);
}
break;
}
match(input,72,FOLLOW_72_in_granularityClause1182);
int alt62=2;
int LA62_0=input.LA(1);
if ((LA62_0 == WS)) {
int LA62_1=input.LA(2);
if ((LA62_1 == WS)) {
alt62=1;
}
}
switch (alt62) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1184);
}
break;
}
pushFollow(FOLLOW_granularityInclude_in_granularityClause1187);
granularityInclude(qMeta);
state._fsp--;
int alt63=2;
int LA63_0=input.LA(1);
if ((LA63_0 == WS)) {
alt63=1;
}
switch (alt63) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1190);
}
break;
}
}
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_granularityClause1195);
}
}
break;
case 2:
{
{
match(input,PERIOD,FOLLOW_PERIOD_in_granularityClause1214);
qMeta.granularity.type="String_Node_Str";
int alt65=2;
int LA65_0=input.LA(1);
if ((LA65_0 == WS)) {
alt65=1;
}
switch (alt65) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1218);
}
break;
}
match(input,LPARAN,FOLLOW_LPARAN_in_granularityClause1221);
int alt66=2;
int LA66_0=input.LA(1);
if ((LA66_0 == WS)) {
alt66=1;
}
switch (alt66) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1223);
}
break;
}
per=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1228);
qMeta.granularity.setPeriod((per != null ? per.getText() : null));
int alt67=2;
int LA67_0=input.LA(1);
if ((LA67_0 == WS)) {
alt67=1;
}
switch (alt67) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1232);
}
break;
}
int alt69=2;
int LA69_0=input.LA(1);
if ((LA69_0 == 72)) {
int LA69_1=input.LA(2);
if ((LA69_1 == WS)) {
int LA69_4=input.LA(3);
if ((LA69_4 == SINGLE_QUOTE_STRING)) {
alt69=1;
}
}
 else if ((LA69_1 == SINGLE_QUOTE_STRING)) {
alt69=1;
}
}
switch (alt69) {
case 1:
{
match(input,72,FOLLOW_72_in_granularityClause1236);
int alt68=2;
int LA68_0=input.LA(1);
if ((LA68_0 == WS)) {
alt68=1;
}
switch (alt68) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1238);
}
break;
}
tz=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1243);
qMeta.granularity.setTimeZone((tz != null ? tz.getText() : null));
}
break;
}
int alt70=2;
int LA70_0=input.LA(1);
if ((LA70_0 == WS)) {
alt70=1;
}
switch (alt70) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1249);
}
break;
}
int alt72=2;
int LA72_0=input.LA(1);
if ((LA72_0 == 72)) {
int LA72_1=input.LA(2);
if ((LA72_1 == WS)) {
int LA72_4=input.LA(3);
if ((LA72_4 == SINGLE_QUOTE_STRING)) {
alt72=1;
}
}
 else if ((LA72_1 == SINGLE_QUOTE_STRING)) {
alt72=1;
}
}
switch (alt72) {
case 1:
{
match(input,72,FOLLOW_72_in_granularityClause1253);
int alt71=2;
int LA71_0=input.LA(1);
if ((LA71_0 == WS)) {
alt71=1;
}
switch (alt71) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1255);
}
break;
}
orig=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_granularityClause1260);
qMeta.granularity.setOrigin((orig != null ? orig.getText() : null));
}
break;
}
int alt76=2;
int LA76_0=input.LA(1);
if ((LA76_0 == WS || LA76_0 == 72)) {
alt76=1;
}
switch (alt76) {
case 1:
{
int alt73=2;
int LA73_0=input.LA(1);
if ((LA73_0 == WS)) {
alt73=1;
}
switch (alt73) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1267);
}
break;
}
match(input,72,FOLLOW_72_in_granularityClause1270);
int alt74=2;
int LA74_0=input.LA(1);
if ((LA74_0 == WS)) {
int LA74_1=input.LA(2);
if ((LA74_1 == WS)) {
alt74=1;
}
}
switch (alt74) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1272);
}
break;
}
pushFollow(FOLLOW_granularityInclude_in_granularityClause1275);
granularityInclude(qMeta);
state._fsp--;
int alt75=2;
int LA75_0=input.LA(1);
if ((LA75_0 == WS)) {
alt75=1;
}
switch (alt75) {
case 1:
{
match(input,WS,FOLLOW_WS_in_granularityClause1278);
}
break;
}
}
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_granularityClause1283);
}
}
break;
}
}
break;
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
}