Program: 12105
Project: 12105
Buggy source:
private List<CFGNode> processIfStatement(List<CFGNode> previousNodes,CompositeStatementObject compositeStatement,int action){
  CFGBranchIfNode currentNode=new CFGBranchIfNode(compositeStatement);
  handleAction(currentNode,action);
  nodes.add(currentNode);
  directlyNestedNodeInTryBlock(currentNode);
  createTopDownFlow(previousNodes,currentNode);
  previousNodes=new ArrayList<CFGNode>();
  List<AbstractStatement> ifStatementList=compositeStatement.getStatements();
  AbstractStatement thenClause=ifStatementList.get(0);
  if (thenClause instanceof StatementObject) {
    StatementObject thenClauseStatement=(StatementObject)thenClause;
    CFGNode thenClauseNode=createNonCompositeNode(thenClauseStatement);
    nodes.add(thenClauseNode);
    ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
    currentNodes.add(currentNode);
    createTopDownFlow(currentNodes,thenClauseNode);
    previousNodes.add(thenClauseNode);
  }
 else   if (thenClause instanceof CompositeStatementObject) {
    CompositeStatementObject thenClauseCompositeStatement=(CompositeStatementObject)thenClause;
    ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
    currentNodes.add(currentNode);
    if (thenClauseCompositeStatement.getStatement() instanceof IfStatement)     previousNodes.addAll(processIfStatement(currentNodes,thenClauseCompositeStatement,JOIN_TOP_LIST));
 else     previousNodes.addAll(process(currentNodes,thenClauseCompositeStatement));
  }
  if (ifStatementList.size() == 2) {
    AbstractStatement elseClause=ifStatementList.get(1);
    if (elseClause instanceof StatementObject) {
      StatementObject elseClauseStatement=(StatementObject)elseClause;
      CFGNode elseClauseNode=createNonCompositeNode(elseClauseStatement);
      nodes.add(elseClauseNode);
      ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
      currentNodes.add(currentNode);
      createTopDownFlow(currentNodes,elseClauseNode);
      previousNodes.add(elseClauseNode);
    }
 else     if (elseClause instanceof CompositeStatementObject) {
      CompositeStatementObject elseClauseCompositeStatement=(CompositeStatementObject)elseClause;
      ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
      currentNodes.add(currentNode);
      if (elseClauseCompositeStatement.getStatement() instanceof IfStatement)       previousNodes.addAll(processIfStatement(currentNodes,elseClauseCompositeStatement,JOIN_TOP_LIST));
 else       previousNodes.addAll(process(currentNodes,elseClauseCompositeStatement));
    }
  }
 else {
    previousNodes.add(currentNode);
  }
  return previousNodes;
}

Fixed version (ground truth):
private List<CFGNode> processIfStatement(List<CFGNode> previousNodes,CompositeStatementObject compositeStatement,int action){
  CFGBranchIfNode currentNode=new CFGBranchIfNode(compositeStatement);
  handleAction(currentNode,action);
  nodes.add(currentNode);
  directlyNestedNodeInTryBlock(currentNode);
  createTopDownFlow(previousNodes,currentNode);
  previousNodes=new ArrayList<CFGNode>();
  List<AbstractStatement> ifStatementList=compositeStatement.getStatements();
  AbstractStatement thenClause=ifStatementList.get(0);
  if (thenClause instanceof StatementObject) {
    StatementObject thenClauseStatement=(StatementObject)thenClause;
    CFGNode thenClauseNode=createNonCompositeNode(thenClauseStatement);
    nodes.add(thenClauseNode);
    ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
    currentNodes.add(currentNode);
    createTopDownFlow(currentNodes,thenClauseNode);
    previousNodes.add(thenClauseNode);
  }
 else   if (thenClause instanceof CompositeStatementObject) {
    CompositeStatementObject thenClauseCompositeStatement=(CompositeStatementObject)thenClause;
    ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
    currentNodes.add(currentNode);
    if (thenClauseCompositeStatement.getStatement() instanceof IfStatement)     previousNodes.addAll(processIfStatement(currentNodes,thenClauseCompositeStatement,JOIN_TOP_LIST));
 else     if (thenClauseCompositeStatement.getStatement() instanceof SwitchStatement)     previousNodes.addAll(processSwitchStatement(currentNodes,thenClauseCompositeStatement,JOIN_TOP_LIST));
 else     if (isLoop(thenClauseCompositeStatement))     previousNodes.addAll(processLoopStatement(currentNodes,thenClauseCompositeStatement));
 else     if (thenClauseCompositeStatement.getStatement() instanceof DoStatement)     previousNodes.addAll(processDoStatement(currentNodes,thenClauseCompositeStatement));
 else     previousNodes.addAll(process(currentNodes,thenClauseCompositeStatement));
  }
  if (ifStatementList.size() == 2) {
    AbstractStatement elseClause=ifStatementList.get(1);
    if (elseClause instanceof StatementObject) {
      StatementObject elseClauseStatement=(StatementObject)elseClause;
      CFGNode elseClauseNode=createNonCompositeNode(elseClauseStatement);
      nodes.add(elseClauseNode);
      ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
      currentNodes.add(currentNode);
      createTopDownFlow(currentNodes,elseClauseNode);
      previousNodes.add(elseClauseNode);
    }
 else     if (elseClause instanceof CompositeStatementObject) {
      CompositeStatementObject elseClauseCompositeStatement=(CompositeStatementObject)elseClause;
      ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
      currentNodes.add(currentNode);
      if (elseClauseCompositeStatement.getStatement() instanceof IfStatement)       previousNodes.addAll(processIfStatement(currentNodes,elseClauseCompositeStatement,JOIN_TOP_LIST));
 else       if (elseClauseCompositeStatement.getStatement() instanceof SwitchStatement)       previousNodes.addAll(processSwitchStatement(currentNodes,elseClauseCompositeStatement,JOIN_TOP_LIST));
 else       if (isLoop(elseClauseCompositeStatement))       previousNodes.addAll(processLoopStatement(currentNodes,elseClauseCompositeStatement));
 else       if (elseClauseCompositeStatement.getStatement() instanceof DoStatement)       previousNodes.addAll(processDoStatement(currentNodes,elseClauseCompositeStatement));
 else       previousNodes.addAll(process(currentNodes,elseClauseCompositeStatement));
    }
  }
 else {
    previousNodes.add(currentNode);
  }
  return previousNodes;
}