code: private static Collection<X509CRL> getCRLs(X500Name name,
                                                 X500Principal certIssuer,
                                                 List<CertStore> certStores)
          throws CertStoreException
      {
          if (debug != null) {
              debug.println("Trying to fetch CRL from DP " + name);
          }
          X509CRLSelector xcs = new X509CRLSelector();
          xcs.addIssuer(name.asX500Principal());
          xcs.addIssuer(certIssuer);
          Collection<X509CRL> crls = new ArrayList<>();
          CertStoreException savedCSE = null;
          for (CertStore store : certStores) {
              try {
                  for (CRL crl : store.getCRLs(xcs)) {
                      crls.add((X509CRL)crl);
                  }
              } catch (CertStoreException cse) {
                  if (debug != null) {
                      debug.println("Exception while retrieving " +
                          "CRLs: " + cse);
                      cse.printStackTrace();
                  }
                  savedCSE = new PKIX.CertStoreTypeException(store.getType(),cse);
              }
          }
          // only throw CertStoreException if no CRLs are retrieved
          if (crls.isEmpty() && savedCSE != null) {
              throw savedCSE;
          } else {
              return crls;
          }
      }
docs: Fetch CRLs from certStores.
  
  @throws CertStoreException if there is an error retrieving the CRLs from
  one of the CertStores and no other CRLs are retrieved from
  the other CertStores. If more than one CertStore throws an
  exception then the one from the last CertStore is thrown.