Ensure the selector implementation can be instrumented before attempting instrumentation
- Fixes #1908
This commit is contained in:
parent
522dbf8543
commit
16bf687aec
@ -137,7 +137,12 @@ public final class NioEventLoop extends SingleThreadEventLoop {
|
||||
|
||||
Class<?> selectorImplClass =
|
||||
Class.forName("sun.nio.ch.SelectorImpl", false, ClassLoader.getSystemClassLoader());
|
||||
selectorImplClass.isAssignableFrom(selector.getClass());
|
||||
|
||||
// Ensure the current selector implementation is what we can instrument.
|
||||
if (!selectorImplClass.isAssignableFrom(selector.getClass())) {
|
||||
return selector;
|
||||
}
|
||||
|
||||
Field selectedKeysField = selectorImplClass.getDeclaredField("selectedKeys");
|
||||
Field publicSelectedKeysField = selectorImplClass.getDeclaredField("publicSelectedKeys");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user