void () { IntList indicesToFire = new IntArrayList(); List<Node> nodesToFire = new ArrayList<>(); List<Map.Entry<Node, Collection<Node>>> changed; synchronized (fireTreeNodesChangedMap) { changed = new ArrayList<>(fireTreeNodesChangedMap.entrySet()); fireTreeNodesChangedMap.clear(); } for (Map.Entry<Node, Collection<Node>> entry : changed) { Node parentNode = entry.getKey(); Collection<Node> childrenToUpdate = entry.getValue(); for (int i = 0; i < parentNode.getChildCount(); i++) { Node childNode = (Node)parentNode.getChildAt(i); if (childrenToUpdate.contains(childNode)) { nodesToFire.add(childNode); indicesToFire.add(i); } } myModel.fireTreeNodesChanged(parentNode, myModel.getPathToRoot(parentNode), indicesToFire.toIntArray(), nodesToFire.toArray(new Node[0])); indicesToFire.clear(); nodesToFire.clear(); } }