jdk/src/share/classes/java/util/ServiceLoader.java
changeset 12448 b95438b17098
parent 9035 1255eb81cc2f
child 14016 56be5085fc31
child 14218 c6f2434dd88d
equal deleted inserted replaced
12447:92676a77a667 12448:b95438b17098
   216         service = svc;
   216         service = svc;
   217         loader = cl;
   217         loader = cl;
   218         reload();
   218         reload();
   219     }
   219     }
   220 
   220 
   221     private static void fail(Class service, String msg, Throwable cause)
   221     private static void fail(Class<?> service, String msg, Throwable cause)
   222         throws ServiceConfigurationError
   222         throws ServiceConfigurationError
   223     {
   223     {
   224         throw new ServiceConfigurationError(service.getName() + ": " + msg,
   224         throw new ServiceConfigurationError(service.getName() + ": " + msg,
   225                                             cause);
   225                                             cause);
   226     }
   226     }
   227 
   227 
   228     private static void fail(Class service, String msg)
   228     private static void fail(Class<?> service, String msg)
   229         throws ServiceConfigurationError
   229         throws ServiceConfigurationError
   230     {
   230     {
   231         throw new ServiceConfigurationError(service.getName() + ": " + msg);
   231         throw new ServiceConfigurationError(service.getName() + ": " + msg);
   232     }
   232     }
   233 
   233 
   234     private static void fail(Class service, URL u, int line, String msg)
   234     private static void fail(Class<?> service, URL u, int line, String msg)
   235         throws ServiceConfigurationError
   235         throws ServiceConfigurationError
   236     {
   236     {
   237         fail(service, u + ":" + line + ": " + msg);
   237         fail(service, u + ":" + line + ": " + msg);
   238     }
   238     }
   239 
   239 
   240     // Parse a single line from the given configuration file, adding the name
   240     // Parse a single line from the given configuration file, adding the name
   241     // on the line to the names list.
   241     // on the line to the names list.
   242     //
   242     //
   243     private int parseLine(Class service, URL u, BufferedReader r, int lc,
   243     private int parseLine(Class<?> service, URL u, BufferedReader r, int lc,
   244                           List<String> names)
   244                           List<String> names)
   245         throws IOException, ServiceConfigurationError
   245         throws IOException, ServiceConfigurationError
   246     {
   246     {
   247         String ln = r.readLine();
   247         String ln = r.readLine();
   248         if (ln == null) {
   248         if (ln == null) {
   284     //
   284     //
   285     // @throws ServiceConfigurationError
   285     // @throws ServiceConfigurationError
   286     //         If an I/O error occurs while reading from the given URL, or
   286     //         If an I/O error occurs while reading from the given URL, or
   287     //         if a configuration-file format error is detected
   287     //         if a configuration-file format error is detected
   288     //
   288     //
   289     private Iterator<String> parse(Class service, URL u)
   289     private Iterator<String> parse(Class<?> service, URL u)
   290         throws ServiceConfigurationError
   290         throws ServiceConfigurationError
   291     {
   291     {
   292         InputStream in = null;
   292         InputStream in = null;
   293         BufferedReader r = null;
   293         BufferedReader r = null;
   294         ArrayList<String> names = new ArrayList<>();
   294         ArrayList<String> names = new ArrayList<>();