Skip to content

Commit

Permalink
Make initializer as static (#13506)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hyperxpro committed Jul 24, 2023
1 parent dc16c58 commit 1c7f0fa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
* it only works on linux.
*/
public final class EpollEventLoopGroup extends MultithreadEventLoopGroup {
{

static {
// Ensure JNI is initialized by the time this class is loaded.
Epoll.ensureAvailability();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@

@UnstableApi
public final class KQueueEventLoopGroup extends MultithreadEventLoopGroup {
{

static {
// Ensure JNI is initialized by the time this class is loaded by this time!
KQueue.ensureAvailability();
}

/**
* Create a new instance using the default number of threads and the default {@link ThreadFactory}.
*/
Expand Down

0 comments on commit 1c7f0fa

Please sign in to comment.