diff --git a/common/src/main/java/io/netty/util/internal/logging/InternalLoggerFactory.java b/common/src/main/java/io/netty/util/internal/logging/InternalLoggerFactory.java index 67262aa288..c98a050bf7 100644 --- a/common/src/main/java/io/netty/util/internal/logging/InternalLoggerFactory.java +++ b/common/src/main/java/io/netty/util/internal/logging/InternalLoggerFactory.java @@ -31,15 +31,8 @@ package io.netty.util.internal.logging; * as possible and shouldn't be called more than once. */ public abstract class InternalLoggerFactory { - private static volatile InternalLoggerFactory defaultFactory; - - static { - final String name = InternalLoggerFactory.class.getName(); - InternalLoggerFactory f; - f = newDefaultFactory(name); - - defaultFactory = f; - } + private static volatile InternalLoggerFactory defaultFactory = + newDefaultFactory(InternalLoggerFactory.class.getName()); @SuppressWarnings("UnusedCatchParameter") private static InternalLoggerFactory newDefaultFactory(String name) { @@ -47,7 +40,6 @@ public abstract class InternalLoggerFactory { try { f = new Slf4JLoggerFactory(true); f.newInstance(name).debug("Using SLF4J as the default logging framework"); - defaultFactory = f; } catch (Throwable t1) { try { f = new Log4JLoggerFactory();