Don't call Field.get(..) if we can avoid it

This commit is contained in:
Norman Maurer 2012-07-08 17:41:12 +02:00
parent adb4b87fa8
commit 0289dadca4

View File

@ -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);
}
}