diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMNode.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMNode.java index 18ea620d692..fe2836be9d6 100644 --- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMNode.java +++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/PDOMNode.java @@ -66,7 +66,20 @@ public abstract class PDOMNode implements IPDOMNode { public int getRecord() { return record; } - + + /** + * Checks if other node is the immediate parent of this one. + * @param other paternity test subject. + * @return true if other node in the parent of this one. + */ + public boolean isChildOf(PDOMNode other) { + try { + return other.pdom == pdom && other.record == getParentNodeRec(); + } catch (CoreException e) { + return false; + } + } + @Override public final boolean equals(Object obj) { if (obj == this)