if (node.hasChildNodes()) { final long firstChildId = XMLUtil.getFirstChildId( (DocumentImpl) node.getOwnerDocument(), node.getGID()); if (firstChildId < 0) { LOG.debug("first child not found: " + node.getGID()); return 0; } final long lastChildId = firstChildId + node.getChildCount(); long p; for (long gid = firstChildId; gid < lastChildId; gid++) { NodeImpl child = (NodeImpl) iter.next(); if (gid == target) return ((NodeIterator) iter).currentAddress(); child.setGID(gid); if (node.hasChildNodes() && (p = findNode(child, target, iter)) != 0) return p; } } return 0; }
if (node.hasChildNodes()) { final long firstChildId = XMLUtil.getFirstChildId( (DocumentImpl) node.getOwnerDocument(), node.getGID()); if (firstChildId < 0) { LOG.debug("first child not found: " + node.getGID()); return 0; } final long lastChildId = firstChildId + node.getChildCount(); long p; for (long gid = firstChildId; gid < lastChildId; gid++) { NodeImpl child = (NodeImpl) iter.next(); if (gid == target) { return ((NodeIterator) iter).currentAddress(); } child.setGID(gid); if (node.hasChildNodes() && (p = findNode(child, target, iter)) != 0) return p; } } return 0; }
	private long findNode(NodeImpl node, long target, Iterator iter) {		if (node.hasChildNodes()) {			final long firstChildId =				XMLUtil.getFirstChildId(					(DocumentImpl) node.getOwnerDocument(),					node.getGID());			if (firstChildId < 0) {				LOG.debug("first child not found: " + node.getGID());				return 0;			}			final long lastChildId = firstChildId + node.getChildCount();			long p;			for (long gid = firstChildId; gid < lastChildId; gid++) {				NodeImpl child = (NodeImpl) iter.next();				if (gid == target)					return ((NodeIterator) iter).currentAddress();				child.setGID(gid);				if (node.hasChildNodes() && (p = findNode(child, target, iter)) != 0)					return p;			}		}		return 0;	}