Ensure the selector implementation can be instrumented before attempting instrumentation
- Fixes #1908
This commit is contained in:
parent
d946659520
commit
c9b7f1f1b5
@ -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