nus-yam/ex-repair huggingface dataset:
Program: 160769
Project: 160769
Buggy source:
/** 
 * while($foo); while($foo) bar();
 */
@Test public void testMinimalWhileCreation() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  String edgeStr=edgeHeader;
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  handle(nodeStr,edgeStr);
  ASTNode node=ast.getNodeById((long)3);
  ASTNode node2=ast.getNodeById((long)7);
  assertThat(node,instanceOf(WhileStatement.class));
  assertEquals(2,node.getChildCount());
  assertNull(((WhileStatement)node).getStatement());
  assertThat(node2,instanceOf(WhileStatement.class));
  assertEquals(2,node2.getChildCount());
  assertThat(((WhileStatement)node2).getStatement(),not(instanceOf(CompoundStatement.class)));
  assertThat(((WhileStatement)node2).getStatement(),instanceOf(ExpressionStatement.class));
  assertEquals(ast.getNodeById((long)10),((ExpressionStatement)((WhileStatement)node2).getStatement()).getExpression());
}

Fixed version (ground truth):
/** 
 * while($foo); while($foo) bar();
 */
@Test public void testMinimalWhileCreation() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  String edgeStr=edgeHeader;
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  edgeStr+="String_Node_Str";
  handle(nodeStr,edgeStr);
  ASTNode node=ast.getNodeById((long)3);
  ASTNode node2=ast.getNodeById((long)7);
  assertThat(node,instanceOf(WhileStatement.class));
  assertEquals(2,node.getChildCount());
  assertNull(((WhileStatement)node).getStatement());
  assertThat(node2,instanceOf(WhileStatement.class));
  assertEquals(2,node2.getChildCount());
  assertThat(((WhileStatement)node2).getStatement(),not(instanceOf(CompoundStatement.class)));
  assertThat(((WhileStatement)node2).getStatement(),instanceOf(ExpressionStatement.class));
  assertEquals(ast.getNodeById((long)10),((ExpressionStatement)((WhileStatement)node2).getStatement()).getExpression());
  assertEquals(Long.valueOf(10),((ExpressionStatement)((WhileStatement)node2).getStatement()).getNodeId());
}
Program: 160770
Project: 160770
Buggy source:
/** 
 * Checks whether a collection of UseOrDef elements contains a definition/use of a given symbol for a given node.
 */
private boolean containsUseOrDef(UseDefGraph udg,String symbol,long id,boolean isDef){
  List<UseOrDefRecord> useOrDefRecords=udg.getUsesAndDefsForSymbol(symbol);
  for (  UseOrDefRecord useOrDefRecord : useOrDefRecords) {
    if (useOrDefRecord.getAstNode().getProperty(ASTNodeProperties.NODE_ID).equals(String.valueOf(id)) && useOrDefRecord.isDef() == isDef)     return true;
  }
  return false;
}

Fixed version (ground truth):
/** 
 * Checks whether a collection of UseOrDef elements contains a definition/use of a given symbol for a given node.
 */
private boolean containsUseOrDef(UseDefGraph udg,String symbol,long id,boolean isDef){
  List<UseOrDefRecord> useOrDefRecords=udg.getUsesAndDefsForSymbol(symbol);
  for (  UseOrDefRecord useOrDefRecord : useOrDefRecords) {
    if (useOrDefRecord.getAstNode().getNodeId().equals(id) && useOrDefRecord.isDef() == isDef)     return true;
  }
  return false;
}
Program: 160771
Project: 160771
Buggy source:
public String getFunctionSignature(){
  String retval=getName().getEscapedCodeStr();
  if (getParameterList() != null)   retval+="String_Node_Str" + getParameterList().getEscapedCodeStr() + "String_Node_Str";
 else   retval+="String_Node_Str";
  return retval;
}

Fixed version (ground truth):
public String getFunctionSignature(){
  String retval=getIdentifier().getEscapedCodeStr();
  if (getParameterList() != null)   retval+="String_Node_Str" + getParameterList().getEscapedCodeStr() + "String_Node_Str";
 else   retval+="String_Node_Str";
  return retval;
}
Program: 160772
Project: 160772
Buggy source:
public void addChild(ASTNode node){
  if (node instanceof CompoundStatement)   setContent((CompoundStatement)node);
 else   if (node instanceof ParameterList)   setParameterList((ParameterList)node);
 else   if (node instanceof Identifier)   setName((Identifier)node);
  super.addChild(node);
}

