From c3637ff42c53e65f65bf629657638736ce102e28 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Thu, 24 May 2018 21:25:30 +0200 Subject: [PATCH] AUTO_CLOSE should not be marked as deprecated. (#7967) Motivation: A long time ago we deprecated AUTO_CLOSE but it turned out this feature is still useful because if a write error is detected there still maybe data to read, and if we close the channel automatically we will lose data Modifications: - Remove `@Deprecated` tag for AUTO_CLOSE, setAutoClose(...) and isAutoClose(...) - Fix javadocs on ChannelConfig to correctly tell the default value of AUTO_CLOSE. Result: Less warnings. --- .../src/main/java/io/netty/channel/ChannelConfig.java | 10 ++-------- .../src/main/java/io/netty/channel/ChannelOption.java | 3 --- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/transport/src/main/java/io/netty/channel/ChannelConfig.java b/transport/src/main/java/io/netty/channel/ChannelConfig.java index 9e77da7a34..2a7f848d36 100644 --- a/transport/src/main/java/io/netty/channel/ChannelConfig.java +++ b/transport/src/main/java/io/netty/channel/ChannelConfig.java @@ -195,21 +195,15 @@ public interface ChannelConfig { ChannelConfig setAutoRead(boolean autoRead); /** - * @deprecated Auto close will be removed in a future release. - * * Returns {@code true} if and only if the {@link Channel} will be closed automatically and immediately on - * write failure. The default is {@code false}. + * write failure. The default is {@code true}. */ - @Deprecated boolean isAutoClose(); /** - * @deprecated Auto close will be removed in a future release. - * * Sets whether the {@link Channel} should be closed automatically and immediately on write failure. - * The default is {@code false}. + * The default is {@code true}. */ - @Deprecated ChannelConfig setAutoClose(boolean autoClose); /** diff --git a/transport/src/main/java/io/netty/channel/ChannelOption.java b/transport/src/main/java/io/netty/channel/ChannelOption.java index 4cb909a1db..d026a30a5d 100644 --- a/transport/src/main/java/io/netty/channel/ChannelOption.java +++ b/transport/src/main/java/io/netty/channel/ChannelOption.java @@ -99,12 +99,9 @@ public class ChannelOption extends AbstractConstant> { public static final ChannelOption AUTO_READ = valueOf("AUTO_READ"); /** - * @deprecated Auto close will be removed in a future release. - * * If {@code true} then the {@link Channel} is closed automatically and immediately on write failure. * The default value is {@code true}. */ - @Deprecated public static final ChannelOption AUTO_CLOSE = valueOf("AUTO_CLOSE"); public static final ChannelOption SO_BROADCAST = valueOf("SO_BROADCAST");