ppkarwasz opened a new pull request, #1263:
URL: https://github.com/apache/logging-log4j2/pull/1263

   Contrary to the documentation `ServiceLoader` can also throw unchecked 
exceptions such as `NoClassDefFoundError` or other `LinkageError`s. This should 
not prevent `ServiceLoaderUtil` from returning those services, which are not 
broken. Also `ServiceLoader.iterator().hasNext()` throws on Java 9+.
   
   This PR:
    * add `LinkageError` to the list of `ServiceLoader` exceptions that are 
logged, but **ignored**,
    * logs and rethrows all other `ServiceLoader` exceptions, including 
`SecurityException` that users expect to be rethrown (cf. #1006, #1007 and 
#1008),
    * refactors the tests and adds a case which throws a `LinkageError`,
    * `ServiceLoader` from Java 9+ ignores services, which are specified in a 
`META-INF/services` file, but are on the modulepath. Therefore we replace the 
`java.lang.String` test case with a class from the classpath. This solves #1260.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to