private static boolean processParents(int certIndex,boolean policiesCritical,boolean rejectPolicyQualifiers,PolicyNodeImpl rootNode,String curPolicy,Set<PolicyQualifierInfo> pQuals,boolean matchAny) throws CertPathValidatorException {
  boolean foundMatch=false;
  if (debug != null)   debug.println("PolicyChecker.processParents(): matchAny = " + matchAny);
  Set<PolicyNodeImpl> parentNodes=rootNode.getPolicyNodesExpected(certIndex - 1,curPolicy,matchAny);
  for (  PolicyNodeImpl curParent : parentNodes) {
    if (debug != null)     debug.println("PolicyChecker.processParents() " + "found parent:\n" + curParent.asString());
    foundMatch=true;
    String curParPolicy=curParent.getValidPolicy();
    PolicyNodeImpl curNode=null;
    Set<String> curExpPols=null;
    if (curPolicy.equals(ANY_POLICY)) {
      Set<String> parExpPols=curParent.getExpectedPolicies();
      parentExplicitPolicies:       for (      String curParExpPol : parExpPols) {
        Iterator<PolicyNodeImpl> childIter=curParent.getChildren();
        while (childIter.hasNext()) {
          PolicyNodeImpl childNode=childIter.next();
          String childPolicy=childNode.getValidPolicy();
          if (curParExpPol.equals(childPolicy)) {
            if (debug != null)             debug.println(childPolicy + " in parent's " + "expected policy set already appears in "+ "child node");
            continue parentExplicitPolicies;
          }
        }
        Set<String> expPols=new HashSet<>();
        expPols.add(curParExpPol);
        curNode=new PolicyNodeImpl(curParent,curParExpPol,pQuals,policiesCritical,expPols,false);
      }
    }
 else {
      curExpPols=new HashSet<String>();
      curExpPols.add(curPolicy);
      curNode=new PolicyNodeImpl(curParent,curPolicy,pQuals,policiesCritical,curExpPols,false);
    }
  }
  return foundMatch;
}

private static boolean processParents ( int certIndex , boolean policiesCritical , boolean rejectPolicyQualifiers , PolicyNodeImpl rootNode , String curPolicy , Set < PolicyQualifierInfo > pQuals , boolean matchAny ) throws CertPathValidatorException { boolean foundMatch = false ; if ( debug != null ) debug . println ( "PolicyChecker.processParents(): matchAny = " + matchAny ) ; Set < PolicyNodeImpl > parentNodes = rootNode . getPolicyNodesExpected ( certIndex - 1 , curPolicy , matchAny ) ; for ( PolicyNodeImpl curParent : parentNodes ) { if ( debug != null ) debug . println ( "PolicyChecker.processParents() " + "found parent:\n" + curParent . asString ( ) ) ; foundMatch = true ; String curParPolicy = curParent . getValidPolicy ( ) ; PolicyNodeImpl curNode = null ; Set < String > curExpPols = null ; if ( curPolicy . equals ( ANY_POLICY ) ) { Set < String > parExpPols = curParent . getExpectedPolicies ( ) ; parentExplicitPolicies : for ( String curParExpPol : parExpPols ) { Iterator < PolicyNodeImpl > childIter = curParent . getChildren ( ) ; while ( childIter . hasNext ( ) ) { PolicyNodeImpl childNode = childIter . next ( ) ; String childPolicy = childNode . getValidPolicy ( ) ; if ( curParExpPol . equals ( childPolicy ) ) { if ( debug != null ) debug . println ( childPolicy + " in parent's " + "expected policy set already appears in " + "child node" ) ; continue parentExplicitPolicies ; } } Set < String > expPols = new HashSet < > ( ) ; expPols . add ( curParExpPol ) ; curNode = new PolicyNodeImpl ( curParent , curParExpPol , pQuals , policiesCritical , expPols , false ) ; } } else { curExpPols = new HashSet < String > ( ) ; curExpPols . add ( curPolicy ) ; curNode = new PolicyNodeImpl ( curParent , curPolicy , pQuals , policiesCritical , curExpPols , false ) ; } } return foundMatch ; }
finds the policy nodes of depth ( certindex - 1 ) where curpolicy is in the expected policy set and creates a new child node appropriately . if matchany is true , then a value of any_policy in the expected policy set will match any curpolicy . if matchany is false , then the expected policy set must exactly contain the curpolicy to be considered a match . this method returns a boolean value indicating whether a match was found .
