Skip to content

Commit 1c7f0fa

Browse files
authored
Make initializer as static (#13506)
Motivation: I went through native transport and found that we don't explicitly mark class initializers as `static`. We should mark them as `static`. Modification: Made initializers as `static` Result: Clean code and no more IDE warning pings.
1 parent dc16c58 commit 1c7f0fa

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

transport-classes-epoll/src/main/java/io/netty/channel/epoll/EpollEventLoopGroup.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
* it only works on linux.
3636
*/
3737
public final class EpollEventLoopGroup extends MultithreadEventLoopGroup {
38-
{
38+
39+
static {
3940
// Ensure JNI is initialized by the time this class is loaded.
4041
Epoll.ensureAvailability();
4142
}

transport-classes-kqueue/src/main/java/io/netty/channel/kqueue/KQueueEventLoopGroup.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@
3232

3333
@UnstableApi
3434
public final class KQueueEventLoopGroup extends MultithreadEventLoopGroup {
35-
{
35+
36+
static {
3637
// Ensure JNI is initialized by the time this class is loaded by this time!
3738
KQueue.ensureAvailability();
3839
}
40+
3941
/**
4042
* Create a new instance using the default number of threads and the default {@link ThreadFactory}.
4143
*/

0 commit comments

Comments
 (0)