diff --git a/transport/src/main/java/io/netty/channel/socket/aio/AioEventLoop.java b/transport/src/main/java/io/netty/channel/socket/aio/AioEventLoop.java index 9424a48d8d..844109bcf3 100644 --- a/transport/src/main/java/io/netty/channel/socket/aio/AioEventLoop.java +++ b/transport/src/main/java/io/netty/channel/socket/aio/AioEventLoop.java @@ -88,12 +88,9 @@ public class AioEventLoop extends MultithreadEventLoop { return ch; } } - if (f.getType() == Object.class) { + if (AbstractAioChannel.class.isAssignableFrom(f.getType())) { f.setAccessible(true); - Object candidate = f.get(command); - if (candidate instanceof AbstractAioChannel) { - return (AbstractAioChannel) candidate; - } + return (AbstractAioChannel) f.get(command); } }