Fixed version (ground truth):
public void addChild(ASTNode node){
  if (node instanceof CompoundStatement)   setContent((CompoundStatement)node);
 else   if (node instanceof ParameterList)   setParameterList((ParameterList)node);
 else   if (node instanceof Identifier)   setIdentifier((Identifier)node);
  super.addChild(node);
}
Program: 160773
Project: 160773
Buggy source:
@Override public String getFunctionSignature(){
  return getName().getEscapedCodeStr();
}

Fixed version (ground truth):
@Override public String getFunctionSignature(){
  return getIdentifier().getEscapedCodeStr();
}
Program: 160774
Project: 160774
Buggy source:
public String getName(){
  return astRoot.getName().getEscapedCodeStr();
}

Fixed version (ground truth):
public String getName(){
  return astRoot.getIdentifier().getEscapedCodeStr();
}
Program: 160775
Project: 160775
Buggy source:
public void setName(Function_nameContext ctx,Stack<ASTNodeBuilder> itemStack){
  thisItem.addChild(new Identifier());
  ASTNodeFactory.initializeFromContext(thisItem.getName(),ctx);
}

Fixed version (ground truth):
public void setName(Function_nameContext ctx,Stack<ASTNodeBuilder> itemStack){
  thisItem.addChild(new Identifier());
  ASTNodeFactory.initializeFromContext(thisItem.getIdentifier(),ctx);
}
Program: 160776
Project: 160776
Buggy source:
public void addToDatabaseSafe(ASTNode node){
  try {
    FunctionDatabaseNode function=new FunctionDatabaseNode();
    function.initialize(node);
    addFunctionToDatabase(function);
    linkFunctionToFileNode(function,curFile);
  }
 catch (  RuntimeException ex) {
    ex.printStackTrace();
    System.err.println("String_Node_Str" + ((FunctionDef)node).getName().getEscapedCodeStr());
    return;
  }
}

Fixed version (ground truth):
public void addToDatabaseSafe(ASTNode node){
  try {
    FunctionDatabaseNode function=new FunctionDatabaseNode();
    function.initialize(node);
    addFunctionToDatabase(function);
    linkFunctionToFileNode(function,curFile);
  }
 catch (  RuntimeException ex) {
    ex.printStackTrace();
    System.err.println("String_Node_Str" + ((FunctionDef)node).getIdentifier().getEscapedCodeStr());
    return;
  }
}
Program: 160777
Project: 160777
Buggy source:
@Test public void testMissingFunctiondName() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  FunctionDef func=createASTFromStrings(nodeStr,edgeHeader);
  assertEquals("String_Node_Str",func.getName().getEscapedCodeStr());
}

Fixed version (ground truth):
@Test public void testMissingFunctiondName() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  FunctionDef func=createASTFromStrings(nodeStr,edgeHeader);
  assertEquals("String_Node_Str",func.getIdentifier().getEscapedCodeStr());
}
Program: 160778
Project: 160778
Buggy source:
@Test public void testFunctionName() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  FunctionDef func=createASTFromStrings(nodeStr,edgeHeader);
  assertEquals("String_Node_Str",func.getName().getEscapedCodeStr());
}

Fixed version (ground truth):
@Test public void testFunctionName() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  FunctionDef func=createASTFromStrings(nodeStr,edgeHeader);
  assertEquals("String_Node_Str",func.getIdentifier().getEscapedCodeStr());
}
Program: 160780
Project: 160780
Buggy source:
/** 
 * function foo() {}
 */
@Test public void testSingleFunction() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getName().getEscapedCodeStr());
  assertEquals(null,function3);
}

Fixed version (ground truth):
/** 
 * function foo() {}
 */
@Test public void testSingleFunction() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getIdentifier().getEscapedCodeStr());
  assertEquals(null,function3);
}
Program: 160781
Project: 160781
Buggy source:
/** 
 * function foo() {} true;
 */
@Test public void testFunctionPlusTopLevel() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getName().getEscapedCodeStr());
  assertEquals(null,function3);
}

Fixed version (ground truth):
/** 
 * function foo() {} true;
 */
@Test public void testFunctionPlusTopLevel() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getIdentifier().getEscapedCodeStr());
  assertEquals(null,function3);
}
Program: 160782
Project: 160782
Buggy source:
/** 
 * function foo() { function() {}; }
 */
@Test public void testFunctionWithClosure() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  FunctionDef function4=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function3.getName().getEscapedCodeStr());
  assertEquals(null,function4);
}

Fixed version (ground truth):
/** 
 * function foo() { function() {}; }
 */
