diff --git a/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java b/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java index f7c04d9e73..8c098331c5 100644 --- a/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java +++ b/transport/src/main/java/io/netty/bootstrap/AbstractBootstrap.java @@ -183,6 +183,7 @@ public abstract class AbstractBootstrap, C ext * Allow to specify an initial attribute of the newly created {@link Channel}. If the {@code value} is * {@code null}, the attribute of the specified {@code key} is removed. */ + @SuppressWarnings("unchecked") public B attr(AttributeKey key, T value) { if (key == null) { throw new NullPointerException("key"); @@ -196,10 +197,7 @@ public abstract class AbstractBootstrap, C ext attrs.put(key, value); } } - - @SuppressWarnings("unchecked") - B b = (B) this; - return b; + return (B) this; } /**