diff --git a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoopGroup.java b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoopGroup.java index f62bf88849..acb4212fe9 100644 --- a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoopGroup.java +++ b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoopGroup.java @@ -33,8 +33,8 @@ import java.util.concurrent.ThreadFactory; * it only works on linux. */ public final class EpollEventLoopGroup extends MultithreadEventLoopGroup { - static { - // Ensure JNI is initialized by the time this class is loaded by this time! + { + // Ensure JNI is initialized by the time this class is loaded. Epoll.ensureAvailability(); } @@ -102,25 +102,21 @@ public final class EpollEventLoopGroup extends MultithreadEventLoopGroup { public EpollEventLoopGroup(int nThreads, ThreadFactory threadFactory, int maxEventsAtOnce, SelectStrategyFactory selectStrategyFactory) { super(nThreads, threadFactory, maxEventsAtOnce, selectStrategyFactory, RejectedExecutionHandlers.reject()); - Epoll.ensureAvailability(); } public EpollEventLoopGroup(int nThreads, Executor executor, SelectStrategyFactory selectStrategyFactory) { super(nThreads, executor, 0, selectStrategyFactory, RejectedExecutionHandlers.reject()); - Epoll.ensureAvailability(); } public EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectStrategyFactory selectStrategyFactory) { super(nThreads, executor, chooserFactory, 0, selectStrategyFactory, RejectedExecutionHandlers.reject()); - Epoll.ensureAvailability(); } public EpollEventLoopGroup(int nThreads, Executor executor, EventExecutorChooserFactory chooserFactory, SelectStrategyFactory selectStrategyFactory, RejectedExecutionHandler rejectedExecutionHandler) { super(nThreads, executor, chooserFactory, 0, selectStrategyFactory, rejectedExecutionHandler); - Epoll.ensureAvailability(); } /** diff --git a/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/KQueueEventLoopGroup.java b/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/KQueueEventLoopGroup.java index 60fc24bc54..fe32aa5a7b 100644 --- a/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/KQueueEventLoopGroup.java +++ b/transport-native-kqueue/src/main/java/io/netty/channel/kqueue/KQueueEventLoopGroup.java @@ -30,7 +30,7 @@ import java.util.concurrent.ThreadFactory; @UnstableApi public final class KQueueEventLoopGroup extends MultithreadEventLoopGroup { - static { + { // Ensure JNI is initialized by the time this class is loaded by this time! KQueue.ensureAvailability(); }