From 1781e0e1dd271e7935a621e6a037551a51d083c5 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Wed, 4 Mar 2009 14:15:59 +0000 Subject: [PATCH] Fixed find bugs warnings --- .../org/jboss/netty/channel/local/LocalClientChannelSink.java | 3 ++- .../org/jboss/netty/channel/local/LocalServerChannelSink.java | 3 ++- .../netty/channel/socket/nio/NioServerSocketPipelineSink.java | 3 ++- .../org/jboss/netty/channel/xnio/XnioClientChannelSink.java | 3 ++- .../org/jboss/netty/handler/codec/http/HttpMessageDecoder.java | 1 - 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jboss/netty/channel/local/LocalClientChannelSink.java b/src/main/java/org/jboss/netty/channel/local/LocalClientChannelSink.java index efd7014786..a209dbe8b3 100644 --- a/src/main/java/org/jboss/netty/channel/local/LocalClientChannelSink.java +++ b/src/main/java/org/jboss/netty/channel/local/LocalClientChannelSink.java @@ -88,7 +88,8 @@ final class LocalClientChannelSink extends AbstractChannelSink { else if (e instanceof MessageEvent) { MessageEvent event = (MessageEvent) e; DefaultLocalChannel channel = (DefaultLocalChannel) event.getChannel(); - channel.writeBuffer.offer(event); + boolean offered = channel.writeBuffer.offer(event); + assert offered; channel.flushWriteBuffer(); } } diff --git a/src/main/java/org/jboss/netty/channel/local/LocalServerChannelSink.java b/src/main/java/org/jboss/netty/channel/local/LocalServerChannelSink.java index 8a3dca6c40..0fde269ed7 100644 --- a/src/main/java/org/jboss/netty/channel/local/LocalServerChannelSink.java +++ b/src/main/java/org/jboss/netty/channel/local/LocalServerChannelSink.java @@ -109,7 +109,8 @@ final class LocalServerChannelSink extends AbstractChannelSink { } else if (e instanceof MessageEvent) { MessageEvent event = (MessageEvent) e; DefaultLocalChannel channel = (DefaultLocalChannel) event.getChannel(); - channel.writeBuffer.offer(event); + boolean offered = channel.writeBuffer.offer(event); + assert offered; channel.flushWriteBuffer(); } } diff --git a/src/main/java/org/jboss/netty/channel/socket/nio/NioServerSocketPipelineSink.java b/src/main/java/org/jboss/netty/channel/socket/nio/NioServerSocketPipelineSink.java index 890d62427e..a86b2ebebe 100644 --- a/src/main/java/org/jboss/netty/channel/socket/nio/NioServerSocketPipelineSink.java +++ b/src/main/java/org/jboss/netty/channel/socket/nio/NioServerSocketPipelineSink.java @@ -134,7 +134,8 @@ class NioServerSocketPipelineSink extends AbstractChannelSink { } else if (e instanceof MessageEvent) { MessageEvent event = (MessageEvent) e; NioSocketChannel channel = (NioSocketChannel) event.getChannel(); - channel.writeBuffer.offer(event); + boolean offered = channel.writeBuffer.offer(event); + assert offered; NioWorker.write(channel, true); } } diff --git a/src/main/java/org/jboss/netty/channel/xnio/XnioClientChannelSink.java b/src/main/java/org/jboss/netty/channel/xnio/XnioClientChannelSink.java index 1f22344410..ecad579d33 100644 --- a/src/main/java/org/jboss/netty/channel/xnio/XnioClientChannelSink.java +++ b/src/main/java/org/jboss/netty/channel/xnio/XnioClientChannelSink.java @@ -141,7 +141,8 @@ final class XnioClientChannelSink extends AbstractChannelSink { if (xnioChannel instanceof GatheringByteChannel || xnioChannel instanceof MultipointWritableMessageChannel || xnioChannel instanceof WritableMessageChannel) { - channel.writeBuffer.offer(event); + boolean offered = channel.writeBuffer.offer(event); + assert offered; if (xnioChannel instanceof SuspendableWriteChannel) { ((SuspendableWriteChannel) xnioChannel).resumeWrites(); } diff --git a/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java b/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java index 8d199996f1..b9b6f56bd4 100644 --- a/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java +++ b/src/main/java/org/jboss/netty/handler/codec/http/HttpMessageDecoder.java @@ -53,7 +53,6 @@ public abstract class HttpMessageDecoder extends ReplayingDecoder