private Set getNodeSet(List nodeFilters) { if (xi.isNeedsToBeExpanded()) { XMLUtils.circumventBug2650(XMLUtils.getOwnerDocument(xi.getSubNode())); } Set inputSet = new LinkedHashSet(); XMLUtils.getSet(xi.getSubNode(), inputSet, null, !xi.isExcludeComments()); Set nodeSet = new LinkedHashSet(); Iterator i = inputSet.iterator(); while (i.hasNext()) { Node currentNode = (Node) i.next(); Iterator it = nodeFilters.iterator(); boolean skipNode = false; while (it.hasNext() && !skipNode) { NodeFilter nf = (NodeFilter) it.next(); if (nf.isNodeInclude(currentNode) != 1) { skipNode = true; } } if (!skipNode) { nodeSet.add(currentNode); } } return nodeSet; }
void circumventBugIfNeeded(XMLSignatureInput input) throws CanonicalizationException, ParserConfigurationException, IOException, SAXException { if (!input.isNeedsToBeExpanded()) return; Document doc = null; if (input.getSubNode() != null) { doc = XMLUtils.getOwnerDocument(input.getSubNode()); } else { doc = XMLUtils.getOwnerDocument(input.getNodeSet()); } XMLUtils.circumventBug2650(doc); }