You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "ppkarwasz (via GitHub)" <gi...@apache.org> on 2023/02/03 08:46:39 UTC

[GitHub] [logging-log4j2] ppkarwasz opened a new pull request, #1263: [LOG4J2-3624] Protects `ServiceLoaderUtil` from unchecked exception

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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [logging-log4j2] ppkarwasz merged pull request #1263: [LOG4J2-3624] Protects `ServiceLoaderUtil` from unchecked exceptions

Posted by "ppkarwasz (via GitHub)" <gi...@apache.org>.
ppkarwasz merged PR #1263:
URL: https://github.com/apache/logging-log4j2/pull/1263


-- 
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: notifications-unsubscribe@logging.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org