nus-yam/ex-repair huggingface dataset:
Program: 169121
Project: 169121
Buggy source:
public final PostAggItem simplePostAggAccess() throws RecognitionException {
  PostAggItem postAggItem=null;
  PostAggItem c=null;
  PostAggItem f=null;
  PostAggItem h=null;
  PostAggItem js=null;
  try {
    int alt126=4;
switch (input.LA(1)) {
case FLOAT:
case LONG:
{
        alt126=1;
      }
    break;
case ID:
{
    alt126=2;
  }
break;
case UNIQUE:
{
alt126=3;
}
break;
case JAVASCRIPT:
{
alt126=4;
}
break;
default :
NoViableAltException nvae=new NoViableAltException("String_Node_Str",126,0,input);
throw nvae;
}
switch (alt126) {
case 1:
{
pushFollow(FOLLOW_constantAccess_in_simplePostAggAccess2160);
c=constantAccess();
state._fsp--;
postAggItem=c;
}
break;
case 2:
{
pushFollow(FOLLOW_fieldAccess_in_simplePostAggAccess2177);
f=fieldAccess();
state._fsp--;
postAggItem=f;
}
break;
case 3:
{
pushFollow(FOLLOW_hyperUniqueCardinality_in_simplePostAggAccess2190);
h=hyperUniqueCardinality();
state._fsp--;
postAggItem=h;
}
break;
case 4:
{
pushFollow(FOLLOW_postAggJavascriptDef_in_simplePostAggAccess2199);
js=postAggJavascriptDef();
state._fsp--;
postAggItem=js;
}
break;
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return postAggItem;
}

Fixed version (ground truth):
public final PostAggItem simplePostAggAccess() throws RecognitionException {
  PostAggItem postAggItem=null;
  PostAggItem c=null;
  PostAggItem f=null;
  PostAggItem h=null;
  PostAggItem js=null;
  try {
    int alt127=4;
switch (input.LA(1)) {
case FLOAT:
case LONG:
{
        alt127=1;
      }
    break;
case ID:
{
    alt127=2;
  }
break;
case UNIQUE:
{
alt127=3;
}
break;
case JAVASCRIPT:
{
alt127=4;
}
break;
default :
NoViableAltException nvae=new NoViableAltException("String_Node_Str",127,0,input);
throw nvae;
}
switch (alt127) {
case 1:
{
pushFollow(FOLLOW_constantAccess_in_simplePostAggAccess2191);
c=constantAccess();
state._fsp--;
postAggItem=c;
}
break;
case 2:
{
pushFollow(FOLLOW_fieldAccess_in_simplePostAggAccess2208);
f=fieldAccess();
state._fsp--;
postAggItem=f;
}
break;
case 3:
{
pushFollow(FOLLOW_hyperUniqueCardinality_in_simplePostAggAccess2221);
h=hyperUniqueCardinality();
state._fsp--;
postAggItem=h;
}
break;
case 4:
{
pushFollow(FOLLOW_postAggJavascriptDef_in_simplePostAggAccess2230);
js=postAggJavascriptDef();
state._fsp--;
postAggItem=js;
}
break;
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return postAggItem;
}
Program: 169124
Project: 169124
Buggy source:
public final AggItem aggItemInSelect() throws RecognitionException {
  AggItem aggItem=null;
  Token x=null;
  aggItem=new AggItem();
  try {
{
      pushFollow(FOLLOW_aggCallSite_in_aggItemInSelect1863);
      aggCallSite(aggItem);
      state._fsp--;
      int alt107=2;
      int LA107_0=input.LA(1);
      if ((LA107_0 == WS)) {
        int LA107_1=input.LA(2);
        if ((LA107_1 == AS)) {
          alt107=1;
        }
      }
switch (alt107) {
case 1:
{
          match(input,WS,FOLLOW_WS_in_aggItemInSelect1867);
          match(input,AS,FOLLOW_AS_in_aggItemInSelect1869);
          match(input,WS,FOLLOW_WS_in_aggItemInSelect1871);
          x=(Token)match(input,ID,FOLLOW_ID_in_aggItemInSelect1875);
          aggItem.setAsName((x != null ? x.getText() : null));
        }
      break;
  }
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return aggItem;
}

Fixed version (ground truth):
public final AggItem aggItemInSelect() throws RecognitionException {
  AggItem aggItem=null;
  Token x=null;
  aggItem=new AggItem();
  try {
{
      pushFollow(FOLLOW_aggCallSite_in_aggItemInSelect1894);
      aggCallSite(aggItem);
      state._fsp--;
      int alt108=2;
      int LA108_0=input.LA(1);
      if ((LA108_0 == WS)) {
        int LA108_1=input.LA(2);
        if ((LA108_1 == AS)) {
          alt108=1;
        }
      }
switch (alt108) {
case 1:
{
          match(input,WS,FOLLOW_WS_in_aggItemInSelect1898);
          match(input,AS,FOLLOW_AS_in_aggItemInSelect1900);
          match(input,WS,FOLLOW_WS_in_aggItemInSelect1902);
          x=(Token)match(input,ID,FOLLOW_ID_in_aggItemInSelect1906);
          aggItem.setAsName((x != null ? x.getText() : null));
        }
      break;
  }
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return aggItem;
}
Program: 169125
Project: 169125
Buggy source:
public final PostAggItem constantAccess() throws RecognitionException {
  PostAggItem postAggItem=null;
  Token a=null;
  postAggItem=new PostAggItem("String_Node_Str");
  try {
{
{
        int alt127=2;
        int LA127_0=input.LA(1);
        if ((LA127_0 == FLOAT)) {
          alt127=1;
        }
 else         if ((LA127_0 == LONG)) {
          alt127=2;
        }
 else {
          NoViableAltException nvae=new NoViableAltException("String_Node_Str",127,0,input);
          throw nvae;
        }
switch (alt127) {
case 1:
{
            a=(Token)match(input,FLOAT,FOLLOW_FLOAT_in_constantAccess2229);
          }
        break;
case 2:
{
        a=(Token)match(input,LONG,FOLLOW_LONG_in_constantAccess2235);
      }
    break;
}
postAggItem.constantValue=Double.valueOf((a != null ? a.getText() : null));
int alt128=2;
int LA128_0=input.LA(1);
if ((LA128_0 == WS)) {
  int LA128_1=input.LA(2);
  if ((LA128_1 == AS)) {
    alt128=1;
  }
}
switch (alt128) {
case 1:
{
    match(input,WS,FOLLOW_WS_in_constantAccess2248);
    pushFollow(FOLLOW_postAggLabel_in_constantAccess2250);
    postAggLabel(postAggItem);
    state._fsp--;
  }
break;
}
}
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return postAggItem;
}

Fixed version (ground truth):
public final PostAggItem constantAccess() throws RecognitionException {
  PostAggItem postAggItem=null;
  Token a=null;
  postAggItem=new PostAggItem("String_Node_Str");
  try {
{
{
        int alt128=2;
        int LA128_0=input.LA(1);
        if ((LA128_0 == FLOAT)) {
          alt128=1;
        }
 else         if ((LA128_0 == LONG)) {
          alt128=2;
        }
 else {
          NoViableAltException nvae=new NoViableAltException("String_Node_Str",128,0,input);
          throw nvae;
        }
switch (alt128) {
case 1:
{
            a=(Token)match(input,FLOAT,FOLLOW_FLOAT_in_constantAccess2260);
          }
        break;
case 2:
{
        a=(Token)match(input,LONG,FOLLOW_LONG_in_constantAccess2266);
      }
    break;
}
postAggItem.constantValue=Double.valueOf((a != null ? a.getText() : null));
int alt129=2;
int LA129_0=input.LA(1);
if ((LA129_0 == WS)) {
  int LA129_1=input.LA(2);
  if ((LA129_1 == AS)) {
    alt129=1;
  }
}
switch (alt129) {
case 1:
{
    match(input,WS,FOLLOW_WS_in_constantAccess2279);
    pushFollow(FOLLOW_postAggLabel_in_constantAccess2281);
    postAggLabel(postAggItem);
    state._fsp--;
  }
break;
}
}
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return postAggItem;
}
Program: 169126
Project: 169126
Buggy source:
public final Filter regexFilter() throws RecognitionException {
  Filter filter=null;
  Token a=null;
  Token b=null;
  filter=new Filter("String_Node_Str");
  try {
{
{
        a=(Token)match(input,ID,FOLLOW_ID_in_regexFilter1626);
        match(input,WS,FOLLOW_WS_in_regexFilter1628);
        match(input,LIKE,FOLLOW_LIKE_in_regexFilter1630);
        match(input,WS,FOLLOW_WS_in_regexFilter1632);
{
          b=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_regexFilter1638);
        }
      }
      filter.dimension=(a != null ? a.getText() : null);
      filter.pattern=(b != null ? b.getText() : null);
      if (filter.pattern.startsWith("String_Node_Str") && filter.pattern.endsWith("String_Node_Str")) {
        filter.pattern=filter.pattern.substring(1,filter.pattern.length() - 1);
      }
    }
  }
 catch (  RecognitionException re) {
    reportError(re);
    recover(input,re);
  }
 finally {
  }
  return filter;
}

Fixed version (ground truth):
public final Filter regexFilter() throws RecognitionException {
  Filter filter=null;
  Token a=null;
  Token b=null;
  filter=new Filter("String_Node_Str");
  try {
{
{
        a=(Token)match(input,ID,FOLLOW_ID_in_regexFilter1657);
        match(input,WS,FOLLOW_WS_in_regexFilter1659);
        match(input,LIKE,FOLLOW_LIKE_in_regexFilter1661);
        match(input,WS,FOLLOW_WS_in_regexFilter1663);
{
          b=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_regexFilter1669);
        }
      }
      filter.dimension=(a != null ? a.getText() : null);
      filter.pattern=(b != null ? b.getText() : null);
      if (filter.pattern.startsWith("String_Node_Str") && filter.pattern.endsWith("String_Node_Str")) {
        filter.pattern=filter.pattern.substring(1,filter.pattern.length() - 1);
      }
    }
  }
 catch (  RecognitionException re) {
    reportError(re);
    recover(input,re);
  }
 finally {
  }
  return filter;
}
Program: 169127
Project: 169127
Buggy source:
public final void simpleDim(QueryMeta qMeta) throws RecognitionException {
  Token a=null;
  Token b=null;
  try {
{
{
        a=(Token)match(input,ID,FOLLOW_ID_in_simpleDim835);
        int alt43=2;
        int LA43_0=input.LA(1);
        if ((LA43_0 == WS)) {
          int LA43_1=input.LA(2);
          if ((LA43_1 == AS)) {
            alt43=1;
          }
        }
switch (alt43) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_simpleDim838);
            match(input,AS,FOLLOW_AS_in_simpleDim840);
            match(input,WS,FOLLOW_WS_in_simpleDim842);
            b=(Token)match(input,ID,FOLLOW_ID_in_simpleDim846);
          }
        break;
    }
    if (b != null) {
      ((PlainDimQueryMeta)qMeta).fetchDimensions.put((a != null ? a.getText() : null),(b != null ? b.getText() : null));
    }
 else {
      ((PlainDimQueryMeta)qMeta).fetchDimensions.put((a != null ? a.getText() : null),null);
    }
  }
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
}

Fixed version (ground truth):
public final void simpleDim(QueryMeta qMeta) throws RecognitionException {
  Token a=null;
  Token b=null;
  try {
{
{
        a=(Token)match(input,ID,FOLLOW_ID_in_simpleDim866);
        int alt44=2;
        int LA44_0=input.LA(1);
        if ((LA44_0 == WS)) {
          int LA44_1=input.LA(2);
          if ((LA44_1 == AS)) {
            alt44=1;
          }
        }
switch (alt44) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_simpleDim869);
            match(input,AS,FOLLOW_AS_in_simpleDim871);
            match(input,WS,FOLLOW_WS_in_simpleDim873);
            b=(Token)match(input,ID,FOLLOW_ID_in_simpleDim877);
          }
        break;
    }
    if (b != null) {
      ((PlainDimQueryMeta)qMeta).fetchDimensions.put((a != null ? a.getText() : null),(b != null ? b.getText() : null));
    }
 else {
      ((PlainDimQueryMeta)qMeta).fetchDimensions.put((a != null ? a.getText() : null),null);
    }
  }
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
}
Program: 169130
Project: 169130
Buggy source:
public final PostAggItem postAggJavascriptDef() throws RecognitionException {
  PostAggItem postAggItem=null;
  Token str=null;
  postAggItem=new PostAggItem("String_Node_Str");
  try {
{
      match(input,JAVASCRIPT,FOLLOW_JAVASCRIPT_in_postAggJavascriptDef2355);
      int alt133=2;
      int LA133_0=input.LA(1);
      if ((LA133_0 == WS)) {
        alt133=1;
      }
switch (alt133) {
case 1:
{
          match(input,WS,FOLLOW_WS_in_postAggJavascriptDef2357);
        }
      break;
  }
  str=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_postAggJavascriptDef2362);
  postAggItem.parseToJs((str != null ? str.getText() : null));
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return postAggItem;
}

Fixed version (ground truth):
public final PostAggItem postAggJavascriptDef() throws RecognitionException {
  PostAggItem postAggItem=null;
  Token str=null;
  postAggItem=new PostAggItem("String_Node_Str");
  try {
{
      match(input,JAVASCRIPT,FOLLOW_JAVASCRIPT_in_postAggJavascriptDef2386);
      int alt134=2;
      int LA134_0=input.LA(1);
      if ((LA134_0 == WS)) {
        alt134=1;
      }
switch (alt134) {
case 1:
{
          match(input,WS,FOLLOW_WS_in_postAggJavascriptDef2388);
        }
      break;
  }
  str=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_postAggJavascriptDef2393);
  postAggItem.parseToJs((str != null ? str.getText() : null));
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return postAggItem;
}
Program: 169132
Project: 169132
Buggy source:
public final Pair<String> pairString() throws RecognitionException {
  Pair<String> pair=null;
  Token i=null;
  Token j=null;
  try {
{
{
        match(input,LSQUARE,FOLLOW_LSQUARE_in_pairString1372);
        int alt86=2;
        int LA86_0=input.LA(1);
        if ((LA86_0 == WS)) {
          alt86=1;
        }
switch (alt86) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_pairString1374);
          }
        break;
    }
    i=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_pairString1379);
    int alt87=2;
    int LA87_0=input.LA(1);
    if ((LA87_0 == WS)) {
      alt87=1;
    }
switch (alt87) {
case 1:
{
        match(input,WS,FOLLOW_WS_in_pairString1382);
      }
    break;
}
match(input,72,FOLLOW_72_in_pairString1385);
int alt88=2;
int LA88_0=input.LA(1);
if ((LA88_0 == WS)) {
  alt88=1;
}
switch (alt88) {
case 1:
{
    match(input,WS,FOLLOW_WS_in_pairString1387);
  }
break;
}
j=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_pairString1392);
int alt89=2;
int LA89_0=input.LA(1);
if ((LA89_0 == WS)) {
alt89=1;
}
switch (alt89) {
case 1:
{
match(input,WS,FOLLOW_WS_in_pairString1394);
}
break;
}
match(input,RSQUARE,FOLLOW_RSQUARE_in_pairString1397);
}
pair=new Pair<>(((i != null ? i.getText() : null)).replaceAll("String_Node_Str","String_Node_Str"),((j != null ? j.getText() : null)).replaceAll("String_Node_Str","String_Node_Str"));
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return pair;
}

Fixed version (ground truth):
public final Pair<String> pairString() throws RecognitionException {
  Pair<String> pair=null;
  Token i=null;
  Token j=null;
  try {
{
{
        match(input,LSQUARE,FOLLOW_LSQUARE_in_pairString1403);
        int alt87=2;
        int LA87_0=input.LA(1);
        if ((LA87_0 == WS)) {
          alt87=1;
        }
switch (alt87) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_pairString1405);
          }
        break;
    }
    i=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_pairString1410);
    int alt88=2;
    int LA88_0=input.LA(1);
    if ((LA88_0 == WS)) {
      alt88=1;
    }
switch (alt88) {
case 1:
{
        match(input,WS,FOLLOW_WS_in_pairString1413);
      }
    break;
}
match(input,72,FOLLOW_72_in_pairString1416);
int alt89=2;
int LA89_0=input.LA(1);
if ((LA89_0 == WS)) {
  alt89=1;
}
switch (alt89) {
case 1:
{
    match(input,WS,FOLLOW_WS_in_pairString1418);
  }
break;
}
j=(Token)match(input,SINGLE_QUOTE_STRING,FOLLOW_SINGLE_QUOTE_STRING_in_pairString1423);
int alt90=2;
int LA90_0=input.LA(1);
if ((LA90_0 == WS)) {
alt90=1;
}
switch (alt90) {
case 1:
{
match(input,WS,FOLLOW_WS_in_pairString1425);
}
break;
}
match(input,RSQUARE,FOLLOW_RSQUARE_in_pairString1428);
}
pair=new Pair<>(((i != null ? i.getText() : null)).replaceAll("String_Node_Str","String_Node_Str"),((j != null ? j.getText() : null)).replaceAll("String_Node_Str","String_Node_Str"));
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return pair;
}
Program: 169133
Project: 169133
Buggy source:
public final Filter grandFilter() throws RecognitionException {
  Filter filter=null;
  Token o=null;
  Filter a=null;
  Filter b=null;
  try {
{
      int alt105=2;
      alt105=dfa105.predict(input);
switch (alt105) {
case 1:
{
          pushFollow(FOLLOW_simpleFilter_in_grandFilter1799);
          a=simpleFilter();
          state._fsp--;
        }
      break;
case 2:
{
      pushFollow(FOLLOW_simpleLogicalFilter_in_grandFilter1805);
      a=simpleLogicalFilter();
      state._fsp--;
    }
  break;
}
filter=a;
int alt106=2;
int LA106_0=input.LA(1);
if ((LA106_0 == WS)) {
int LA106_1=input.LA(2);
if ((LA106_1 == AND || LA106_1 == OR)) {
  alt106=1;
}
}
switch (alt106) {
case 1:
{
  match(input,WS,FOLLOW_WS_in_grandFilter1812);
  o=input.LT(1);
  if (input.LA(1) == AND || input.LA(1) == OR) {
    input.consume();
    state.errorRecovery=false;
  }
 else {
    MismatchedSetException mse=new MismatchedSetException(null,input);
    throw mse;
  }
  match(input,WS,FOLLOW_WS_in_grandFilter1822);
  pushFollow(FOLLOW_grandFilter_in_grandFilter1826);
  b=grandFilter();
  state._fsp--;
  filter=new Filter((o != null ? o.getText() : null).toLowerCase());
  filter.fields=new ArrayList<>();
  filter.fields.add(a);
  filter.fields.add(b);
}
break;
}
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return filter;
}

Fixed version (ground truth):
public final Filter grandFilter() throws RecognitionException {
  Filter filter=null;
  Token o=null;
  Filter a=null;
  Filter b=null;
  try {
{
      int alt106=2;
      alt106=dfa106.predict(input);
switch (alt106) {
case 1:
{
          pushFollow(FOLLOW_simpleFilter_in_grandFilter1830);
          a=simpleFilter();
          state._fsp--;
        }
      break;
case 2:
{
      pushFollow(FOLLOW_simpleLogicalFilter_in_grandFilter1836);
      a=simpleLogicalFilter();
      state._fsp--;
    }
  break;
}
filter=a;
int alt107=2;
int LA107_0=input.LA(1);
if ((LA107_0 == WS)) {
int LA107_1=input.LA(2);
if ((LA107_1 == AND || LA107_1 == OR)) {
  alt107=1;
}
}
switch (alt107) {
case 1:
{
  match(input,WS,FOLLOW_WS_in_grandFilter1843);
  o=input.LT(1);
  if (input.LA(1) == AND || input.LA(1) == OR) {
    input.consume();
    state.errorRecovery=false;
  }
 else {
    MismatchedSetException mse=new MismatchedSetException(null,input);
    throw mse;
  }
  match(input,WS,FOLLOW_WS_in_grandFilter1853);
  pushFollow(FOLLOW_grandFilter_in_grandFilter1857);
  b=grandFilter();
  state._fsp--;
  filter=new Filter((o != null ? o.getText() : null).toLowerCase());
  filter.fields=new ArrayList<>();
  filter.fields.add(a);
  filter.fields.add(b);
}
break;
}
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return filter;
}
Program: 169134
Project: 169134
Buggy source:
public final Having havingClause() throws RecognitionException {
  Having having=null;
  Having h=null;
  try {
{
      pushFollow(FOLLOW_complexHaving_in_havingClause1422);
      h=complexHaving();
      state._fsp--;
      having=h;
    }
  }
 catch (  RecognitionException re) {
    reportError(re);
    recover(input,re);
  }
 finally {
  }
  return having;
}

Fixed version (ground truth):
public final Having havingClause() throws RecognitionException {
  Having having=null;
  Having h=null;
  try {
{
      pushFollow(FOLLOW_complexHaving_in_havingClause1453);
      h=complexHaving();
      state._fsp--;
      having=h;
    }
  }
 catch (  RecognitionException re) {
    reportError(re);
    recover(input,re);
  }
 finally {
  }
  return having;
}
Program: 169135
Project: 169135
Buggy source:
public final String aggFunc() throws RecognitionException {
  String name=null;
  try {
    int alt112=6;
switch (input.LA(1)) {
case LONG_SUM:
{
        alt112=1;
      }
    break;
case DOUBLE_SUM:
{
    alt112=2;
  }
break;
case UNIQUE:
{
alt112=3;
}
break;
case MIN:
{
alt112=4;
}
break;
case MAX:
{
alt112=5;
}
break;
case JAVASCRIPT:
{
alt112=6;
}
break;
default :
NoViableAltException nvae=new NoViableAltException("String_Node_Str",112,0,input);
throw nvae;
}
switch (alt112) {
case 1:
{
match(input,LONG_SUM,FOLLOW_LONG_SUM_in_aggFunc1949);
name="String_Node_Str";
}
break;
case 2:
{
match(input,DOUBLE_SUM,FOLLOW_DOUBLE_SUM_in_aggFunc1956);
name="String_Node_Str";
}
break;
case 3:
{
match(input,UNIQUE,FOLLOW_UNIQUE_in_aggFunc1963);
name="String_Node_Str";
}
break;
case 4:
{
match(input,MIN,FOLLOW_MIN_in_aggFunc1970);
name="String_Node_Str";
}
break;
case 5:
{
match(input,MAX,FOLLOW_MAX_in_aggFunc1977);
name="String_Node_Str";
}
break;
case 6:
{
match(input,JAVASCRIPT,FOLLOW_JAVASCRIPT_in_aggFunc1984);
name="String_Node_Str";
}
break;
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return name;
}

Fixed version (ground truth):
public final String aggFunc() throws RecognitionException {
  String name=null;
  try {
    int alt113=6;
switch (input.LA(1)) {
case LONG_SUM:
{
        alt113=1;
      }
    break;
case DOUBLE_SUM:
{
    alt113=2;
  }
break;
case UNIQUE:
{
alt113=3;
}
break;
case MIN:
{
alt113=4;
}
break;
case MAX:
{
alt113=5;
}
break;
case JAVASCRIPT:
{
alt113=6;
}
break;
default :
NoViableAltException nvae=new NoViableAltException("String_Node_Str",113,0,input);
throw nvae;
}
switch (alt113) {
case 1:
{
match(input,LONG_SUM,FOLLOW_LONG_SUM_in_aggFunc1980);
name="String_Node_Str";
}
break;
case 2:
{
match(input,DOUBLE_SUM,FOLLOW_DOUBLE_SUM_in_aggFunc1987);
name="String_Node_Str";
}
break;
case 3:
{
match(input,UNIQUE,FOLLOW_UNIQUE_in_aggFunc1994);
name="String_Node_Str";
}
break;
case 4:
{
match(input,MIN,FOLLOW_MIN_in_aggFunc2001);
name="String_Node_Str";
}
break;
case 5:
{
match(input,MAX,FOLLOW_MAX_in_aggFunc2008);
name="String_Node_Str";
}
break;
case 6:
{
match(input,JAVASCRIPT,FOLLOW_JAVASCRIPT_in_aggFunc2015);
name="String_Node_Str";
}
break;
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return name;
}
Program: 169136
Project: 169136
Buggy source:
public final PostAggItem hyperUniqueCardinality() throws RecognitionException {
  PostAggItem postAggItem=null;
  Token a=null;
  postAggItem=new PostAggItem("String_Node_Str");
  try {
{
{
        match(input,UNIQUE,FOLLOW_UNIQUE_in_hyperUniqueCardinality2312);
        int alt130=2;
        int LA130_0=input.LA(1);
        if ((LA130_0 == WS)) {
          alt130=1;
        }
switch (alt130) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_hyperUniqueCardinality2314);
          }
        break;
    }
    match(input,LPARAN,FOLLOW_LPARAN_in_hyperUniqueCardinality2317);
    int alt131=2;
    int LA131_0=input.LA(1);
    if ((LA131_0 == WS)) {
      alt131=1;
    }
switch (alt131) {
case 1:
{
        match(input,WS,FOLLOW_WS_in_hyperUniqueCardinality2319);
      }
    break;
}
a=(Token)match(input,ID,FOLLOW_ID_in_hyperUniqueCardinality2324);
int alt132=2;
int LA132_0=input.LA(1);
if ((LA132_0 == WS)) {
  alt132=1;
}
switch (alt132) {
case 1:
{
    match(input,WS,FOLLOW_WS_in_hyperUniqueCardinality2326);
  }
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_hyperUniqueCardinality2329);
postAggItem.fieldName=(a != null ? a.getText() : null);
}
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return postAggItem;
}

Fixed version (ground truth):
public final PostAggItem hyperUniqueCardinality() throws RecognitionException {
  PostAggItem postAggItem=null;
  Token a=null;
  postAggItem=new PostAggItem("String_Node_Str");
  try {
{
{
        match(input,UNIQUE,FOLLOW_UNIQUE_in_hyperUniqueCardinality2343);
        int alt131=2;
        int LA131_0=input.LA(1);
        if ((LA131_0 == WS)) {
          alt131=1;
        }
switch (alt131) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_hyperUniqueCardinality2345);
          }
        break;
    }
    match(input,LPARAN,FOLLOW_LPARAN_in_hyperUniqueCardinality2348);
    int alt132=2;
    int LA132_0=input.LA(1);
    if ((LA132_0 == WS)) {
      alt132=1;
    }
switch (alt132) {
case 1:
{
        match(input,WS,FOLLOW_WS_in_hyperUniqueCardinality2350);
      }
    break;
}
a=(Token)match(input,ID,FOLLOW_ID_in_hyperUniqueCardinality2355);
int alt133=2;
int LA133_0=input.LA(1);
if ((LA133_0 == WS)) {
  alt133=1;
}
switch (alt133) {
case 1:
{
    match(input,WS,FOLLOW_WS_in_hyperUniqueCardinality2357);
  }
break;
}
match(input,RPARAN,FOLLOW_RPARAN_in_hyperUniqueCardinality2360);
postAggItem.fieldName=(a != null ? a.getText() : null);
}
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return postAggItem;
}
Program: 169137
Project: 169137
Buggy source:
public final EqualsToHolder getEquals() throws RecognitionException {
  EqualsToHolder holder=null;
  Token a=null;
  Token b=null;
  try {
{
{
        a=(Token)match(input,ID,FOLLOW_ID_in_getEquals1037);
        int alt53=2;
        int LA53_0=input.LA(1);
        if ((LA53_0 == WS)) {
          alt53=1;
        }
switch (alt53) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_getEquals1039);
          }
        break;
    }
    match(input,EQUALS,FOLLOW_EQUALS_in_getEquals1042);
    int alt54=2;
    int LA54_0=input.LA(1);
    if ((LA54_0 == WS)) {
      alt54=1;
    }
switch (alt54) {
case 1:
{
        match(input,WS,FOLLOW_WS_in_getEquals1044);
      }
    break;
}
b=input.LT(1);
if (input.LA(1) == FLOAT || input.LA(1) == LONG || input.LA(1) == SINGLE_QUOTE_STRING) {
  input.consume();
  state.errorRecovery=false;
}
 else {
  MismatchedSetException mse=new MismatchedSetException(null,input);
  throw mse;
}
}
holder=new EqualsToHolder((a != null ? a.getText() : null),(b != null ? b.getText() : null));
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return holder;
}

Fixed version (ground truth):
public final EqualsToHolder getEquals() throws RecognitionException {
  EqualsToHolder holder=null;
  Token a=null;
  Token b=null;
  try {
{
{
        a=(Token)match(input,ID,FOLLOW_ID_in_getEquals1068);
        int alt54=2;
        int LA54_0=input.LA(1);
        if ((LA54_0 == WS)) {
          alt54=1;
        }
switch (alt54) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_getEquals1070);
          }
        break;
    }
    match(input,EQUALS,FOLLOW_EQUALS_in_getEquals1073);
    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_getEquals1075);
      }
    break;
}
b=input.LT(1);
if (input.LA(1) == FLOAT || input.LA(1) == LONG || input.LA(1) == SINGLE_QUOTE_STRING) {
  input.consume();
  state.errorRecovery=false;
}
 else {
  MismatchedSetException mse=new MismatchedSetException(null,input);
  throw mse;
}
}
holder=new EqualsToHolder((a != null ? a.getText() : null),(b != null ? b.getText() : null));
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return holder;
}
Program: 169141
Project: 169141
Buggy source:
public final Having complexHaving() throws RecognitionException {
  Having having=null;
  Token o=null;
  Having s=null;
  Having a=null;
  Having b=null;
  try {
    int alt95=2;
    alt95=dfa95.predict(input);
switch (alt95) {
case 1:
{
{
          pushFollow(FOLLOW_simpleHaving_in_complexHaving1533);
          s=simpleHaving();
          state._fsp--;
        }
        having=s;
      }
    break;
case 2:
{
{
      pushFollow(FOLLOW_simpleHaving_in_complexHaving1544);
      a=simpleHaving();
      state._fsp--;
      match(input,WS,FOLLOW_WS_in_complexHaving1546);
      o=input.LT(1);
      if (input.LA(1) == AND || input.LA(1) == OR) {
        input.consume();
        state.errorRecovery=false;
      }
 else {
        MismatchedSetException mse=new MismatchedSetException(null,input);
        throw mse;
      }
      match(input,WS,FOLLOW_WS_in_complexHaving1556);
      pushFollow(FOLLOW_complexHaving_in_complexHaving1560);
      b=complexHaving();
      state._fsp--;
    }
    having=new Having((o != null ? o.getText() : null).toLowerCase());
    having.havingSpecs=Arrays.asList(a,b);
  }
break;
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return having;
}

Fixed version (ground truth):
public final Having complexHaving() throws RecognitionException {
  Having having=null;
  Token o=null;
  Having s=null;
  Having a=null;
  Having b=null;
  try {
    int alt96=2;
    alt96=dfa96.predict(input);
switch (alt96) {
case 1:
{
{
          pushFollow(FOLLOW_simpleHaving_in_complexHaving1564);
          s=simpleHaving();
          state._fsp--;
        }
        having=s;
      }
    break;
case 2:
{
{
      pushFollow(FOLLOW_simpleHaving_in_complexHaving1575);
      a=simpleHaving();
      state._fsp--;
      match(input,WS,FOLLOW_WS_in_complexHaving1577);
      o=input.LT(1);
      if (input.LA(1) == AND || input.LA(1) == OR) {
        input.consume();
        state.errorRecovery=false;
      }
 else {
        MismatchedSetException mse=new MismatchedSetException(null,input);
        throw mse;
      }
      match(input,WS,FOLLOW_WS_in_complexHaving1587);
      pushFollow(FOLLOW_complexHaving_in_complexHaving1591);
      b=complexHaving();
      state._fsp--;
    }
    having=new Having((o != null ? o.getText() : null).toLowerCase());
    having.havingSpecs=Arrays.asList(a,b);
  }
break;
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return having;
}
Program: 169144
Project: 169144
Buggy source:
public final PostAggItem simpleArith() throws RecognitionException {
  PostAggItem postAggItem=null;
  PostAggItem a=null;
  PostAggItem b=null;
  postAggItem=new PostAggItem("String_Node_Str");
  try {
{
{
        pushFollow(FOLLOW_simplePostAggAccess_in_simpleArith2114);
        a=simplePostAggAccess();
        state._fsp--;
        postAggItem=a;
      }
      int alt125=2;
      alt125=dfa125.predict(input);
switch (alt125) {
case 1:
{
          int alt123=2;
          int LA123_0=input.LA(1);
          if ((LA123_0 == WS)) {
            alt123=1;
          }
switch (alt123) {
case 1:
{
              match(input,WS,FOLLOW_WS_in_simpleArith2120);
            }
          break;
      }
      pushFollow(FOLLOW_postAggArithOper_in_simpleArith2123);
      postAggArithOper(postAggItem);
      state._fsp--;
      int alt124=2;
      int LA124_0=input.LA(1);
      if ((LA124_0 == WS)) {
        alt124=1;
      }
switch (alt124) {
case 1:
{
          match(input,WS,FOLLOW_WS_in_simpleArith2126);
        }
      break;
  }
  pushFollow(FOLLOW_simplePostAggAccess_in_simpleArith2131);
  b=simplePostAggAccess();
  state._fsp--;
  postAggItem=new PostAggItem("String_Node_Str");
  if (postAggItem.fields == null) {
    postAggItem.fields=new ArrayList<>();
  }
  postAggItem.fields.add(a);
  postAggItem.fields.add(b);
}
break;
}
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return postAggItem;
}

Fixed version (ground truth):
public final PostAggItem simpleArith() throws RecognitionException {
  PostAggItem postAggItem=null;
  PostAggItem a=null;
  PostAggItem b=null;
  postAggItem=new PostAggItem("String_Node_Str");
  try {
{
{
        pushFollow(FOLLOW_simplePostAggAccess_in_simpleArith2145);
        a=simplePostAggAccess();
        state._fsp--;
        postAggItem=a;
      }
      int alt126=2;
      alt126=dfa126.predict(input);
switch (alt126) {
case 1:
{
          int alt124=2;
          int LA124_0=input.LA(1);
          if ((LA124_0 == WS)) {
            alt124=1;
          }
switch (alt124) {
case 1:
{
              match(input,WS,FOLLOW_WS_in_simpleArith2151);
            }
          break;
      }
      pushFollow(FOLLOW_postAggArithOper_in_simpleArith2154);
      postAggArithOper(postAggItem);
      state._fsp--;
      int alt125=2;
      int LA125_0=input.LA(1);
      if ((LA125_0 == WS)) {
        alt125=1;
      }
switch (alt125) {
case 1:
{
          match(input,WS,FOLLOW_WS_in_simpleArith2157);
        }
      break;
  }
  pushFollow(FOLLOW_simplePostAggAccess_in_simpleArith2162);
  b=simplePostAggAccess();
  state._fsp--;
  postAggItem=new PostAggItem("String_Node_Str");
  if (postAggItem.fields == null) {
    postAggItem.fields=new ArrayList<>();
  }
  postAggItem.fields.add(a);
  postAggItem.fields.add(b);
}
break;
}
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return postAggItem;
}
Program: 169145
Project: 169145
Buggy source:
public final void postAggLabel(PostAggItem postAggItem) throws RecognitionException {
  Token id=null;
  try {
{
{
        match(input,AS,FOLLOW_AS_in_postAggLabel2378);
        match(input,WS,FOLLOW_WS_in_postAggLabel2380);
        id=(Token)match(input,ID,FOLLOW_ID_in_postAggLabel2384);
      }
      postAggItem.name=(id != null ? id.getText() : null);
    }
  }
 catch (  RecognitionException re) {
    reportError(re);
    recover(input,re);
  }
 finally {
  }
}

Fixed version (ground truth):
public final void postAggLabel(PostAggItem postAggItem) throws RecognitionException {
  Token id=null;
  try {
{
{
        match(input,AS,FOLLOW_AS_in_postAggLabel2409);
        match(input,WS,FOLLOW_WS_in_postAggLabel2411);
        id=(Token)match(input,ID,FOLLOW_ID_in_postAggLabel2415);
      }
      postAggItem.name=(id != null ? id.getText() : null);
    }
  }
 catch (  RecognitionException re) {
    reportError(re);
    recover(input,re);
  }
 finally {
  }
}
Program: 169146
Project: 169146
Buggy source:
public final void postAggArithOper(PostAggItem postAggItem) throws RecognitionException {
  Token arith=null;
  try {
{
      arith=(Token)match(input,ARITH_OPER,FOLLOW_ARITH_OPER_in_postAggArithOper2400);
      postAggItem.fn=(arith != null ? arith.getText() : null);
    }
  }
 catch (  RecognitionException re) {
    reportError(re);
    recover(input,re);
  }
 finally {
  }
}

Fixed version (ground truth):
public final void postAggArithOper(PostAggItem postAggItem) throws RecognitionException {
  Token arith=null;
  try {
{
      arith=(Token)match(input,ARITH_OPER,FOLLOW_ARITH_OPER_in_postAggArithOper2431);
      postAggItem.fn=(arith != null ? arith.getText() : null);
    }
  }
 catch (  RecognitionException re) {
    reportError(re);
    recover(input,re);
  }
 finally {
  }
}
Program: 169147
Project: 169147
Buggy source:
public final Pair<Integer> pairNums() throws RecognitionException {
  Pair<Integer> pair=null;
  Token i=null;
  Token j=null;
  try {
{
{
        match(input,LSQUARE,FOLLOW_LSQUARE_in_pairNums1327);
        int alt82=2;
        int LA82_0=input.LA(1);
        if ((LA82_0 == WS)) {
          alt82=1;
        }
switch (alt82) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_pairNums1329);
          }
        break;
    }
    i=(Token)match(input,LONG,FOLLOW_LONG_in_pairNums1334);
    int alt83=2;
    int LA83_0=input.LA(1);
    if ((LA83_0 == WS)) {
      alt83=1;
    }
switch (alt83) {
case 1:
{
        match(input,WS,FOLLOW_WS_in_pairNums1337);
      }
    break;
}
match(input,72,FOLLOW_72_in_pairNums1340);
int alt84=2;
int LA84_0=input.LA(1);
if ((LA84_0 == WS)) {
  alt84=1;
}
switch (alt84) {
case 1:
{
    match(input,WS,FOLLOW_WS_in_pairNums1342);
  }
break;
}
j=(Token)match(input,LONG,FOLLOW_LONG_in_pairNums1347);
int alt85=2;
int LA85_0=input.LA(1);
if ((LA85_0 == WS)) {
alt85=1;
}
switch (alt85) {
case 1:
{
match(input,WS,FOLLOW_WS_in_pairNums1349);
}
break;
}
match(input,RSQUARE,FOLLOW_RSQUARE_in_pairNums1352);
}
pair=new Pair<>(Integer.parseInt((i != null ? i.getText() : null)),Integer.parseInt((j != null ? j.getText() : null)));
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return pair;
}

Fixed version (ground truth):
public final Pair<Integer> pairNums() throws RecognitionException {
  Pair<Integer> pair=null;
  Token i=null;
  Token j=null;
  try {
{
{
        match(input,LSQUARE,FOLLOW_LSQUARE_in_pairNums1358);
        int alt83=2;
        int LA83_0=input.LA(1);
        if ((LA83_0 == WS)) {
          alt83=1;
        }
switch (alt83) {
case 1:
{
            match(input,WS,FOLLOW_WS_in_pairNums1360);
          }
        break;
    }
    i=(Token)match(input,LONG,FOLLOW_LONG_in_pairNums1365);
    int alt84=2;
    int LA84_0=input.LA(1);
    if ((LA84_0 == WS)) {
      alt84=1;
    }
switch (alt84) {
case 1:
{
        match(input,WS,FOLLOW_WS_in_pairNums1368);
      }
    break;
}
match(input,72,FOLLOW_72_in_pairNums1371);
int alt85=2;
int LA85_0=input.LA(1);
if ((LA85_0 == WS)) {
  alt85=1;
}
switch (alt85) {
case 1:
{
    match(input,WS,FOLLOW_WS_in_pairNums1373);
  }
break;
}
j=(Token)match(input,LONG,FOLLOW_LONG_in_pairNums1378);
int alt86=2;
int LA86_0=input.LA(1);
if ((LA86_0 == WS)) {
alt86=1;
}
switch (alt86) {
case 1:
{
match(input,WS,FOLLOW_WS_in_pairNums1380);
}
break;
}
match(input,RSQUARE,FOLLOW_RSQUARE_in_pairNums1383);
}
pair=new Pair<>(Integer.parseInt((i != null ? i.getText() : null)),Integer.parseInt((j != null ? j.getText() : null)));
}
}
 catch (RecognitionException re) {
reportError(re);
recover(input,re);
}
 finally {
}
return pair;
}
Program: 169148
Project: 169148
Buggy source:
/** 
 * Register the challenge
 * @return
 */
public int registerChallenge(){
  try {
    String GET_URL=api_url + "String_Node_Str" + this.captchaId+ "String_Node_Str"+ this.challengeId;
    if (this.productType.equals("String_Node_Str")) {
      GET_URL+=String.format("String_Node_Str",this.productType,this.submitBtnId);
    }
 else {
      GET_URL+=String.format("String_Node_Str",this.productType);
    }
    String result_str=readContentFromGet(GET_URL);
    if (32 == result_str.length()) {
      this.challengeId=result_str;
      return 1;
    }
 else {
      System.out.println("String_Node_Str");
      return 0;
    }
  }
 catch (  Exception e) {
    gtlog("String_Node_Str");
  }
  return 0;
}

Fixed version (ground truth):
/** 
 * Register the challenge
 * @return
 */
public int registerChallenge(){
  try {
    String GET_URL=api_url + "String_Node_Str" + this.captchaId;
    String result_str=readContentFromGet(GET_URL);
    if (32 == result_str.length()) {
      this.challengeId=result_str;
      return 1;
    }
 else {
      System.out.println("String_Node_Str");
      return 0;
    }
  }
 catch (  Exception e) {
    gtlog("String_Node_Str");
  }
  return 0;
}
Program: 169149
Project: 169149
Buggy source:
/** 
 * generate the dynamic front source
 * @param different product display mode :float,embed,popup
 * @return
 */
public String getGtFrontSource(){
  String frontSource=String.format("String_Node_Str" + "String_Node_Str",this.api_url,this.captchaId,this.challengeId);
  frontSource+="String_Node_Str";
  return frontSource;
}

Fixed version (ground truth):
/** 
 * generate the dynamic front source
 * @param different product display mode :float,embed,popup
 * @return
 */
public String getGtFrontSource(){
  String frontSource=String.format("String_Node_Str" + "String_Node_Str",this.api_url,this.captchaId,this.challengeId);
  if (this.productType.equals("String_Node_Str")) {
    frontSource+=String.format("String_Node_Str",this.productType,this.submitBtnId);
  }
 else {
    frontSource+=String.format("String_Node_Str",this.productType);
  }
  frontSource+="String_Node_Str";
  return frontSource;
}
Program: 169151
Project: 169151
Buggy source:
/** 
 * Split a string on the configured delimiter
 * @param string the string to split
 * @return a list comprised of the split parts of the given string
 */
protected List<String> split(final String string){
  return Arrays.asList(string.split(delimiter));
}

Fixed version (ground truth):
/** 
 * Split a string on the configured delimiter
 * @param string the string to split
 * @return a list comprised of the split parts of the given string
 */
protected List<String> split(final String string){
  if (null != prefix) {
    return Arrays.asList(string.substring(prefix.length()).split(delimiter));
  }
 else {
    return Arrays.asList(string.split(delimiter));
  }
}
Program: 169152
Project: 169152
Buggy source:
public void setAttribute(String name,String value){
  attributes.put(name,value);
}

Fixed version (ground truth):
@Override public void setAttribute(String name,Object value){
  attributes.put(name,value);
}
Program: 169153
Project: 169153
Buggy source:
public String getAttribute(String name){
  return attributes.get(name);
}

Fixed version (ground truth):
@Override public Object getAttribute(String name){
  return attributes.get(name);
}
Program: 169154
Project: 169154
Buggy source:
public AbstractSettings(){
  attributes=new HashMap<String,String>();
}

Fixed version (ground truth):
public AbstractSettings(){
  attributes=new HashMap<String,Object>();
}
Program: 169156
Project: 169156
Buggy source:
public void setAttribute(String name,Object value){
}

Fixed version (ground truth):
public void setAttribute(String name,Object value){
  throw new UnsupportedOperationException();
}
Program: 169157
Project: 169157
Buggy source:
public void statusChanged(StatusEvent e){
  Stack stack=getStack();
  try {
    int status=e.getStatus().getStatusCode();
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + e.getSource().getIdentity() + "String_Node_Str"+ status);
    }
    if (!e.getStatus().isTerminal()) {
      return;
    }
    Task task=getTask();
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + status);
    }
    Scheduler scheduler=getScheduler(stack);
    if (taskHasListener) {
      task.removeStatusListener(this);
    }
    if (e.getStatus().getStatusCode() == Status.COMPLETED) {
      taskCompleted(e,stack);
      setValue(e.getStatus());
    }
 else     if (e.getStatus().getStatusCode() == Status.FAILED) {
      if (taskFailed(e,stack)) {
        fail(new ExecutionException(e.getStatus().getMessage(),e.getStatus().getException()));
      }
    }
  }
 catch (  Exception ex) {
    logger.debug("String_Node_Str",ex);
    fail(new ExecutionException(AbstractGridNode.this,ex));
  }
}

Fixed version (ground truth):
public void statusChanged(StatusEvent e){
  Stack stack=getStack();
  try {
    int status=e.getStatus().getStatusCode();
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + e.getSource().getIdentity() + "String_Node_Str"+ status);
    }
    if (!e.getStatus().isTerminal()) {
      return;
    }
    Task task=getTask();
    if (logger.isDebugEnabled()) {
      logger.debug("String_Node_Str" + status);
    }
    Scheduler scheduler=getScheduler(stack);
    if (taskHasListener) {
      task.removeStatusListener(this);
    }
    if (e.getStatus().getStatusCode() == Status.COMPLETED) {
      taskCompleted(e,stack);
      setValue(e.getStatus());
    }
 else     if (e.getStatus().getStatusCode() == Status.FAILED) {
      if (taskFailed(e,stack)) {
        fail(new ExecutionException(e.getStatus().getMessage(),e.getStatus().getException()));
      }
    }
 else     if (e.getStatus().getStatusCode() == Status.CANCELED) {
      fail(new ExecutionException("String_Node_Str"));
    }
  }
 catch (  Exception ex) {
    logger.debug("String_Node_Str",ex);
    fail(new ExecutionException(AbstractGridNode.this,ex));
  }
}
Program: 169158
Project: 169158
Buggy source:
public ReplicationManager(Scheduler scheduler,SwiftConfig config){
  this.replicationGroups=new ReplicationGroups(scheduler);
  this.scheduler=scheduler;
  queued=new HashMap<Task,Date>();
  running=new HashMap<Task,Date>();
  try {
    minQueueTime=config.getReplicationMinQueueTime();
    enabled=config.isReplicationEnabled();
    limit=config.getReplicationLimit();
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + "String_Node_Str",e);
    minQueueTime=60;
  }
  if (enabled) {
    Sweeper.getSweeper().register(this);
  }
}

Fixed version (ground truth):
public ReplicationManager(Scheduler scheduler,SwiftConfig config){
  this.replicationGroups=new ReplicationGroups(scheduler);
  this.scheduler=scheduler;
  queued=new HashMap<Task,Date>();
  running=new HashMap<Task,Date>();
  walltimes=new HashMap<Task,Integer>();
  try {
    minQueueTime=config.getReplicationMinQueueTime();
    enabled=config.isReplicationEnabled();
    limit=config.getReplicationLimit();
  }
 catch (  Exception e) {
    logger.warn("String_Node_Str" + "String_Node_Str",e);
    minQueueTime=60;
  }
  if (enabled) {
    Sweeper.getSweeper().register(this);
  }
}
Program: 169159
Project: 169159
Buggy source:
protected void registerRunning(Task task,Date time){
  JobSpecification spec=(JobSpecification)task.getSpecification();
  Object walltime=spec.getAttribute("String_Node_Str");
  int seconds;
  if (walltime == null) {
    seconds=VERY_LARGE_WALLTIME;
  }
 else {
    seconds=WallTime.timeToSeconds(walltime.toString());
  }
  Date deadline=new Date(time.getTime() + WALLTIME_DEADLINE_MULTIPLIER * seconds * 1000);
synchronized (this) {
    running.put(task,deadline);
  }
}

Fixed version (ground truth):
protected void registerRunning(Task task,Date time){
synchronized (this) {
    int seconds=walltimes.remove(task);
    Date deadline=new Date(time.getTime() + WALLTIME_DEADLINE_MULTIPLIER * seconds * 1000);
    running.put(task,deadline);
  }
}
Program: 169160
Project: 169160
Buggy source:
public void register(String rg,Task task) throws CanceledReplicaException {
  if (enabled) {
    replicationGroups.add(rg,task);
  }
}

Fixed version (ground truth):
public void register(String rg,Task task) throws CanceledReplicaException {
  if (enabled) {
    replicationGroups.add(rg,task);
    addWalltime(task);
  }
}
Program: 169161
Project: 169161
Buggy source:
public void add(RootHandle node){
  if (!enabled) {
    return;
  }
  nodes.add(node);
}

Fixed version (ground truth):
/** 
 * Registers a root handle with the collector. The handle will  be cleaned at some point in the future.
 */
public void add(RootHandle node){
  if (!enabled) {
    return;
  }
  nodes.add(node);
}
Program: 169162
Project: 169162
Buggy source:
public void run(){
  try {
    while (true) {
      RootHandle node;
synchronized (queue) {
        while (queue.isEmpty() && !shutdown) {
          queue.wait();
        }
        if (shutdown && queue.isEmpty()) {
          done=true;
          break;
        }
        node=queue.remove();
      }
      try {
        Mapper m=node.getMapper();
        Collection<Path> fringe=node.getFringePaths();
        for (        Path p : fringe) {
          PhysicalFormat pf=m.map(p);
          if (!m.isPersistent(p)) {
            pf.clean();
            m.fileCleaned(pf);
          }
        }
      }
 catch (      Exception e) {
        logger.info("String_Node_Str" + node,e);
      }
    }
  }
 catch (  InterruptedException e) {
  }
  done=true;
}

Fixed version (ground truth):
public void run(){
  try {
    while (true) {
      RootHandle node;
synchronized (queue) {
        while (queue.isEmpty() && !shutdown) {
          queue.wait();
        }
        if (shutdown && queue.isEmpty()) {
          done=true;
          break;
        }
        node=queue.remove();
      }
      try {
        AbstractDataNode dn=(AbstractDataNode)node;
        if (!dn.isCleaned()) {
          Mapper m=node.getMapper();
          Collection<Path> fringe=node.getFringePaths();
          for (          Path p : fringe) {
            PhysicalFormat pf=m.map(p);
            if (!m.isPersistent(p)) {
              pf.clean();
              m.fileCleaned(pf);
            }
          }
        }
      }
 catch (      Exception e) {
        logger.info("String_Node_Str" + node,e);
      }
    }
  }
 catch (  InterruptedException e) {
  }
  done=true;
}
Program: 169163
Project: 169163
Buggy source:
public void clean(){
  if (!enabled) {
    return;
  }
synchronized (queue) {
    queue.addAll(nodes);
    nodes.clear();
    queue.notify();
  }
}

Fixed version (ground truth):
/** 
 * Cleans all handles registered with this collector.
 */
public void clean(){
  if (!enabled) {
    return;
  }
synchronized (queue) {
    queue.addAll(nodes);
    nodes.clear();
    queue.notify();
  }
}