@Test public void testFunctionWithClosure() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  FunctionDef function4=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function3.getIdentifier().getEscapedCodeStr());
  assertEquals(null,function4);
}
Program: 160783
Project: 160783
Buggy source:
/** 
 * foo.php ------- function foo() {} bar.php ------- function bar() {}
 */
@Test public void testTwoFiles() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  FunctionDef function4=extractor.getNextFunction();
  FunctionDef function5=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function3.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function4.getName().getEscapedCodeStr());
  assertEquals(null,function5);
}

Fixed version (ground truth):
/** 
 * foo.php ------- function foo() {} bar.php ------- function bar() {}
 */
@Test public void testTwoFiles() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  FunctionDef function4=extractor.getNextFunction();
  FunctionDef function5=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function3.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function4.getIdentifier().getEscapedCodeStr());
  assertEquals(null,function5);
}
Program: 160784
Project: 160784
Buggy source:
/** 
 * function foo() {} function bar() {}
 */
@Test public void testTwoFunctions() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  FunctionDef function4=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function3.getName().getEscapedCodeStr());
  assertEquals(null,function4);
}

Fixed version (ground truth):
/** 
 * function foo() {} function bar() {}
 */
@Test public void testTwoFunctions() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  FunctionDef function4=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function3.getIdentifier().getEscapedCodeStr());
  assertEquals(null,function4);
}
Program: 160785
Project: 160785
Buggy source:
/** 
 * class foo {}
 */
@Test public void testSingleClass() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getName().getEscapedCodeStr());
  assertEquals(null,function3);
}

Fixed version (ground truth):
/** 
 * class foo {}
 */
@Test public void testSingleClass() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getIdentifier().getEscapedCodeStr());
  assertEquals(null,function3);
}
Program: 160786
Project: 160786
Buggy source:
/** 
 * function foo() { function bar() {} }
 */
@Test public void testFunctionWithInnerFunction() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  FunctionDef function4=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function3.getName().getEscapedCodeStr());
  assertEquals(null,function4);
}

Fixed version (ground truth):
/** 
 * function foo() { function bar() {} }
 */
@Test public void testFunctionWithInnerFunction() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  FunctionDef function4=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function3.getIdentifier().getEscapedCodeStr());
  assertEquals(null,function4);
}
Program: 160787
Project: 160787
Buggy source:
/** 
 * true; function foo() {} true;
 */
@Test public void testTopLevelFuncTopLevel() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getName().getEscapedCodeStr());
  assertEquals(null,function3);
}

Fixed version (ground truth):
/** 
 * true; function foo() {} true;
 */
@Test public void testTopLevelFuncTopLevel() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getIdentifier().getEscapedCodeStr());
  assertEquals(null,function3);
}
Program: 160788
Project: 160788
Buggy source:
/** 
 * function foo() { function bar() {} } function buz() {}
 */
@Test public void testTwoFunctionsAndInnerFunction() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  FunctionDef function4=extractor.getNextFunction();
  FunctionDef function5=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function3.getName().getEscapedCodeStr());
  assertEquals("String_Node_Str",function4.getName().getEscapedCodeStr());
  assertEquals(null,function5);
}

Fixed version (ground truth):
/** 
 * function foo() { function bar() {} } function buz() {}
 */
