Program: 12256
Project: 12256
Buggy source:
public List<TypeCheckElimination> generateTypeCheckEliminations(){
  List<TypeCheckElimination> typeCheckEliminations=new ArrayList<TypeCheckElimination>();
  StatementExtractor statementExtractor=new StatementExtractor();
  List<Statement> switchStatements=statementExtractor.getSwitchStatements(compositeStatement.getStatement());
  for (  Statement statement : switchStatements) {
    SwitchStatement switchStatement=(SwitchStatement)statement;
    TypeCheckElimination typeCheckElimination=new TypeCheckElimination();
    typeCheckElimination.setTypeCheckCodeFragment(switchStatement);
    List<Statement> statements=switchStatement.statements();
    Expression switchCaseExpression=null;
    for (    Statement statement2 : statements) {
      if (statement2 instanceof SwitchCase) {
        SwitchCase switchCase=(SwitchCase)statement2;
        switchCaseExpression=switchCase.getExpression();
      }
 else {
        if (switchCaseExpression != null && !(statement2 instanceof BreakStatement))         typeCheckElimination.addTypeCheck(switchCaseExpression,statement2);
      }
    }
    typeCheckEliminations.add(typeCheckElimination);
  }
  List<Statement> ifStatements=statementExtractor.getIfStatements(compositeStatement.getStatement());
  TypeCheckElimination typeCheckElimination=new TypeCheckElimination();
  int i=0;
  for (  Statement statement : ifStatements) {
    IfStatement ifStatement=(IfStatement)statement;
    Expression ifExpression=ifStatement.getExpression();
    Statement thenStatement=ifStatement.getThenStatement();
    typeCheckElimination.addTypeCheck(ifExpression,thenStatement);
    if (ifStatements.size() - 1 > i) {
      IfStatement nextIfStatement=(IfStatement)ifStatements.get(i + 1);
      if (!ifStatement.getParent().equals(nextIfStatement)) {
        typeCheckElimination.setTypeCheckCodeFragment(ifStatement);
        typeCheckEliminations.add(typeCheckElimination);
        typeCheckElimination=new TypeCheckElimination();
      }
    }
 else {
      typeCheckEliminations.add(typeCheckElimination);
    }
    i++;
  }
  return typeCheckEliminations;
}

Fixed version (ground truth):
public List<TypeCheckElimination> generateTypeCheckEliminations(){
  List<TypeCheckElimination> typeCheckEliminations=new ArrayList<TypeCheckElimination>();
  StatementExtractor statementExtractor=new StatementExtractor();
  List<Statement> switchStatements=statementExtractor.getSwitchStatements(compositeStatement.getStatement());
  for (  Statement statement : switchStatements) {
    SwitchStatement switchStatement=(SwitchStatement)statement;
    TypeCheckElimination typeCheckElimination=new TypeCheckElimination();
    typeCheckElimination.setTypeCheckCodeFragment(switchStatement);
    List<Statement> statements=switchStatement.statements();
    Expression switchCaseExpression=null;
    for (    Statement statement2 : statements) {
      if (statement2 instanceof SwitchCase) {
        SwitchCase switchCase=(SwitchCase)statement2;
        switchCaseExpression=switchCase.getExpression();
      }
 else {
        if (switchCaseExpression != null && !(statement2 instanceof BreakStatement))         typeCheckElimination.addTypeCheck(switchCaseExpression,statement2);
      }
    }
    typeCheckEliminations.add(typeCheckElimination);
  }
  List<Statement> ifStatements=statementExtractor.getIfStatements(compositeStatement.getStatement());
  TypeCheckElimination typeCheckElimination=new TypeCheckElimination();
  int i=0;
  for (  Statement statement : ifStatements) {
    IfStatement ifStatement=(IfStatement)statement;
    Expression ifExpression=ifStatement.getExpression();
    Statement thenStatement=ifStatement.getThenStatement();
    typeCheckElimination.addTypeCheck(ifExpression,thenStatement);
    if (ifStatements.size() - 1 > i) {
      IfStatement nextIfStatement=(IfStatement)ifStatements.get(i + 1);
      if (!ifStatement.getParent().equals(nextIfStatement)) {
        typeCheckElimination.setTypeCheckCodeFragment(ifStatement);
        typeCheckEliminations.add(typeCheckElimination);
        typeCheckElimination=new TypeCheckElimination();
      }
    }
 else {
      typeCheckElimination.setTypeCheckCodeFragment(ifStatement);
      typeCheckEliminations.add(typeCheckElimination);
    }
    i++;
  }
  return typeCheckEliminations;
}