InputStream stream;
  public static Iterator lookupProviders(Class spi,                                         ClassLoader loader)  {    InputStream stream;    String resourceName;    Enumeration urls;    if (spi == null)      throw new IllegalArgumentException();    if (loader == null)      loader = ClassLoader.getSystemClassLoader();    resourceName = "META-INF/services/" + spi.getName();    try      {        urls = loader.getResources(resourceName);      }    catch (IOException ioex)      {        /* If an I/O error occurs here, we cannot provide any service         * providers. In this case, we simply return an iterator that         * does not return anything (no providers installed).         */        log(Level.WARNING, "cannot access {0}", resourceName, ioex);        return Collections.EMPTY_LIST.iterator();      }    return new ServiceIterator(spi, urls, loader,                               AccessController.getContext());  }