@Test public void readServicesFile() { List<String> names = locator.readServiceClassNames( createInput(Object.class.getName() + "\n" + String.class.getName() + " # trailing comment")); assertNotNull(names); assertEquals(2, names.size()); assertEquals(Object.class.getName(), names.get(0)); assertEquals(String.class.getName(), names.get(1)); }
protected List<String> readServiceClassNames(URL url) { try (InputStream stream = url.openStream()) { return readServiceClassNames(stream); } catch (IOException e) { logReadServiceClassNamesFailure(e); } return Collections.emptyList(); }
ServiceLocator { protected List<String> readServiceClassNames(URL url) { try (InputStream stream = url.openStream()) { return readServiceClassNames(stream); } catch (IOException e) { logReadServiceClassNamesFailure(e); } return Collections.emptyList(); } }
ServiceLocator { protected List<String> readServiceClassNames(URL url) { try (InputStream stream = url.openStream()) { return readServiceClassNames(stream); } catch (IOException e) { logReadServiceClassNamesFailure(e); } return Collections.emptyList(); } protected  ServiceLocator(ClassLoader classLoader); }
ServiceLocator { protected List<String> readServiceClassNames(URL url) { try (InputStream stream = url.openStream()) { return readServiceClassNames(stream); } catch (IOException e) { logReadServiceClassNamesFailure(e); } return Collections.emptyList(); } protected  ServiceLocator(ClassLoader classLoader); static ServiceLocator getInstance(ClassLoader classLoader); static ServiceLocator getInstance(); MarkupLanguage getMarkupLanguage(final String languageName); Set<MarkupLanguage> getAllMarkupLanguages(); static void setImplementation(Class<? extends ServiceLocator> implementationClass); }
ServiceLocator { protected List<String> readServiceClassNames(URL url) { try (InputStream stream = url.openStream()) { return readServiceClassNames(stream); } catch (IOException e) { logReadServiceClassNamesFailure(e); } return Collections.emptyList(); } protected  ServiceLocator(ClassLoader classLoader); static ServiceLocator getInstance(ClassLoader classLoader); static ServiceLocator getInstance(); MarkupLanguage getMarkupLanguage(final String languageName); Set<MarkupLanguage> getAllMarkupLanguages(); static void setImplementation(Class<? extends ServiceLocator> implementationClass);  }