Program: 12104
Project: 12104
Buggy source:
private List<CFGNode> process(List<CFGNode> previousNodes,CompositeStatementObject composite){
  if (composite instanceof TryStatementObject) {
    AbstractStatement firstStatement=composite.getStatements().get(0);
    composite=(CompositeStatementObject)firstStatement;
  }
  int i=0;
  for (  AbstractStatement abstractStatement : composite.getStatements()) {
    if (abstractStatement instanceof StatementObject) {
      StatementObject statement=(StatementObject)abstractStatement;
      previousNodes=processNonCompositeStatement(previousNodes,statement,composite);
    }
 else     if (abstractStatement instanceof CompositeStatementObject) {
      CompositeStatementObject compositeStatement=(CompositeStatementObject)abstractStatement;
      if (compositeStatement.getStatement() instanceof Block) {
        previousNodes=process(previousNodes,compositeStatement);
      }
 else       if (compositeStatement instanceof TryStatementObject) {
        TryStatementObject tryStatement=(TryStatementObject)compositeStatement;
        if (!tryStatement.hasResources()) {
          CFGTryNode tryNode=new CFGTryNode(compositeStatement);
          directlyNestedNodeInTryBlock(tryNode);
          directlyNestedNodesInTryBlocks.put(tryNode,new ArrayList<CFGNode>());
          AbstractStatement firstStatement=compositeStatement.getStatements().get(0);
          previousNodes=process(previousNodes,(CompositeStatementObject)firstStatement);
        }
 else {
          CFGTryNode tryNode=new CFGTryNode(compositeStatement);
          directlyNestedNodeInTryBlock(tryNode);
          nodes.add(tryNode);
          directlyNestedNodesInTryBlocks.put(tryNode,new ArrayList<CFGNode>());
          createTopDownFlow(previousNodes,tryNode);
          ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
          currentNodes.add(tryNode);
          previousNodes=currentNodes;
          AbstractStatement firstStatement=compositeStatement.getStatements().get(0);
          previousNodes=process(previousNodes,(CompositeStatementObject)firstStatement);
        }
      }
 else       if (isLoop(compositeStatement)) {
        CFGBranchNode currentNode=new CFGBranchLoopNode(compositeStatement);
        nodes.add(currentNode);
        directlyNestedNodeInTryBlock(currentNode);
        createTopDownFlow(previousNodes,currentNode);
        previousNodes=new ArrayList<CFGNode>();
        ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
        currentNodes.add(currentNode);
        previousNodes.addAll(process(currentNodes,compositeStatement));
        for (        CFGNode previousNode : previousNodes) {
          Flow flow=new Flow(previousNode,currentNode);
          if (previousNode instanceof CFGBranchNode) {
            if (previousNode.equals(currentNode))             flow.setTrueControlFlow(true);
 else             flow.setFalseControlFlow(true);
          }
          flow.setLoopbackFlow(true);
          edges.add(flow);
        }
        if (previousNodes.size() > 1) {
          List<CFGBranchConditionalNode> conditionalNodes=unjoinedConditionalNodes.pop();
          for (          CFGBranchConditionalNode conditionalNode : conditionalNodes) {
            conditionalNode.setJoinNode(currentNode);
          }
        }
        previousNodes=currentNodes;
      }
 else       if (compositeStatement.getStatement() instanceof DoStatement) {
        List<CFGNode> tmpNodes=previousNodes;
        previousNodes=process(previousNodes,compositeStatement);
        CFGBranchNode currentNode=new CFGBranchDoLoopNode(compositeStatement);
        nodes.add(currentNode);
        directlyNestedNodeInTryBlock(currentNode);
        createTopDownFlow(previousNodes,currentNode);
        CFGNode topNode=getCommonNextNode(tmpNodes);
        if (topNode == null)         topNode=(CFGNode)nodes.toArray()[0];
        Flow flow=new Flow(currentNode,topNode);
        flow.setTrueControlFlow(true);
        flow.setLoopbackFlow(true);
        edges.add(flow);
        ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
        currentNodes.add(currentNode);
        previousNodes=currentNodes;
      }
 else       if (compositeStatement.getStatement() instanceof SwitchStatement) {
        int action=getAction(composite,i,compositeStatement);
        previousNodes=processSwitchStatement(previousNodes,compositeStatement,action);
      }
 else       if (compositeStatement.getStatement() instanceof IfStatement) {
        int action=getAction(composite,i,compositeStatement);
        previousNodes=processIfStatement(previousNodes,compositeStatement,action);
      }
    }
    i++;
  }
  return previousNodes;
}

Fixed version (ground truth):
private List<CFGNode> process(List<CFGNode> previousNodes,CompositeStatementObject composite){
  if (composite instanceof TryStatementObject) {
    AbstractStatement firstStatement=composite.getStatements().get(0);
    composite=(CompositeStatementObject)firstStatement;
  }
  int i=0;
  for (  AbstractStatement abstractStatement : composite.getStatements()) {
    if (abstractStatement instanceof StatementObject) {
      StatementObject statement=(StatementObject)abstractStatement;
      previousNodes=processNonCompositeStatement(previousNodes,statement,composite);
    }
 else     if (abstractStatement instanceof CompositeStatementObject) {
      CompositeStatementObject compositeStatement=(CompositeStatementObject)abstractStatement;
      if (compositeStatement.getStatement() instanceof Block) {
        previousNodes=process(previousNodes,compositeStatement);
      }
 else       if (compositeStatement instanceof TryStatementObject) {
        TryStatementObject tryStatement=(TryStatementObject)compositeStatement;
        if (!tryStatement.hasResources()) {
          CFGTryNode tryNode=new CFGTryNode(compositeStatement);
          directlyNestedNodeInTryBlock(tryNode);
          directlyNestedNodesInTryBlocks.put(tryNode,new ArrayList<CFGNode>());
          AbstractStatement firstStatement=compositeStatement.getStatements().get(0);
          previousNodes=process(previousNodes,(CompositeStatementObject)firstStatement);
        }
 else {
          CFGTryNode tryNode=new CFGTryNode(compositeStatement);
          directlyNestedNodeInTryBlock(tryNode);
          nodes.add(tryNode);
          directlyNestedNodesInTryBlocks.put(tryNode,new ArrayList<CFGNode>());
          createTopDownFlow(previousNodes,tryNode);
          ArrayList<CFGNode> currentNodes=new ArrayList<CFGNode>();
          currentNodes.add(tryNode);
          previousNodes=currentNodes;
          AbstractStatement firstStatement=compositeStatement.getStatements().get(0);
          previousNodes=process(previousNodes,(CompositeStatementObject)firstStatement);
        }
      }
 else       if (isLoop(compositeStatement)) {
        previousNodes=processLoopStatement(previousNodes,compositeStatement);
      }
 else       if (compositeStatement.getStatement() instanceof DoStatement) {
        previousNodes=processDoStatement(previousNodes,compositeStatement);
      }
 else       if (compositeStatement.getStatement() instanceof SwitchStatement) {
        int action=getAction(composite,i,compositeStatement);
        previousNodes=processSwitchStatement(previousNodes,compositeStatement,action);
      }
 else       if (compositeStatement.getStatement() instanceof IfStatement) {
        int action=getAction(composite,i,compositeStatement);
        previousNodes=processIfStatement(previousNodes,compositeStatement,action);
      }
    }
    i++;
  }
  return previousNodes;
}