Program: 160765
Project: 160765
Buggy source:
/** 
 * foreach ($somearray as $foo); foreach ($somearray as $foo) bar();
 */
@Test public void testMinimalForEachCreation() 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";
  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";
  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)10);
  assertThat(node,instanceOf(ForEachStatement.class));
  assertEquals(4,node.getChildCount());
  assertNull(((ForEachStatement)node).getKeyVariable());
  assertNull(((ForEachStatement)node).getStatement());
  assertThat(node2,instanceOf(ForEachStatement.class));
  assertEquals(4,node2.getChildCount());
  assertNull(((ForEachStatement)node2).getKeyVariable());
  assertThat(((ForEachStatement)node2).getStatement(),not(instanceOf(CompoundStatement.class)));
  assertThat(((ForEachStatement)node2).getStatement(),instanceOf(ExpressionStatement.class));
  assertEquals(ast.getNodeById((long)16),((ExpressionStatement)((ForEachStatement)node2).getStatement()).getExpression());
}

Fixed version (ground truth):
/** 
 * foreach ($somearray as $foo); foreach ($somearray as $foo) bar();
 */
@Test public void testMinimalForEachCreation() 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";
  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";
  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)10);
  assertThat(node,instanceOf(ForEachStatement.class));
  assertEquals(4,node.getChildCount());
  assertNull(((ForEachStatement)node).getKeyVariable());
  assertNull(((ForEachStatement)node).getStatement());
  assertThat(node2,instanceOf(ForEachStatement.class));
  assertEquals(4,node2.getChildCount());
  assertNull(((ForEachStatement)node2).getKeyVariable());
  assertThat(((ForEachStatement)node2).getStatement(),not(instanceOf(CompoundStatement.class)));
  assertThat(((ForEachStatement)node2).getStatement(),instanceOf(ExpressionStatement.class));
  assertEquals(ast.getNodeById((long)16),((ExpressionStatement)((ForEachStatement)node2).getStatement()).getExpression());
  assertEquals(Long.valueOf(16),((ExpressionStatement)((ForEachStatement)node2).getStatement()).getNodeId());
}