|
16 | 16 | package io.netty.channel; |
17 | 17 |
|
18 | 18 | import io.netty.buffer.ByteBufAllocator; |
19 | | -import io.netty.util.Attribute; |
20 | | -import io.netty.util.AttributeKey; |
21 | 19 | import io.netty.util.Recycler; |
22 | 20 | import io.netty.util.ReferenceCountUtil; |
23 | 21 | import io.netty.util.ResourceLeakHint; |
@@ -352,14 +350,7 @@ public ChannelHandlerContext fireChannelShutdown(ChannelShutdownType type) { |
352 | 350 | // Duplex handlers implements both out/in interfaces causing a scalability issue |
353 | 351 | // see https://bugs.openjdk.org/browse/JDK-8180450 |
354 | 352 | final ChannelHandler handler = next.handler(); |
355 | | - final DefaultChannelPipeline.HeadContext headContext = pipeline.head; |
356 | | - if (handler == headContext) { |
357 | | - headContext.channelShutdown(next, type); |
358 | | - } else if (handler instanceof ChannelDuplexHandler) { |
359 | | - ((ChannelDuplexHandler) handler).channelShutdown(next, type); |
360 | | - } else { |
361 | | - ((ChannelInboundHandler) handler).channelShutdown(next, type); |
362 | | - } |
| 353 | + ((ChannelInboundHandler) handler).channelShutdown(next, type); |
363 | 354 | } catch (Throwable t) { |
364 | 355 | next.invokeExceptionCaught(t); |
365 | 356 | } |
@@ -657,20 +648,8 @@ public void run() { |
657 | 648 | private void invokeShutdown(ChannelShutdownType type, ChannelPromise promise) { |
658 | 649 | if (invokeHandler()) { |
659 | 650 | try { |
660 | | - // DON'T CHANGE |
661 | | - // Duplex handlers implements both out/in interfaces causing a scalability issue |
662 | | - // see https://bugs.openjdk.org/browse/JDK-8180450 |
663 | 651 | final ChannelHandler handler = handler(); |
664 | | - final DefaultChannelPipeline.HeadContext headContext = pipeline.head; |
665 | | - if (handler == headContext) { |
666 | | - headContext.shutdown(this, type, promise); |
667 | | - } else if (handler instanceof ChannelDuplexHandler) { |
668 | | - ((ChannelDuplexHandler) handler).shutdown(this, type, promise); |
669 | | - } else if (handler instanceof ChannelOutboundHandlerAdapter) { |
670 | | - ((ChannelOutboundHandlerAdapter) handler).shutdown(this, type, promise); |
671 | | - } else { |
672 | | - ((ChannelOutboundHandler) handler).shutdown(this, type, promise); |
673 | | - } |
| 652 | + ((ChannelOutboundHandler) handler).shutdown(this, type, promise); |
674 | 653 | } catch (Throwable t) { |
675 | 654 | notifyOutboundHandlerException(t, promise); |
676 | 655 | } |
|