Class klass;
    private Object loadNextServiceProvider()    {      String line;      Class klass;            if (reader == null)        advanceReader();      for (;;)        {          /* If we have reached the last provider list, we cannot           * retrieve any further lines.           */          if (reader == null)            return null;          try            {              line = reader.readLine();            }          catch (IOException readProblem)            {              log(Level.WARNING, "IOException upon reading {0}", currentURL,                  readProblem);              line = null;            }          /* When we are at the end of one list of services,           * switch over to the next one.           */          if (line == null)            {              advanceReader();              continue;            }          // Skip whitespace at the beginning and end of each line.          line = line.trim();          // Skip empty lines.          if (line.length() == 0)            continue;          // Skip comment lines.          if (line.charAt(0) == '#')            continue;          try            {              log(Level.FINE,                  "Loading service provider \"{0}\", specified"                  + " by \"META-INF/services/{1}\" in {2}.",                  new Object[] { line, spi.getName(), currentURL },                  null);              /* Load the class in the security context that was               * active when calling lookupProviders.               */              return AccessController.doPrivileged(                new ServiceProviderLoadingAction(spi, line, loader),                securityContext);            }          catch (Exception ex)            {              String msg = "Cannot load service provider class \"{0}\","                + " specified by \"META-INF/services/{1}\" in {2}";              if (ex instanceof PrivilegedActionException                  && ex.getCause() instanceof ClassCastException)                msg = "Service provider class \"{0}\" is not an instance"                  + " of \"{1}\". Specified"                  + " by \"META-INF/services/{1}\" in {2}.";              log(Level.WARNING, msg,                                    new Object[] { line, spi.getName(), currentURL },                  ex);              continue;            }        }    }