From 3bc97962f8a52289ba310e344e0b678145abb5fa Mon Sep 17 00:00:00 2001 From: Dmitriy Dumanskiy Date: Wed, 3 Aug 2016 11:49:08 +0300 Subject: [PATCH] removed unnecessary static holders --- .../channel/epoll/EpollChannelOption.java | 30 +++++++++---------- .../netty/channel/rxtx/RxtxChannelOption.java | 19 +++++------- .../netty/channel/sctp/SctpChannelOption.java | 23 +++++++------- .../netty/channel/udt/UdtChannelOption.java | 14 ++++----- 4 files changed, 43 insertions(+), 43 deletions(-) diff --git a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollChannelOption.java b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollChannelOption.java index 261a6f7796..74e1ca5fdf 100644 --- a/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollChannelOption.java +++ b/transport-native-epoll/src/main/java/io/netty/channel/epoll/EpollChannelOption.java @@ -22,25 +22,25 @@ import java.net.InetAddress; import java.util.Map; public final class EpollChannelOption extends ChannelOption { - @SuppressWarnings("rawtypes") - private static final Class T = EpollChannelOption.class; - public static final ChannelOption TCP_CORK = ChannelOption.valueOf(T, "TCP_CORK"); - public static final ChannelOption SO_REUSEPORT = ChannelOption.valueOf(T, "SO_REUSEPORT"); - public static final ChannelOption TCP_NOTSENT_LOWAT = ChannelOption.valueOf(T, "TCP_NOTSENT_LOWAT"); - public static final ChannelOption TCP_KEEPIDLE = ChannelOption.valueOf(T, "TCP_KEEPIDLE"); - public static final ChannelOption TCP_KEEPINTVL = ChannelOption.valueOf(T, "TCP_KEEPINTVL"); - public static final ChannelOption TCP_KEEPCNT = ChannelOption.valueOf(T, "TCP_KEEPCNT"); - public static final ChannelOption TCP_USER_TIMEOUT = valueOf(T, "TCP_USER_TIMEOUT"); - public static final ChannelOption IP_FREEBIND = ChannelOption.valueOf("IP_FREEBIND"); - public static final ChannelOption TCP_FASTOPEN = valueOf(T, "TCP_FASTOPEN"); - public static final ChannelOption TCP_DEFER_ACCEPT = ChannelOption.valueOf(T, "TCP_DEFER_ACCEPT"); - public static final ChannelOption TCP_QUICKACK = ChannelOption.valueOf(T, "TCP_QUICKACK"); + public static final ChannelOption TCP_CORK = valueOf(EpollChannelOption.class, "TCP_CORK"); + public static final ChannelOption SO_REUSEPORT = valueOf(EpollChannelOption.class, "SO_REUSEPORT"); + public static final ChannelOption TCP_NOTSENT_LOWAT = valueOf(EpollChannelOption.class, "TCP_NOTSENT_LOWAT"); + public static final ChannelOption TCP_KEEPIDLE = valueOf(EpollChannelOption.class, "TCP_KEEPIDLE"); + public static final ChannelOption TCP_KEEPINTVL = valueOf(EpollChannelOption.class, "TCP_KEEPINTVL"); + public static final ChannelOption TCP_KEEPCNT = valueOf(EpollChannelOption.class, "TCP_KEEPCNT"); + public static final ChannelOption TCP_USER_TIMEOUT = + valueOf(EpollChannelOption.class, "TCP_USER_TIMEOUT"); + public static final ChannelOption IP_FREEBIND = valueOf("IP_FREEBIND"); + public static final ChannelOption TCP_FASTOPEN = valueOf(EpollChannelOption.class, "TCP_FASTOPEN"); + public static final ChannelOption TCP_DEFER_ACCEPT = + ChannelOption.valueOf(EpollChannelOption.class, "TCP_DEFER_ACCEPT"); + public static final ChannelOption TCP_QUICKACK = valueOf(EpollChannelOption.class, "TCP_QUICKACK"); public static final ChannelOption DOMAIN_SOCKET_READ_MODE = - ChannelOption.valueOf(T, "DOMAIN_SOCKET_READ_MODE"); + ChannelOption.valueOf(EpollChannelOption.class, "DOMAIN_SOCKET_READ_MODE"); public static final ChannelOption EPOLL_MODE = - ChannelOption.valueOf(T, "EPOLL_MODE"); + ChannelOption.valueOf(EpollChannelOption.class, "EPOLL_MODE"); public static final ChannelOption> TCP_MD5SIG = valueOf("TCP_MD5SIG"); diff --git a/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelOption.java b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelOption.java index 164f57f82c..ee0be2736f 100644 --- a/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelOption.java +++ b/transport-rxtx/src/main/java/io/netty/channel/rxtx/RxtxChannelOption.java @@ -25,17 +25,14 @@ import io.netty.channel.rxtx.RxtxChannelConfig.Stopbits; */ public final class RxtxChannelOption extends ChannelOption { - @SuppressWarnings("rawtypes") - private static final Class T = RxtxChannelOption.class; - - public static final ChannelOption BAUD_RATE = valueOf(T, "BAUD_RATE"); - public static final ChannelOption DTR = valueOf(T, "DTR"); - public static final ChannelOption RTS = valueOf(T, "RTS"); - public static final ChannelOption STOP_BITS = valueOf(T, "STOP_BITS"); - public static final ChannelOption DATA_BITS = valueOf(T, "DATA_BITS"); - public static final ChannelOption PARITY_BIT = valueOf(T, "PARITY_BIT"); - public static final ChannelOption WAIT_TIME = valueOf(T, "WAIT_TIME"); - public static final ChannelOption READ_TIMEOUT = valueOf(T, "READ_TIMEOUT"); + public static final ChannelOption BAUD_RATE = valueOf(RxtxChannelOption.class, "BAUD_RATE"); + public static final ChannelOption DTR = valueOf(RxtxChannelOption.class, "DTR"); + public static final ChannelOption RTS = valueOf(RxtxChannelOption.class, "RTS"); + public static final ChannelOption STOP_BITS = valueOf(RxtxChannelOption.class, "STOP_BITS"); + public static final ChannelOption DATA_BITS = valueOf(RxtxChannelOption.class, "DATA_BITS"); + public static final ChannelOption PARITY_BIT = valueOf(RxtxChannelOption.class, "PARITY_BIT"); + public static final ChannelOption WAIT_TIME = valueOf(RxtxChannelOption.class, "WAIT_TIME"); + public static final ChannelOption READ_TIMEOUT = valueOf(RxtxChannelOption.class, "READ_TIMEOUT"); @SuppressWarnings({ "unused", "deprecation" }) private RxtxChannelOption() { diff --git a/transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelOption.java b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelOption.java index edfaac0ac4..670a530d4f 100644 --- a/transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelOption.java +++ b/transport-sctp/src/main/java/io/netty/channel/sctp/SctpChannelOption.java @@ -25,18 +25,21 @@ import java.net.SocketAddress; */ public final class SctpChannelOption extends ChannelOption { - @SuppressWarnings("rawtypes") - private static final Class T = SctpChannelOption.class; + public static final ChannelOption SCTP_DISABLE_FRAGMENTS = + valueOf(SctpChannelOption.class, "SCTP_DISABLE_FRAGMENTS"); + public static final ChannelOption SCTP_EXPLICIT_COMPLETE = + valueOf(SctpChannelOption.class, "SCTP_EXPLICIT_COMPLETE"); + public static final ChannelOption SCTP_FRAGMENT_INTERLEAVE = + valueOf(SctpChannelOption.class, "SCTP_FRAGMENT_INTERLEAVE"); + public static final ChannelOption SCTP_INIT_MAXSTREAMS = + valueOf(SctpChannelOption.class, "SCTP_INIT_MAXSTREAMS"); - public static final ChannelOption SCTP_DISABLE_FRAGMENTS = valueOf(T, "SCTP_DISABLE_FRAGMENTS"); - public static final ChannelOption SCTP_EXPLICIT_COMPLETE = valueOf(T, "SCTP_EXPLICIT_COMPLETE"); - public static final ChannelOption SCTP_FRAGMENT_INTERLEAVE = valueOf(T, "SCTP_FRAGMENT_INTERLEAVE"); - public static final ChannelOption SCTP_INIT_MAXSTREAMS = valueOf(T, "SCTP_INIT_MAXSTREAMS"); - - public static final ChannelOption SCTP_NODELAY = valueOf(T, "SCTP_NODELAY"); - public static final ChannelOption SCTP_PRIMARY_ADDR = valueOf(T, "SCTP_PRIMARY_ADDR"); + public static final ChannelOption SCTP_NODELAY = + valueOf(SctpChannelOption.class, "SCTP_NODELAY"); + public static final ChannelOption SCTP_PRIMARY_ADDR = + valueOf(SctpChannelOption.class, "SCTP_PRIMARY_ADDR"); public static final ChannelOption SCTP_SET_PEER_PRIMARY_ADDR = - valueOf(T, "SCTP_SET_PEER_PRIMARY_ADDR"); + valueOf(SctpChannelOption.class, "SCTP_SET_PEER_PRIMARY_ADDR"); @SuppressWarnings({ "unused", "deprecation" }) private SctpChannelOption() { diff --git a/transport-udt/src/main/java/io/netty/channel/udt/UdtChannelOption.java b/transport-udt/src/main/java/io/netty/channel/udt/UdtChannelOption.java index eb01f7568f..0538d11382 100644 --- a/transport-udt/src/main/java/io/netty/channel/udt/UdtChannelOption.java +++ b/transport-udt/src/main/java/io/netty/channel/udt/UdtChannelOption.java @@ -23,29 +23,29 @@ import io.netty.channel.ChannelOption; */ public final class UdtChannelOption extends ChannelOption { - @SuppressWarnings("rawtypes") - private static final Class T = UdtChannelOption.class; - /** * See {@link OptionUDT#Protocol_Receive_Buffer_Size}. */ public static final ChannelOption PROTOCOL_RECEIVE_BUFFER_SIZE = - valueOf(T, "PROTOCOL_RECEIVE_BUFFER_SIZE"); + valueOf(UdtChannelOption.class, "PROTOCOL_RECEIVE_BUFFER_SIZE"); /** * See {@link OptionUDT#Protocol_Send_Buffer_Size}. */ - public static final ChannelOption PROTOCOL_SEND_BUFFER_SIZE = valueOf(T, "PROTOCOL_SEND_BUFFER_SIZE"); + public static final ChannelOption PROTOCOL_SEND_BUFFER_SIZE = + valueOf(UdtChannelOption.class, "PROTOCOL_SEND_BUFFER_SIZE"); /** * See {@link OptionUDT#System_Receive_Buffer_Size}. */ - public static final ChannelOption SYSTEM_RECEIVE_BUFFER_SIZE = valueOf(T, "SYSTEM_RECEIVE_BUFFER_SIZE"); + public static final ChannelOption SYSTEM_RECEIVE_BUFFER_SIZE = + valueOf(UdtChannelOption.class, "SYSTEM_RECEIVE_BUFFER_SIZE"); /** * See {@link OptionUDT#System_Send_Buffer_Size}. */ - public static final ChannelOption SYSTEM_SEND_BUFFER_SIZE = valueOf(T, "SYSTEM_SEND_BUFFER_SIZE"); + public static final ChannelOption SYSTEM_SEND_BUFFER_SIZE = + valueOf(UdtChannelOption.class, "SYSTEM_SEND_BUFFER_SIZE"); @SuppressWarnings({ "unused", "deprecation" }) private UdtChannelOption() {