vy commented on code in PR #1961:
URL: https://github.com/apache/logging-log4j2/pull/1961#discussion_r1392255886


##########
log4j-core/src/main/java/org/apache/logging/log4j/core/async/DisruptorUtil.java:
##########
@@ -82,35 +84,31 @@ static int calculateRingBufferSize(final String 
propertyName) {
     }
 
     static ExceptionHandler<RingBufferLogEvent> 
getAsyncLoggerExceptionHandler() {
-        final String cls = 
PropertiesUtil.getProperties().getStringProperty("AsyncLogger.ExceptionHandler");
-        if (cls == null) {
-            return new AsyncLoggerDefaultExceptionHandler();
-        }
+        ExceptionHandler<RingBufferLogEvent> handler = null;
         try {
-            @SuppressWarnings("unchecked")
-            final Class<? extends ExceptionHandler<RingBufferLogEvent>> klass =
-                (Class<? extends ExceptionHandler<RingBufferLogEvent>>) 
Loader.loadClass(cls);
-            return klass.newInstance();
-        } catch (final Exception ignored) {
-            LOGGER.debug("Invalid AsyncLogger.ExceptionHandler value: error 
creating {}: ", cls, ignored);
-            return new AsyncLoggerDefaultExceptionHandler();
+            handler =

Review Comment:
   I wouldn't expect it to return `null`, given it throws a bunch of exceptions 
already for every possible corner case. Shouldn't we make 
`newCheckedInstanceOfProperty()` not return `null` instead?



-- 
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