Refine LogAdapter#isPresent

Align LogAdapter#isPresent with ClassUtils#isPresent in order
to catch NoClassDefFoundError and other errors.

Closes gh-29506
This commit is contained in:
Sébastien Deleuze
2022-11-22 09:39:34 +01:00
parent 8350738929
commit 0b8000eeaa

View File

@@ -100,7 +100,8 @@ final class LogAdapter {
Class.forName(className, false, LogAdapter.class.getClassLoader());
return true;
}
catch (ClassNotFoundException ex) {
catch (Throwable ex) {
// Typically ClassNotFoundException or NoClassDefFoundError...
return false;
}
}