Check the list of selector <em>parts</em> and return a set of nodes with the result.

@param parts A list of selector <em>parts</em>.
@return A set of nodes.
@throws NodeSelectorException In case of an error.
336040
private Set<Node> check(List<Selector> parts) throws NodeSelectorException {
        Set<Node> result = new LinkedHashSet<Node>();
        result.add(root);
        for (Selector selector : parts) {
            NodeTraversalChecker checker = new TagChecker(selector);
            result = checker.check(result, root);
            if (selector.hasSpecifiers()) {
                for (Specifier specifier : selector.getSpecifiers()) {
                    switch (specifier.getType()) {
                    case ATTRIBUTE:
                        checker = new AttributeSpecifierChecker((AttributeSpecifier) specifier);
                        break;
                    case PSEUDO:
                        if (specifier instanceof PseudoClassSpecifier) {
                            checker = new PseudoClassSpecifierChecker((PseudoClassSpecifier) specifier);
                        } else if (specifier instanceof PseudoNthSpecifier) {
                            checker = new PseudoNthSpecifierChecker((PseudoNthSpecifier) specifier);
                        }
                        
                        break;
                    case NEGATION:
                        final Set<Node> negationNodes = checkNegationSpecifier((NegationSpecifier) specifier);
                        checker = new NodeTraversalChecker() {
                            @Override
                            public Set<Node> check(Set<Node> nodes, Node root) throws NodeSelectorException {
                                Set<Node> set = new LinkedHashSet<Node>(nodes);
                                set.removeAll(negationNodes);
                                return set;
                            }
                        };
                        
                        break;
                    }
                    
                    result = checker.check(result, root);
                    if (result.isEmpty()) {
                        // Bail out early.
                        return result;
                    }
                }
            }
        }
        
        return result;
    }
1334601
function partNode(node){
      if (node.isPart && node.childNodes.length == 1 && node.firstChild.nodeType == 3) {
        node.currentText = node.firstChild.nodeValue;
        return !/[\n\t\r]/.test(node.currentText);
      }
      return false;
    }
310352
public NodeList getMatchingNodes(String select, Document document)
        throws ConfigurationException, XpathException {
        try {
            return getXPathResultNode(select, document).getChildNodes();
        } catch (TransformerException ex) {
            throw new XpathException("Failed to apply stylesheet", ex);
        }
    }
507848
public List<Node> getNodes(Collection<Long> nodeIds)
	{
		if(nodeIds.isEmpty()) return Collections.emptyList();
		return getSomeElements(NODE + "s?" + NODE + "s=" + toCommaList(nodeIds), Node.class);
	}
372640
private List<INodeEntry> select(final int count, final Collection<INodeEntry> nodes) {
        List<INodeEntry> source = new ArrayList<>(nodes);
        List<INodeEntry> selected = new ArrayList<>();
        int total = Math.min(count, nodes.size());
        for (int i = 0; i < total; i++) {
            selected.add(source.remove(random.nextInt(source.size())));
        }
        return selected;
    }
514964
public static String join(String joiner, String... parts) {
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < parts.length; i++) {
            builder.append(parts[i]);
            if (i < parts.length - 1) {
                builder.append(joiner);
            }
        }
        return builder.toString();
    }
1282388
public DiffNode getChild(final List<ElementSelector> selectors)
	{
		Assert.notEmpty(selectors, "selectors");
		final ElementSelector selector = selectors.get(0);
		if (selectors.size() == 1)
		{
			if (selector == RootElementSelector.getInstance())
			{
				return isRootNode() ? this : null;
			}
			else
			{
				return getChild(selector);
			}
		}
		else if (selectors.size() > 1)
		{
			final DiffNode child;
			if (selector == RootElementSelector.getInstance())
			{
				child = isRootNode() ? this : null;
			}
			else
			{
				child = getChild(selector);
			}
			if (child != null)
			{
				return child.getChild(selectors.subList(1, selectors.size()));
			}
		}
		return null;
	}
220675
private Set<Integer> perNodeRelease(final C thisNodeAddress, final C[] currentState, final int nodeCount, final int nodeRank) {
        final int numberIShouldHave = howManyShouldIHave(totalNumShards, nodeCount, minNodes, nodeRank);

        // destinationsAcquired reflects what we already have according to the currentState
        final List<Integer> destinationsAcquired = buildDestinationsAcquired(thisNodeAddress, currentState);

        final int numHad = destinationsAcquired.size();
        final Set<Integer> ret = new HashSet<>();
        if (destinationsAcquired.size() > numberIShouldHave) { // there's some to remove.
            final Random random = new Random();

            while (destinationsAcquired.size() > numberIShouldHave) {
                final int index = random.nextInt(destinationsAcquired.size());
                ret.add(destinationsAcquired.remove(index));
            }
        }

        if (LOGGER.isTraceEnabled() && ret.size() > 0)
            LOGGER.trace(thisNodeAddress.toString() + " removing shards " + ret + " because I have " +
                    numHad + " but shouldn't have more than " + numberIShouldHave + ".");

        return ret;
    }
79577
public NodeList nodelist() throws javax.xml.transform.TransformerException
  {

    error(XPATHErrorResources.ER_CANT_CONVERT_TO_NODELIST,
          new Object[]{ getTypeString() });  //"Can not convert "+getTypeString()+" to a NodeList!");

    return null;
  }