@Test public void testTwoFunctionsAndInnerFunction() throws IOException, InvalidCSVFile {
  String nodeStr=nodeHeader;
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeStr+="String_Node_Str";
  nodeReader=new StringReader(nodeStr);
  extractor.initialize(nodeReader,edgeReader);
  FunctionDef function=extractor.getNextFunction();
  FunctionDef function2=extractor.getNextFunction();
  FunctionDef function3=extractor.getNextFunction();
  FunctionDef function4=extractor.getNextFunction();
  FunctionDef function5=extractor.getNextFunction();
  assertEquals("String_Node_Str",function.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function2.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function3.getIdentifier().getEscapedCodeStr());
  assertEquals("String_Node_Str",function4.getIdentifier().getEscapedCodeStr());
  assertEquals(null,function5);
}
Program: 160790
Project: 160790
Buggy source:
@Test public void testFunctionPtrParam(){
  String input="String_Node_Str";
  List<ASTNode> codeItems=parseInput(input);
  FunctionDef codeItem=(FunctionDef)codeItems.get(0);
  System.out.println(codeItem.getEscapedCodeStr());
  assertTrue(codeItem.getName().getEscapedCodeStr().equals("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testFunctionPtrParam(){
  String input="String_Node_Str";
  List<ASTNode> codeItems=parseInput(input);
  FunctionDef codeItem=(FunctionDef)codeItems.get(0);
  System.out.println(codeItem.getEscapedCodeStr());
  assertTrue(codeItem.getIdentifier().getEscapedCodeStr().equals("String_Node_Str"));
}
Program: 160791
Project: 160791
Buggy source:
@Test public void testFuncName(){
  String input="String_Node_Str";
  List<ASTNode> codeItems=parseInput(input);
  FunctionDef codeItem=(FunctionDef)codeItems.get(0);
  assertTrue(codeItem.getName().getEscapedCodeStr().equals("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testFuncName(){
  String input="String_Node_Str";
  List<ASTNode> codeItems=parseInput(input);
  FunctionDef codeItem=(FunctionDef)codeItems.get(0);
  assertTrue(codeItem.getIdentifier().getEscapedCodeStr().equals("String_Node_Str"));
}
Program: 160792
Project: 160792
Buggy source:
@Test public void testFunctionInClass(){
  String input="String_Node_Str";
  List<ASTNode> codeItems=parseInput(input);
  ClassDefStatement codeItem=(ClassDefStatement)codeItems.get(0);
  FunctionDef funcItem=(FunctionDef)codeItem.content.getStatements().get(0);
  assertTrue(funcItem.getName().getEscapedCodeStr().equals("String_Node_Str"));
}

Fixed version (ground truth):
@Test public void testFunctionInClass(){
  String input="String_Node_Str";
  List<ASTNode> codeItems=parseInput(input);
  ClassDefStatement codeItem=(ClassDefStatement)codeItems.get(0);
  FunctionDef funcItem=(FunctionDef)codeItem.content.getStatements().get(0);
  assertTrue(funcItem.getIdentifier().getEscapedCodeStr().equals("String_Node_Str"));
}
Program: 160793
Project: 160793
Buggy source:
private void reportUpstream(UseDefEnvironment childEnv){
  Collection<String> symbols=childEnv.upstreamSymbols();
  try {
    UseDefEnvironment parentEnv=environmentStack.peek();
    parentEnv.addChildSymbols(symbols);
    Collection<UseOrDef> toEmit=parentEnv.useOrDefsFromChildSymbols();
    emitUseOrDefs(toEmit);
  }
 catch (  EmptyStackException ex) {
    LinkedList<UseOrDef> toEmit=childEnv.createUsesForAllSymbols(symbols);
    emitUseOrDefs(toEmit);
  }
}

Fixed version (ground truth):
private void reportUpstream(UseDefEnvironment childEnv){
  LinkedList<String> symbols=childEnv.upstreamSymbols();
  try {
    UseDefEnvironment parentEnv=environmentStack.peek();
    parentEnv.addChildSymbols(symbols);
    Collection<UseOrDef> toEmit=parentEnv.useOrDefsFromChildSymbols();
    emitUseOrDefs(toEmit);
  }
 catch (  EmptyStackException ex) {
    LinkedList<UseOrDef> toEmit=childEnv.createUsesForAllSymbols(symbols);
    emitUseOrDefs(toEmit);
  }
}
Program: 160794
Project: 160794
Buggy source:
public void addChildSymbols(Collection<String> childSymbols){
  if (childNum != 0)   useSymbols.addAll(childSymbols);
 else   symbolsForUpstream.addAll(childSymbols);
}

Fixed version (ground truth):
public void addChildSymbols(LinkedList<String> childSymbols){
  if (childNum != 0)   useSymbols.addAll(childSymbols);
 else   symbolsForUpstream.addAll(childSymbols);
}
Program: 160795
Project: 160795
Buggy source:
public Collection<String> upstreamSymbols(){
  return emptySymbolList;
}

Fixed version (ground truth):
public LinkedList<String> upstreamSymbols(){
  return emptySymbolList;
}
Program: 160796
Project: 160796
Buggy source:
public void addChildSymbols(Collection<String> childSymbols){
  if (isDef())   defSymbols.addAll(childSymbols);
  if (isUse())   useSymbols.addAll(childSymbols);
}

Fixed version (ground truth):
public void addChildSymbols(LinkedList<String> childSymbols){
  if (isDef())   defSymbols.addAll(childSymbols);
  if (isUse())   useSymbols.addAll(childSymbols);
}
Program: 160797
Project: 160797
Buggy source:
public void addChildSymbols(Collection<String> childSymbols){
  if (isDef()) {
    if (childSymbols.size() > 1) {
      Iterator<String> iterator=childSymbols.iterator();
      iterator.next();
      while (iterator.hasNext()) {
        String next=iterator.next();
        defSymbols.add(next);
      }
    }
 else     defSymbols.addAll(childSymbols);
  }
  if (isUse())   symbolsForUpstream.addAll(childSymbols);
}

Fixed version (ground truth):
public void addChildSymbols(LinkedList<String> childSymbols){
  if (isDef()) {
    if (childSymbols.size() > 1) {
      defSymbols.add(childSymbols.getLast());
    }
 else     defSymbols.addAll(childSymbols);
  }
  if (isUse())   symbolsForUpstream.addAll(childSymbols);
}
Program: 160798
Project: 160798
Buggy source:
public Collection<String> upstreamSymbols(){
  return symbolsForUpstream;
}

Fixed version (ground truth):
public LinkedList<String> upstreamSymbols(){
  return symbolsForUpstream;
}
Program: 160799
Project: 160799
Buggy source:
public void addChildSymbols(Collection<String> childSymbols){
  useSymbols.addAll(childSymbols);
}

Fixed version (ground truth):
public void addChildSymbols(LinkedList<String> childSymbols){
  useSymbols.addAll(childSymbols);
}
Program: 160800
Project: 160800
Buggy source:
public Collection<String> upstreamSymbols(){
  String code=astProvider.getEscapedCodeStr();
  ArrayList<String> retval=new ArrayList<String>();
  retval.add(code);
  return retval;
}

Fixed version (ground truth):
public LinkedList<String> upstreamSymbols(){
  String code=astProvider.getEscapedCodeStr();
  LinkedList<String> retval=new LinkedList<String>();
  retval.add(code);
  return retval;
}
Program: 160801
Project: 160801
Buggy source:
public Collection<UseOrDef> useOrDefsFromChildSymbols(){
  if (childNum != 0)   return emptyUseOrDef;
  LinkedList<String> symbols=new LinkedList<String>();
  symbols.add(leftMostSymbol);
  return createUsesForAllSymbols(symbols);
}

Fixed version (ground truth):
public Collection<UseOrDef> useOrDefsFromChildSymbols(){
  if (childNum != 0)   return emptyUseOrDef;
  return createUsesForAllSymbols(symbolsForUpstream);
}
Program: 160802
Project: 160802
Buggy source:
public Collection<String> upstreamSymbols(){
  if (emitted)   return emptySymbolList;
  emitted=true;
  LinkedList<String> retval=new LinkedList<String>();
  retval.add(leftMostSymbol);
  String codeStr=astProvider.getEscapedCodeStr();
  retval.add(codeStr);
  return retval;
}

Fixed version (ground truth):
public LinkedList<String> upstreamSymbols(){
  if (emitted)   return emptySymbolList;
  emitted=true;
  LinkedList<String> retval=new LinkedList<String>();
  retval.addAll(symbolsForUpstream);
  String codeStr=astProvider.getEscapedCodeStr();
  retval.add(codeStr);
  return retval;
}
Program: 160803
Project: 160803
Buggy source:
public void addChildSymbols(Collection<String> childSymbols){
  if (childNum == 0 && childSymbols.size() == 1) {
    leftMostSymbol=childSymbols.iterator().next();
  }
}

Fixed version (ground truth):
public void addChildSymbols(LinkedList<String> childSymbols){
  if (childNum != 0)   return;
  super.addChildSymbols(childSymbols);
}
Program: 160804
Project: 160804
Buggy source:
public Collection<String> upstreamSymbols(){
  return symbolsForUpstream;
}

Fixed version (ground truth):
public LinkedList<String> upstreamSymbols(){
  return symbolsForUpstream;
}
Program: 160805
Project: 160805
Buggy source:
public void addChildSymbols(Collection<String> childSymbols){
  symbolsForUpstream.addAll(childSymbols);
}

Fixed version (ground truth):
public void addChildSymbols(LinkedList<String> childSymbols){
  symbolsForUpstream.addAll(childSymbols);
}
Program: 160806
Project: 160806
Buggy source:
public void pop(){
  ASTNode topOfItemStack=itemStack.peek();
  if (stack.size() > 0 && stack.peek().parentCompound == topOfItemStack) {
    stack.pop();
  }
}

Fixed version (ground truth):
public void pop(){
  ASTNode topOfItemStack=itemStack.peek();
  while (stack.size() > 0 && stack.peek().parentCompound == topOfItemStack) {
    stack.pop();
  }
}
Program: 160807
Project: 160807
Buggy source:
public void pop(){
  ASTNode topOfItemStack=itemStack.peek();
  if (stack.size() > 0 && stack.peek().parentCompound == topOfItemStack) {
    stack.pop();
  }
}

Fixed version (ground truth):
public void pop(){
  ASTNode topOfItemStack=itemStack.peek();
  while (stack.size() > 0 && stack.peek().parentCompound == topOfItemStack) {
    stack.pop();
  }
}
Program: 160808
Project: 160808
Buggy source:
private DoStatement getDoFromShadowStack(){
  DoStatement retval;
  ASTNode first=null;
  ASTNode second=null;
  try {
    first=shadowStack.pop();
    second=shadowStack.pop();
    retval=(DoStatement)second;
  }
 catch (  EmptyStackException ex) {
    return null;
  }
catch (  ClassCastException ex) {
    shadowStack.push(second);
    shadowStack.push(first);
    return null;
  }
  return retval;
}

Fixed version (ground truth):
private DoStatement getDoFromShadowStack(){
  DoStatement retval;
  ASTNode first=null;
  ASTNode second=null;
  try {
    first=shadowStack.pop();
    second=shadowStack.pop();
    retval=(DoStatement)second;
    if (itemStack.contains(retval)) {
      shadowStack.push(second);
      shadowStack.push(first);
      return null;
    }
  }
 catch (  EmptyStackException ex) {
    return null;
  }
catch (  ClassCastException ex) {
    shadowStack.push(second);
    shadowStack.push(first);
    return null;
  }
  return retval;
}
Program: 160809
Project: 160809
Buggy source:
private IndexHits<Long> lookupCallee(String callee){
  String query="String_Node_Str" + callee + "String_Node_Str";
  IndexHits<Long> hits=Neo4JBatchInserter.queryIndex(query);
  return hits;
}

Fixed version (ground truth):
private IndexHits<Long> lookupCallee(String callee){
  if (callee.contains("String_Node_Str"))   return null;
  String query="String_Node_Str" + callee + "String_Node_Str";
  IndexHits<Long> hits=Neo4JBatchInserter.queryIndex(query);
  return hits;
}
Program: 160810
Project: 160810
Buggy source:
private void createOutgoingCallGraphEdges(Long funcId){
  IndexHits<Long> calls=getOutgoingCallsFromIndex(funcId);
  for (  long callId : calls) {
    IndexHits<Long> dstIds=resolveCalledFunction(callId);
    createCallGraphEdges(funcId,dstIds,callId);
  }
}

Fixed version (ground truth):
private void createOutgoingCallGraphEdges(Long funcId){
  IndexHits<Long> calls=getOutgoingCallsFromIndex(funcId);
  for (  long callId : calls) {
    IndexHits<Long> dstIds=resolveCalledFunction(callId);
    if (dstIds == null)     continue;
    createCallGraphEdges(funcId,dstIds,callId);
  }
}
Program: 160811
Project: 160811
Buggy source:
@Override public void visit(FunctionDef item){
}

Fixed version (ground truth):
public void visit(FunctionDef item){
}
Program: 160812
Project: 160812
Buggy source:
@Override public void visit(ExprStatementItem statementItem){
}

Fixed version (ground truth):
public void visit(ClassDef item){
  Document newDocument=DocumentVendor.createNewDocument();
  documents.add(newDocument);
  ClassDefToDocumentConverter.convert(item,filename,documents);
}
Program: 160813
Project: 160813
Buggy source:
public abstract void visit(ExprStatementItem statementItem);

Fixed version (ground truth):
public void visit(ExprStatementItem statementItem){
  defaultHandler(statementItem);
}
Program: 160814
Project: 160814
Buggy source:
private CompoundStatement parseFunctionContents(Function_defContext ctx){
  String text=getCompoundStmtAsString(ctx);
  FunctionParser parser=new FunctionParser();
  parser.enableFineParsing();
  try {
    parser.parseAndWalkString(text);
  }
 catch (  RuntimeException ex) {
    ex.printStackTrace();
    System.err.println("String_Node_Str" + ctx.function_name().getText() + "String_Node_Str");
  }
  return parser.getResult();
}

Fixed version (ground truth):
private CompoundStatement parseFunctionContents(Function_defContext ctx){
  String text=getCompoundStmtAsString(ctx);
  FunctionParser parser=new FunctionParser();
  parser.enableFineParsing();
  try {
    parser.parseAndWalkString(text);
  }
 catch (  RuntimeException ex) {
    System.err.println("String_Node_Str" + ctx.function_name().getText() + "String_Node_Str");
  }
  return parser.getResult();
}
Program: 160815
Project: 160815
Buggy source:
private void processSingleFile(String filename){
  try {
    parser.parseAndWalkFile(filename);
  }
 catch (  ParserException ex) {
    System.err.println("String_Node_Str" + filename);
  }
}

Fixed version (ground truth):
private void processSingleFile(String filename){
  System.out.println(filename);
  try {
    parser.parseAndWalkFile(filename);
  }
 catch (  ParserException ex) {
    System.err.println("String_Node_Str" + filename);
  }
}
Program: 160816
Project: 160816
Buggy source:
@Override public void action(RuleContext _localctx,int ruleIndex,int actionIndex){
switch (ruleIndex) {
case 101:
    COMMENT_action((RuleContext)_localctx,actionIndex);
  break;
case 102:
WHITESPACE_action((RuleContext)_localctx,actionIndex);
break;
case 103:
CPPCOMMENT_action((RuleContext)_localctx,actionIndex);
break;
case 104:
OTHER_action((RuleContext)_localctx,actionIndex);
break;
}
}

Fixed version (ground truth):
@Override public void action(RuleContext _localctx,int ruleIndex,int actionIndex){
switch (ruleIndex) {
case 102:
    COMMENT_action((RuleContext)_localctx,actionIndex);
  break;
case 103:
WHITESPACE_action((RuleContext)_localctx,actionIndex);
break;
case 104:
CPPCOMMENT_action((RuleContext)_localctx,actionIndex);
break;
case 105:
OTHER_action((RuleContext)_localctx,actionIndex);
break;
}
}
Program: 160818
Project: 160818
Buggy source:
public final NumberContext number() throws RecognitionException {
  NumberContext _localctx=new NumberContext(_ctx,getState());
  enterRule(_localctx,130,RULE_number);
  int _la;
  try {
    enterOuterAlt(_localctx,1);
{
      setState(591);
      _la=_input.LA(1);
      if (!(((((_la - 89)) & ~0x3f) == 0 && ((1L << (_la - 89)) & ((1L << (HEX_LITERAL - 89)) | (1L << (DECIMAL_LITERAL - 89)) | (1L << (OCTAL_LITERAL - 89)))) != 0))) {
        _errHandler.recoverInline(this);
      }
      consume();
    }
  }
 catch (  RecognitionException re) {
    _localctx.exception=re;
    _errHandler.reportError(this,re);
    _errHandler.recover(this,re);
  }
 finally {
    exitRule();
  }
  return _localctx;
}

Fixed version (ground truth):
public final NumberContext number() throws RecognitionException {
  NumberContext _localctx=new NumberContext(_ctx,getState());
  enterRule(_localctx,130,RULE_number);
  int _la;
  try {
    enterOuterAlt(_localctx,1);
{
      setState(604);
      _la=_input.LA(1);
      if (!(((((_la - 90)) & ~0x3f) == 0 && ((1L << (_la - 90)) & ((1L << (HEX_LITERAL - 90)) | (1L << (DECIMAL_LITERAL - 90)) | (1L << (OCTAL_LITERAL - 90)))) != 0))) {
        _errHandler.recoverInline(this);
      }
      consume();
    }
  }
 catch (  RecognitionException re) {
    _localctx.exception=re;
    _errHandler.reportError(this,re);
    _errHandler.recover(this,re);
  }
 finally {
    exitRule();
  }
  return _localctx;
}
Program: 160819
Project: 160819
Buggy source:
public final Param_type_listContext param_type_list() throws RecognitionException {
  Param_type_listContext _localctx=new Param_type_listContext(_ctx,getState());
  enterRule(_localctx,122,RULE_param_type_list);
  int _la;
  try {
    setState(563);
switch (getInterpreter().adaptivePredict(_input,58,_ctx)) {
case 1:
      enterOuterAlt(_localctx,1);
{
      setState(548);
      match(28);
      setState(549);
      match(VOID);
      setState(550);
      match(12);
    }
  break;
case 2:
enterOuterAlt(_localctx,2);
{
setState(551);
match(28);
setState(560);
_la=_input.LA(1);
if (((((_la - 67)) & ~0x3f) == 0 && ((1L << (_la - 67)) & ((1L << (VOID - 67)) | (1L << (UNSIGNED - 67)) | (1L << (SIGNED - 67))| (1L << (LONG - 67))| (1L << (CV_QUALIFIER - 67))| (1L << (AUTO - 67))| (1L << (REGISTER - 67))| (1L << (CLASS_KEY - 67))| (1L << (ALPHA_NUMERIC - 67)))) != 0)) {
{
    setState(552);
    param_type();
    setState(557);
    _errHandler.sync(this);
    _la=_input.LA(1);
    while (_la == 26) {
{
{
          setState(553);
          match(26);
          setState(554);
          param_type();
        }
      }
      setState(559);
      _errHandler.sync(this);
      _la=_input.LA(1);
    }
  }
}
setState(562);
match(12);
}
break;
}
}
 catch (RecognitionException re) {
_localctx.exception=re;
_errHandler.reportError(this,re);
_errHandler.recover(this,re);
}
 finally {
exitRule();
}
return _localctx;
}

Fixed version (ground truth):
public final Param_type_listContext param_type_list() throws RecognitionException {
  Param_type_listContext _localctx=new Param_type_listContext(_ctx,getState());
  enterRule(_localctx,122,RULE_param_type_list);
  int _la;
  try {
    setState(576);
switch (getInterpreter().adaptivePredict(_input,59,_ctx)) {
case 1:
      enterOuterAlt(_localctx,1);
{
      setState(561);
      match(29);
      setState(562);
      match(VOID);
      setState(563);
      match(12);
    }
  break;
case 2:
enterOuterAlt(_localctx,2);
{
setState(564);
match(29);
setState(573);
_la=_input.LA(1);
if (((((_la - 68)) & ~0x3f) == 0 && ((1L << (_la - 68)) & ((1L << (VOID - 68)) | (1L << (UNSIGNED - 68)) | (1L << (SIGNED - 68))| (1L << (LONG - 68))| (1L << (CV_QUALIFIER - 68))| (1L << (AUTO - 68))| (1L << (REGISTER - 68))| (1L << (CLASS_KEY - 68))| (1L << (ALPHA_NUMERIC - 68)))) != 0)) {
{
    setState(565);
    param_type();
    setState(570);
    _errHandler.sync(this);
    _la=_input.LA(1);
    while (_la == 27) {
{
{
          setState(566);
          match(27);
          setState(567);
          param_type();
        }
      }
      setState(572);
      _errHandler.sync(this);
      _la=_input.LA(1);
    }
  }
}
setState(575);
match(12);
}
break;
}
}
 catch (RecognitionException re) {
_localctx.exception=re;
_errHandler.reportError(this,re);
_errHandler.recover(this,re);
}
 finally {
exitRule();
}
return _localctx;
}
Program: 160820
Project: 160820
Buggy source:
public final Primary_expressionContext primary_expression() throws RecognitionException {
  Primary_expressionContext _localctx=new Primary_expressionContext(_ctx,getState());
  enterRule(_localctx,88,RULE_primary_expression);
  try {
    setState(397);
switch (_input.LA(1)) {
case ALPHA_NUMERIC:
      enterOuterAlt(_localctx,1);
{
      setState(391);
      identifier();
    }
  break;
case HEX_LITERAL:
case DECIMAL_LITERAL:
case OCTAL_LITERAL:
case FLOATING_POINT_LITERAL:
case CHAR:
case STRING:
enterOuterAlt(_localctx,2);
{
setState(392);
constant();
}
break;
case 28:
enterOuterAlt(_localctx,3);
{
setState(393);
match(28);
setState(394);
expr();
setState(395);
match(12);
}
break;
default :
throw new NoViableAltException(this);
}
}
 catch (RecognitionException re) {
_localctx.exception=re;
_errHandler.reportError(this,re);
_errHandler.recover(this,re);
}
 finally {
exitRule();
}
return _localctx;
}

Fixed version (ground truth):
public final Primary_expressionContext primary_expression() throws RecognitionException {
  Primary_expressionContext _localctx=new Primary_expressionContext(_ctx,getState());
  enterRule(_localctx,88,RULE_primary_expression);
  try {
    setState(410);
switch (_input.LA(1)) {
case ALPHA_NUMERIC:
      enterOuterAlt(_localctx,1);
{
      setState(404);
      identifier();
    }
  break;
case HEX_LITERAL:
case DECIMAL_LITERAL:
case OCTAL_LITERAL:
case FLOATING_POINT_LITERAL:
case CHAR:
case STRING:
enterOuterAlt(_localctx,2);
{
setState(405);
constant();
}
break;
case 29:
enterOuterAlt(_localctx,3);
{
setState(406);
match(29);
setState(407);
expr();
setState(408);
match(12);
}
break;
default :
throw new NoViableAltException(this);
}
}
 catch (RecognitionException re) {
_localctx.exception=re;
_errHandler.reportError(this,re);
_errHandler.recover(this,re);
}
 finally {
exitRule();
}
return _localctx;
}