Check if item <b>parent</b> is parent item of item <b>data</b>.

@param data - Possible child ItemData.
@param parent - Possible parent ItemData.
@return True if parent of both ItemData the same.
358457
private boolean isParent(ItemData data, ItemData parent)
   {
      String id1 = data.getParentIdentifier();
      String id2 = parent.getIdentifier();
      if (id1 == id2) // NOSONAR 
         return true;
      if (id1 == null && id2 != null)
         return false;
      return id1 != null && id1.equals(id2);
   }
1212719
protected function bindData(&$parent, $data)
  {
    if ( is_object($data) ){
      $data = get_object_vars($data);
    }
    else {
      $data = (array) $data;
    }
    
    foreach($data as $k => $v){
      if ( (is_array($v) && ArrayHelper::isAssociative($v)) || is_object($v) ){
        $parent->$k = new \stdClass;
        $this->bindData($parent->$k, $v);
      }
      else {
        $parent->$k = $v;
      }
    }
  }
1220913
protected static boolean isChildOf(String parent, String child) {
      if (parent == null || child == null)
         return false;
      if (!child.startsWith((parent.endsWith(SEPARATOR) ? parent : parent + SEPARATOR)))
         return false;
      if (child.length() <= parent.length())
         return false;
      int from = parent.equals(SEPARATOR) ? parent.length() : parent.length() + 1;
      //  if(from-1 > child.length())
      // return false;
      String[] comps = Util.components(child.substring(from), SEPARATOR);
      return comps != null && comps.length <= 1;
   }
1219663
def _is_parent_of(parent, child):
    """"""
    if child.is_partition:
        return child.partition_slave == parent
    if child.is_toplevel:
        return child.drive == parent and child != parent
    return False
209075
public boolean hasModelGroupParent() {

        boolean result = false;
        Element parent = getElement().getParentElement();
        while (parent != null) {
            if (parent.getPropertyBoolean(PROP_IS_MODEL_GROUP)) {
                result = true;
                break;
            }
            parent = parent.getParentElement();
        }
        return result;
    }
954482
public static boolean hasChildsOf(final Element parentElement, XsdElementEnum child) {
        NodeList nodeList = parentElement.getChildNodes();
        for (int i = 0; i < nodeList.getLength(); i++) {
            final Node childNode = nodeList.item(i);
            if (childNode.getNodeType() == Node.ELEMENT_NODE) {
                final Element childElement = (Element) childNode;
                if (child.isTagNameEqual(childElement.getTagName())) {
                    return true;
                }

                if (childElement.hasChildNodes()) {
                    if (hasChildsOf(childElement, child)) {
                        return true;
                    }
                }
            }
        }
        return false;
    }
827774
public static boolean parentContainsOnlyLeaves(ParentNode parentNode) {
        for (Node child : parentNode.children()) {
            if (!isLeaf(child)) return false;
        }
        return true;
    }
558968
protected static boolean isChildOf(String parent, String child) {
        if(parent == null || child == null)
            return false;
        if(!child.startsWith(parent))
            return false;
        if(child.length() <= parent.length())
            return false;
        int from=parent.equals(File.separator)? parent.length() : parent.length() +1;
        //  if(from-1 > child.length())
            // return false;
        String[] comps=Util.components(child.substring(from), File.separator);
        return comps != null && comps.length <= 1;
    }
901616
def has_parent(self, term):
        """"""
        for parent in self.parents:
            if parent.item_id == term or parent.has_parent(term):
                return True
        return False
418136
private TreeNode getParentTreeNode(TreeNode child) {
        TreeNode parentTreeNode = parentIndex.get(child);

        if (parentTreeNode == null)
            return null;

        // Makes sure the parent node is still present in the tree
        else if (contains(parentTreeNode.getQueryNode()))
            return parentTreeNode;
        else
            throw new RuntimeException("Internal error: points to a parent that is not (anymore) in the tree");
    }
1044344
static boolean isTryFinallyNode(Node parent, Node child) {
    return parent.isTry() && parent.hasXChildren(3)
        && child == parent.getLastChild();
  }
1111272
public boolean parent() {
        if (mNode == null) {
            return false;
        }
        AccessibilityNodeInfoCompat parentNode = mNode.getParent();
        while (parentNode != null) {
            if (AccessibilityNodeInfoUtils.isVisibleOrLegacy(parentNode)) {
                reset(parentNode);
                return true;
            }
            AccessibilityNodeInfoCompat tmp = parentNode.getParent();
            parentNode.recycle();
            parentNode = tmp;
        }
        return false;
    }
98535
static boolean isElementParentName(Element element, String name) {
        Element parent = element.getParentElement();
        if (parent == null) {
            return false;
        }
        return isElementName(parent, name);
    }
971160
public void checkParentLinks() {
        this.visit(new NodeVisitor() {
            @Override
            public boolean visit(AstNode node) {
                int type = node.getType();
                if (type == Token.SCRIPT)
                    return true;
                if (node.getParent() == null)
                    throw new IllegalStateException
                            ("No parent for node: " + node
                             + "\n" + node.toSource(0));
                return true;
            }
        });
    }
875705
function isParentNodeType(parent, nodeType) {
            return parent.type === nodeType ||
                (parent.body && parent.body.type === nodeType) ||
                (parent.consequent && parent.consequent.type === nodeType);
        }
503664
private boolean hasSelectedChildren(CmsTreeItem item) {

        for (String childId : m_childrens.get(item.getId())) {
            CmsTreeItem child = m_categories.get(childId);
            if (child.getCheckBox().isChecked() || hasSelectedChildren(child)) {
                return true;
            }
        }
        return false;
    }
761504
function (node) {
        var parent = node.parentNode;
        while (parent) {
            if (parent === this) {
                return true;
            }
            parent = parent.parentNode;
        }
        return false;
    }