#fixed code
                                RootBNode buildBinaryTree(BinaryNode[] nodes) {

        BinaryNode[] nextLevelNodes = new BinaryNode[nodes.length / 2 + nodes.length % 2];
        // System.out.println ("next level length = " + nextLevelNodes.length);

        if (nodes.length > 1) {
            for (int i = 0; i < nodes.length - 1; i += 2) {
                BinaryNode parent;

                if (nodes.length == 2)
                    parent = new RootBNode(store, FloatDomain.MinFloat, FloatDomain.MaxFloat);
                else
                    parent = new BNode(store, FloatDomain.MinFloat, FloatDomain.MaxFloat);

                parent.left = nodes[i];
                parent.right = nodes[i + 1];

                // currently sibling not used
                // nodes[i].sibling = nodes[i + 1];
                // nodes[i + 1].sibling = nodes[i];

                nodes[i].parent = parent;
                nodes[i + 1].parent = parent;

                nextLevelNodes[i / 2] = parent;

            }
            if (nodes.length % 2 == 1) {
                nextLevelNodes[nextLevelNodes.length - 1] = nextLevelNodes[0];
                nextLevelNodes[0] = nodes[nodes.length - 1];
            }

            return buildBinaryTree(nextLevelNodes);
        } else {
            // root node
            ((RootBNode) nodes[0]).val = this.sum;
            ((RootBNode) nodes[0]).rel = relationType;

            return (RootBNode) nodes[0];
        }
    }
#vulnerable code 
                                void propagate(SimpleHashSet<FloatVar> fdvs) {

        while (!fdvs.isEmpty()) {

            FloatVar v = fdvs.removeFirst();
            VariableNode n = varMap.get(v);

            n.propagate();

        }
    } 
                            #location 8 
                            #vulnerability type NULL_DEREFERENCE