Search in sources :

Example 1 with ConditionCheckNode

use of com.android.tools.idea.experimental.codeanalysis.datastructs.graph.node.ConditionCheckNode in project android by JetBrains.

the class LoopBranchingNodeImpl method processBreaks.

public void processBreaks() {
    if (mLoopType == LoopBranchingNode.FOREACH_LOOP) {
        //In foreach loop. Break connects to the exit node of the body
        GraphNode bodyExit = mLoopBody.getExitNode();
        for (GraphNode breakNode : this.breakNodeList) {
            GraphNodeUtil.connectGraphNode(breakNode, bodyExit);
        }
        this.breakNodeList.clear();
    } else {
        //Null check
        if (mConditionCheckExitNode == null) {
            return;
        }
        GraphNode falseBranch = ((ConditionCheckNode) mConditionCheckExitNode).getFalseBranch();
        for (GraphNode breakNode : this.breakNodeList) {
            GraphNodeUtil.connectGraphNode(breakNode, falseBranch);
        }
        this.breakNodeList.clear();
    }
}
Also used : GraphNode(com.android.tools.idea.experimental.codeanalysis.datastructs.graph.node.GraphNode) ConditionCheckNode(com.android.tools.idea.experimental.codeanalysis.datastructs.graph.node.ConditionCheckNode)

Aggregations

ConditionCheckNode (com.android.tools.idea.experimental.codeanalysis.datastructs.graph.node.ConditionCheckNode)1 GraphNode (com.android.tools.idea.experimental.codeanalysis.datastructs.graph.node.GraphNode)1