code: private static boolean parse(Class<?> service, URL u) throws ServiceConfigurationError {
          InputStream in = null;
          BufferedReader r = null;
          try {
              in = u.openStream();
              r = new BufferedReader(new InputStreamReader(in, "utf-8"));
              int lc = 1;
              String ln;
              while ((ln = r.readLine()) != null) {
                  int ci = ln.indexOf('#');
                  if (ci >= 0) ln = ln.substring(0, ci);
                  ln = ln.trim();
                  int n = ln.length();
                  if (n != 0) {
                      if ((ln.indexOf(' ') >= 0) || (ln.indexOf('\t') >= 0))
                          fail(service, u, lc, "Illegal configuration-file syntax");
                      int cp = ln.codePointAt(0);
                      if (!Character.isJavaIdentifierStart(cp))
                          fail(service, u, lc, "Illegal provider-class name: " + ln);
                      for (int i = Character.charCount(cp); i < n; i += Character.charCount(cp)) {
                          cp = ln.codePointAt(i);
                          if (!Character.isJavaIdentifierPart(cp) && (cp != '.'))
                              fail(service, u, lc, "Illegal provider-class name: " + ln);
                      }
                      return true;
                  }
              }
          } catch (FileNotFoundException x) {
              return false;
          } catch (IOException x) {
              fail(service, ": " + x);
          } finally {
              try {
                  if (r != null) r.close();
              } catch (IOException y) {
                  fail(service, ": " + y);
              }
              try {
                  if (in != null) in.close();
              } catch (IOException y) {
                  fail(service, ": " + y);
              }
          }
          return false;
      }
docs: Parse the content of the given URL as a provider-configuration file.
  
  @param  service
  The service class for which providers are being sought;
  used to construct error detail strings
  
  @param  u
  The URL naming the configuration file to be parsed
  
  @return true if the name of a service is found
  
  @throws ServiceConfigurationError
  If an I/O error occurs while reading from the given URL, or
  if a configuration-file format error is detected