From be6cc9c3243cb0a70a986e22e6b249426d2ab939 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Fri, 14 Dec 2012 11:23:30 +0900 Subject: [PATCH] Fix inspection warnings --- .../channel/socket/nio/NioEventLoop.java | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/transport/src/main/java/io/netty/channel/socket/nio/NioEventLoop.java b/transport/src/main/java/io/netty/channel/socket/nio/NioEventLoop.java index 970127db15..4335d2ee91 100644 --- a/transport/src/main/java/io/netty/channel/socket/nio/NioEventLoop.java +++ b/transport/src/main/java/io/netty/channel/socket/nio/NioEventLoop.java @@ -14,6 +14,22 @@ * under the License. */ +/* + * Copyright 2012 The Netty Project + * + * The Netty Project licenses this file to you under the Apache License, + * version 2.0 (the "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at: + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations + * under the License. + */ + /* * Copyright 2012 The Netty Project * @@ -144,7 +160,7 @@ public final class NioEventLoop extends SingleThreadEventLoop { } } - void executeWhenWritable(AbstractNioChannel channel, NioTask task) { + void executeWhenWritable(AbstractNioChannel channel, NioTask task) { if (channel == null) { throw new NullPointerException("channel"); } @@ -154,7 +170,7 @@ public final class NioEventLoop extends SingleThreadEventLoop { } SelectionKey key = channel.selectionKey(); - channel.writableTasks.offer((NioTask) task); + channel.writableTasks.offer(task); key.interestOps(key.interestOps() | SelectionKey.OP_WRITE); } @@ -388,7 +404,7 @@ public final class NioEventLoop extends SingleThreadEventLoop { if (ch.writableTasks.isEmpty()) { ch.unsafe().flushNow(); } else { - NioTask task = null; + NioTask task; for (;;) { task = ch.writableTasks.poll(); if (task == null) { break; } @@ -399,7 +415,7 @@ public final class NioEventLoop extends SingleThreadEventLoop { } private static void unregisterWritableTasks(AbstractNioChannel ch) { - NioTask task = null; + NioTask task; for (;;) { task = ch.writableTasks.poll(); if (task == null) {