Applies {@link #tmpRelPath} to <code>node</code> and reset the path to
<code>null</code>.

@param node a relation query node.
550022
private void applyRelativePath(RelationQueryNode node) {
       if (tmpRelPath != null)
       {
          // try {
          QPath relPath = tmpRelPath;
          for (int i = 0; i < relPath.getEntries().length; i++)
          {
             node.addPathElement(relPath.getEntries()[i]);
          }
          tmpRelPath = null;
       }
    }
1016367
private void traverseNode(String path) {
        DataNode node = getNode(path);
        String children[] = null;
        synchronized (node) {
            Set<String> childs = node.getChildren();
            if (childs != null) {
                children = childs.toArray(new String[childs.size()]);
            }
        }
        if (children != null) {
            if (children.length == 0) {
                // this node does not have a child
                // is the leaf node
                // check if its the leaf node
                String endString = "/" + Quotas.limitNode;
                if (path.endsWith(endString)) {
                    // ok this is the limit node
                    // get the real node and update
                    // the count and the bytes
                    String realPath = path.substring(Quotas.quotaZookeeper
                            .length(), path.indexOf(endString));
                    updateQuotaForPath(realPath);
                    this.pTrie.addPath(realPath);
                }
                return;
            }
            for (String child : children) {
                traverseNode(path + "/" + child);
            }
        }
    }
759937
private PathQueryNode createPathQueryNode(SimpleNode node) {
        root.setLocationNode(factory.createPathQueryNode(root));
        node.childrenAccept(this, root.getLocationNode());
        return root.getLocationNode();
    }
1280217
public void addLast(final T node) {
        if ( this.firstNode == null ) {
            this.firstNode = node;
            this.lastNode = node;
        } else {
            T currentLast = this.lastNode;
            currentLast.setNext( node );
            node.setPrevious( currentLast );
            this.lastNode = node;            
        }
        
        this.size++;
    }
537113
public static boolean deletePathRecursive(Tree<ResourceMeta> tree, Path path){
        if(tree.hasResource(path)) {
            //delete just this resource
            return tree.deleteResource(path);
        }else if (tree.hasDirectory(path)) {
            //list resources and delete
            Set<Resource<ResourceMeta>> resources = tree.listDirectory(path);
            boolean failed=false;
            for (Resource<ResourceMeta> resource : resources) {
                if(resource.isDirectory()){
                    if(!deletePathRecursive(tree,resource.getPath())){
                        failed=true;
                    }
                }else {
                    if(!tree.deleteResource(resource.getPath())){
                        failed=true;
                    }
                }
            }
            return !failed;
        }else{
            return true;
        }
    }
554727
@Override
    protected void nodeRecovered(Node node) {
        NodeStatus nodeStatus = getNodeStatus(node);

        synchronized(nodeStatus) {
            nodeStatus.resetCounters(getConfig().getTime().getMilliseconds());
            super.nodeRecovered(node);
        }
    }
1304749
public void remove(Node<T> node) {
    	if (first == node) {
    		removeMin();
    		return;
    	}
    	if (last == node) {
    		removeMax();
    		return;
    	}
    	// if both children of root are black, set root to red
    	if ((root.left == null || !root.left.red) && (root.right == null || !root.right.red))
            root.red = true;

        root = remove(root, node);
        if (root != null) root.red = false;
        else first = last = null;
    }
1235196
public static <T> String path(TreeDef.Parented<T> treeDef, T node, Function<? super T, String> toString, String delimiter) {
		List<T> toRoot = toRoot(treeDef, node);
		ListIterator<T> iterator = toRoot.listIterator(toRoot.size());
		StringBuilder builder = new StringBuilder();
		while (iterator.hasPrevious()) {
			T segment = iterator.previous();
			// add the node
			builder.append(toString.apply(segment));
			// add the separator if it makes sense
			if (iterator.hasPrevious()) {
				builder.append(delimiter);
			}
		}
		return builder.toString();
	}
593394
public static AccessibilityNodeInfoCompat refreshNode(
        AccessibilityNodeInfoCompat node) {
        if (node == null) {
            return null;
        }
        AccessibilityNodeInfoCompat result = refreshFromChild(node);
        if (result == null) {
            result = refreshFromParent(node);
        }
        return result;
    }
280373
public void setPath(String path) {
        if (path != null) {
            manifest = ManifestIterator.getInstance().findByPath(path);
        }
    }
53356
public void releaseNode(final NodeId node) throws Exception {
		Lockable<SharedBufferNode> sharedBufferNode = sharedBuffer.getEntry(node);
		if (sharedBufferNode != null) {
			if (sharedBufferNode.release()) {
				removeNode(node, sharedBufferNode.getElement());
			} else {
				sharedBuffer.upsertEntry(node, sharedBufferNode);
			}
		}
	}
1163251
public static <T> String path(TreeDef.Parented<T> treeDef, T node, Function<? super T, String> toString) {
		return path(treeDef, node, toString, "/");
	}
953006
protected void addRequiredPath(String requiredPath) {
        if(requiredPath == null) {
            throw new IllegalArgumentException("Required path can't be null.");
        }
        DefaultOperationRequestAddress requiredAddress = new DefaultOperationRequestAddress();
        CommandLineParser.CallbackHandler handler = new DefaultCallbackHandler(requiredAddress);
        try {
            ParserUtil.parseOperationRequest(requiredPath, handler);
        } catch (CommandFormatException e) {
            throw new IllegalArgumentException("Failed to parse nodeType: " + e.getMessage());
        }
        addRequiredPath(requiredAddress);
    }
214099
private static LocationPath discardSelfNode(LocationPath path){
        int noOfNulls = 0;
        Step steps[] = path.steps;

        for(int i=steps.length-1; i>=0; --i){
            Step step = steps[i];
            if(step.axis==Axis.SELF && step.constraint.id==Constraint.ID_NODE && !step.predicateSet.hasPosition){
                if(step.predicateSet.getPredicate()==null){
                    steps[i] = null;
                    noOfNulls++;
                }else{
                    if(i!=0){
                        steps[i] = null;
                        steps[i-1].setPredicate(step);
                        noOfNulls++;
                    }
                }
            }
        }
        return noOfNulls>0 ? removeNullSteps(path, noOfNulls) : path;
    }
1229732
public static <A, N extends Node<A,?,N>>  List<A> recoverActionPath(N node){
        List<A> actions = new LinkedList<A>();
        for(N n : node.path()){
            if (n.action() != null) actions.add(n.action());
        }
        return actions;
    }
1016263
public void getRelativePath(StringBuilder result, INode parserNode, INode node) {
		if (parserNode == node)
			return;
		if (isAncestor(parserNode, node)) {
			ICompositeNode parent = node.getParent();
			getRelativePath(result, parserNode, parent);
			int idx = 0;
			INode child = parent.getFirstChild();
			while(child != node && child.hasNextSibling()) {
				idx++;
				child = child.getNextSibling();
			}
			result.append("/").append(idx);
		} else {
			result.append("/..");
			getRelativePath(result, parserNode.getParent(), node);
		}
	}
1004800
public static <T extends TreeNode<T>> T getRoot(T node) {
        if (node == null) return null;
        if (node.getParent() != null) return getRoot(node.getParent());
        return node;
    }