From dd429b249504b8f7c3caa3bcd417696839c6d328 Mon Sep 17 00:00:00 2001 From: Idel Pivnitskiy Date: Sun, 20 Jul 2014 00:40:45 +0400 Subject: [PATCH] Small fixes and improvements Motivation: Fix some typos in Netty. Modifications: - Fix potentially dangerous use of non-short-circuit logic in Recycler.transfer(Stack). - Removed double 'the the' in javadoc of EmbeddedChannel. - Write to log an exception message if we can not get SOMAXCONN in the NetUtil's static block. --- common/src/main/java/io/netty/util/NetUtil.java | 2 +- common/src/main/java/io/netty/util/Recycler.java | 2 +- .../main/java/io/netty/channel/embedded/EmbeddedChannel.java | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/io/netty/util/NetUtil.java b/common/src/main/java/io/netty/util/NetUtil.java index 42cb89e9471..fe76d97f2b6 100644 --- a/common/src/main/java/io/netty/util/NetUtil.java +++ b/common/src/main/java/io/netty/util/NetUtil.java @@ -186,7 +186,7 @@ public final class NetUtil { somaxconn = Integer.parseInt(in.readLine()); logger.debug("/proc/sys/net/core/somaxconn: {}", somaxconn); } catch (Exception e) { - // Failed to get SOMAXCONN + logger.debug("Failed to get SOMAXCONN", e); } finally { if (in != null) { try { diff --git a/common/src/main/java/io/netty/util/Recycler.java b/common/src/main/java/io/netty/util/Recycler.java index a1a4c6ceda7..a56499cd7b8 100644 --- a/common/src/main/java/io/netty/util/Recycler.java +++ b/common/src/main/java/io/netty/util/Recycler.java @@ -236,7 +236,7 @@ boolean transfer(Stack to) { } to.size = size; - if (end == LINK_CAPACITY & head.next != null) { + if (end == LINK_CAPACITY && head.next != null) { this.head = head.next; } diff --git a/transport/src/main/java/io/netty/channel/embedded/EmbeddedChannel.java b/transport/src/main/java/io/netty/channel/embedded/EmbeddedChannel.java index 81683d3796d..a30697533ce 100644 --- a/transport/src/main/java/io/netty/channel/embedded/EmbeddedChannel.java +++ b/transport/src/main/java/io/netty/channel/embedded/EmbeddedChannel.java @@ -163,7 +163,7 @@ public T readOutbound() { * * @param msgs the messages to be written * - * @return {@code true} if the write operation did add something to the the inbound buffer + * @return {@code true} if the write operation did add something to the inbound buffer */ public boolean writeInbound(Object... msgs) { ensureOpen(); @@ -185,7 +185,7 @@ public boolean writeInbound(Object... msgs) { * Write messages to the outbound of this {@link Channel}. * * @param msgs the messages to be written - * @return bufferReadable returns {@code true} if the write operation did add something to the the outbound buffer + * @return bufferReadable returns {@code true} if the write operation did add something to the outbound buffer */ public boolean writeOutbound(Object... msgs) { ensureOpen();