259682
private static <E extends Element> List<E> findTopLevelElementsRecurse(Class<E> elementType, Node node, List<E> matches) {
		for(Element elem : node.getChildElements()) {
			if(elementType.isInstance(elem)) {
				// Found match
				if(matches == null) matches = new ArrayList<>();
				matches.add(elementType.cast(elem));
			} else {
				// Look further down the tree
				matches = findTopLevelElementsRecurse(elementType, elem, matches);
			}
		}
		return matches;
	}
1110425
@Nullable
    public static EndpointSelector getNodeSelector(String groupName) {
        groupName = normalizeGroupName(groupName);
        return serverGroups.get(groupName);
    }
857209
public static List<String> selectNodeValues(Node node, String xpathQuery, Map<String, String> namespaceUris) {
        List<Node> resultNodes = selectNodes(node, xpathQuery, namespaceUris);

        return extractNodeValues(resultNodes);
    }
447239
public Set<Component> findComponents() throws Exception {
        Set<Component> componentsFound = new HashSet<>();

        for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
            componentFinderStrategy.beforeFindComponents();
        }

        for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
            componentsFound.addAll(componentFinderStrategy.findComponents());
        }

        for (ComponentFinderStrategy componentFinderStrategy : componentFinderStrategies) {
            componentFinderStrategy.afterFindComponents();
        }

        return componentsFound;
    }
39646
private static void checkPartForTextType(HashMap<String, Collection<String>> bodies, Part part) throws IOException, MessagingException {
        Object content = part.getContent();
        if (content instanceof CharSequence) {
            String ct = part.getContentType();
            Collection<String> value = bodies.get(ct);
            if (value != null) {
                value.add(content.toString());
            } else {
                value = new LinkedList<>();
                value.add(content.toString());
                bodies.put(ct, value);
            }
        } else if (content instanceof Multipart) {
            Multipart mp = (Multipart) content;
            for(int i = 0; i < mp.getCount(); i++) {
                checkPartForTextType(bodies, mp.getBodyPart(i));
            }
        }
    }
310237
public Selector parseSelector(String selectorString,
                                SelectorDomain domain)
    throws SISelectorSyntaxException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "parseSelector", new Object[] { selectorString, domain });

    Selector selectorTree = null;
    Transformer transformer = Matching.getTransformer();
    Resolver resolver = null;

    try
    {
      // Synchronization block to protect the parser object from being reset
      // whilst in use.
      synchronized (this)
      {
        MatchParser parser = null;
        if(domain.equals(SelectorDomain.JMS))
        {
          // Set the correct resolver
          resolver = _jmsResolver;
          // Drive the parser
          _sibParser = _matching.primeMatchParser(_sibParser,
                                             selectorString,
                                             SelectorDomain.JMS.toInt());
          parser = _sibParser;
        }
        else if(domain.equals(SelectorDomain.SIMESSAGE))
        {
          // Set the correct resolver
          resolver = _simessageResolver;
          // Drive the parser
          _sibParser = _matching.primeMatchParser(_sibParser,
                                             selectorString,
                                             SelectorDomain.SIMESSAGE.toInt());
          parser = _sibParser;
        }
        else // In the XPath1.0 case we use the default resolver
        {
          // Set the correct resolver
          resolver = _defaultResolver;
          // Drive the parser
          _xpathParser = _matching.primeMatchParser(_xpathParser,
                                             selectorString,
                                             SelectorDomain.XPATH1.toInt());
          parser = _xpathParser;
        }

        // We're ready to parse the selector
        if(disableXPathOptimizer && domain.equals(SelectorDomain.XPATH1))
        {
          // In this special case we'll disable the MatchSpace XPath
          // optimizations and process XPath expressions as whole entities.
          XPath10Parser xpParser = (XPath10Parser)parser;
          selectorTree = xpParser.parseWholeSelector(selectorString);
        }
        else
        {
          // Parse in the usual manner
          selectorTree = parser.getSelector(selectorString);
        }

        // Check that the selector parsed ok.
        if (selectorTree.getType() == Selector.INVALID)
        {
                if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
                  SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");
          throw new SISelectorSyntaxException(
            nls.getFormattedMessage(
              "INVALID_SELECTOR_ERROR_CWSIP0371",
              new Object[] { selectorString },
              null));
        }

        selectorTree = transformer.resolve(selectorTree, resolver, _positionAssigner);

        // Check that the selector resolved ok.
        if (selectorTree.getType() == Selector.INVALID)
        {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");
          throw new SISelectorSyntaxException(
            nls.getFormattedMessage(
              "INVALID_SELECTOR_ERROR_CWSIP0371",
              new Object[] { selectorString },
              null));
        }
      }
    }
    catch (RuntimeException e)
    {
      // FFDC
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.matching.MessageProcessorMatching.parseSelector",
        "1:1741:1.117.1.11",
        this);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");

      throw new SISelectorSyntaxException(
        nls.getFormattedMessage(
          "INVALID_SELECTOR_ERROR_CWSIP0371",
          new Object[] { null },
          null));
    }
    catch (MatchingException e)
    {
      // No FFDC code needed

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
        SibTr.exit(tc, "parseSelector", "SISelectorSyntaxException");

      throw new SISelectorSyntaxException(
        nls.getFormattedMessage(
          "INVALID_SELECTOR_ERROR_CWSIP0376",
          new Object[] { e },
          null));
    }
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "parseSelector", selectorTree);
    return selectorTree;
  }
698777
public boolean setPartitions(Collection<Collection<Node>> parts) {
        if (!isDisjoint(parts)) {
            return false;
        }
        partitions = parts;
        return true;
    }
624094
@XmlElementWrapper(name = "sections")
    @XmlElement(name = "s", type = S.class)
    public List<S> getSections() {
        return sections;
    }