4b7e5c96b4
Motivation: Make @sharable annotation works with anonymous inner types. Add Java 8 ElementType.TYPE_USE feature that makes easy to use @sharable annotation. Modification: transport/src/main/java/io/netty/channel/ChannelHandler.java - Target ElementType.TYPE_USE added. transport/src/main/java/io/netty/channel/ChannelHandlerAdapter.java - isSharable method improved to verify AnnotatedSuperclass for annotation. transport/src/test/java/io/netty/channel/ChannelHandlerAdapterTest.java - Tests added. Result: ChannelInboundHandler handler = new @Sharable ChannelInboundHandlerAdapter() { @Override public void channelRead(ChannelHandlerContext context, Object message) { context.write(message); } }; Note: The following changes don't support local variable annotation: ChannelInboundHandler handler1 = new @sharable ChannelInboundHandlerAdapter(); @sharable ChannelInboundHandler handler2 = new ChannelInboundHandlerAdapter(); Fixes #7756 |
||
---|---|---|
.. | ||
src | ||
pom.xml |