This is an automated email from the ASF dual-hosted git repository.

pkarwasz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git

commit 2322f197df2238a3c53372d3bce1fc5a0f0c0f17
Author: Gary Gregory <[email protected]>
AuthorDate: Thu Dec 16 21:16:09 2021 -0500

    No need to nest.
---
 .../java/org/apache/logging/log4j/core/config/Configurator.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
index 04656e1431..06746ad6cd 100644
--- 
a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
+++ 
b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/Configurator.java
@@ -46,14 +46,14 @@ public final class Configurator {
         final LoggerContextFactory factory = LogManager.getFactory();
         if (factory instanceof Log4jContextFactory) {
             return (Log4jContextFactory) factory;
-        } else if (factory != null) {
+        }
+        if (factory != null) {
             LOGGER.error("LogManager returned an instance of {} which does not 
implement {}. Unable to initialize Log4j.",
                     factory.getClass().getName(), 
Log4jContextFactory.class.getName());
-            return null;
         } else {
             LOGGER.fatal("LogManager did not return a LoggerContextFactory. 
This indicates something has gone terribly wrong!");
-            return null;
         }
+        return null;
     }
 
     /**

Reply via email to