-
-
Notifications
You must be signed in to change notification settings - Fork 15.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make initializer as static
#13506
Make initializer as static
#13506
Conversation
|
Thanks for the cleanup |
Unfortunately, this breaks non linux usage of the given classes. At least I experienced this with |
@Kavindu-Dodan How are you "using" this class on non-Linux systems? The exception is not thrown if you do something like the following, for instance: EventLoopGroup group = Epoll.isAvailable() ? new EpollEventLoopGroup(1) : new NioEventLoopGroup(1); |
@chrisvest I observed this with one of the tests where we use Mockito.mockConstruction 1. Internally, this performs a class loading, hence the errors. Yes, the proposed solution works if I have control over the loigc. However, it might not be possible for other usages. Footnotes |
Motivations: By changing the code to use a static block we did remove the ability to load the class at all. This is sort of a regression as it may break existing code. Modifications: This reverts commit 1c7f0fa. Result: It's possible again to at least load the class all the time as before. Fixes #13523
Motivations: By changing the code to use a static block we did remove the ability to load the class at all. This is sort of a regression as it may break existing code. Modifications: This reverts commit 1c7f0fa. Result: It's possible again to at least load the class all the time as before.
Motivation:
I went through native transport and found that we don't explicitly mark class initializers as
static
. We should mark them asstatic
.Modification:
Made initializers as
static
Result:
Clean code and no more IDE warning pings.