@Override protected void invalidateNode(SNode sNode) { NodePath affPath = NodePath.forSNode(sNode); SModel containingModel = sNode.getContainingModel(); if (containingModel == null) return; SModelReference mref = containingModel.getReference(); List<NodePath> nodePaths = nodePaths(mref); ListIterator<NodePath> npathIt = nodePaths.listIterator(); while (npathIt.hasNext()) { NodePath path = npathIt.next(); NodePath lcp = affPath.findLowestCommonParent(path); if (lcp != null) { if (lcp.equals(path)) break; // replace with the LCP and stop npathIt.remove(); npathIt.add(lcp); break; } } if (!npathIt.hasNext()) { // not found -> just add nodePaths.add(affPath); } }
@Override public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final NodeBranchEntry that = (NodeBranchEntry) o; if (nodeVersionId != null ? !nodeVersionId.equals(that.nodeVersionId) : that.nodeVersionId != null) { return false; } if (nodeState != that.nodeState) { return false; } if (nodePath != null ? !nodePath.equals(that.nodePath) : that.nodePath != null) { return false; } if (timestamp != null ? !timestamp.equals(that.timestamp) : that.timestamp != null) { return false; } return !(nodeId != null ? !nodeId.equals(that.nodeId) : that.nodeId != null); }