From 7254a5c2c66a34ae2f0f0f776c679668d27ff88f Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Sun, 14 Jul 2013 16:02:03 +0200 Subject: [PATCH] Just some tiny javadocs optimizations --- .../java/io/netty/buffer/SwappedByteBuf.java | 3 + .../netty/util/concurrent/CompleteFuture.java | 3 + .../util/concurrent/CompletePromise.java | 84 ------------------- .../concurrent/DefaultEventExecutorGroup.java | 9 ++ 4 files changed, 15 insertions(+), 84 deletions(-) delete mode 100644 common/src/main/java/io/netty/util/concurrent/CompletePromise.java diff --git a/buffer/src/main/java/io/netty/buffer/SwappedByteBuf.java b/buffer/src/main/java/io/netty/buffer/SwappedByteBuf.java index 9ebdc11111..9e1627abbd 100644 --- a/buffer/src/main/java/io/netty/buffer/SwappedByteBuf.java +++ b/buffer/src/main/java/io/netty/buffer/SwappedByteBuf.java @@ -24,6 +24,9 @@ import java.nio.channels.GatheringByteChannel; import java.nio.channels.ScatteringByteChannel; import java.nio.charset.Charset; +/** + * Wrapper which swap the {@link ByteOrder} of a {@link ByteBuf}. + */ public final class SwappedByteBuf extends ByteBuf { private final ByteBuf buf; diff --git a/common/src/main/java/io/netty/util/concurrent/CompleteFuture.java b/common/src/main/java/io/netty/util/concurrent/CompleteFuture.java index d9c6a091f9..84376233dd 100644 --- a/common/src/main/java/io/netty/util/concurrent/CompleteFuture.java +++ b/common/src/main/java/io/netty/util/concurrent/CompleteFuture.java @@ -34,6 +34,9 @@ public abstract class CompleteFuture extends AbstractFuture { this.executor = executor; } + /** + * Return the {@link EventExecutor} which is used by this {@link CompleteFuture}. + */ protected EventExecutor executor() { return executor; } diff --git a/common/src/main/java/io/netty/util/concurrent/CompletePromise.java b/common/src/main/java/io/netty/util/concurrent/CompletePromise.java deleted file mode 100644 index c5eb8db2a9..0000000000 --- a/common/src/main/java/io/netty/util/concurrent/CompletePromise.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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. - */ -package io.netty.util.concurrent; - - -public abstract class CompletePromise extends CompleteFuture implements Promise { - - protected CompletePromise(EventExecutor executor) { - super(executor); - } - - @Override - public Promise setFailure(Throwable cause) { - throw new IllegalStateException(); - } - - @Override - public boolean tryFailure(Throwable cause) { - return false; - } - - @Override - public Promise setSuccess(V result) { - throw new IllegalStateException(); - } - - @Override - public boolean trySuccess(V result) { - return false; - } - - @Override - public Promise await() throws InterruptedException { - return this; - } - - @Override - public Promise awaitUninterruptibly() { - return this; - } - - @Override - public Promise syncUninterruptibly() { - return this; - } - - @Override - public Promise sync() throws InterruptedException { - return this; - } - - @Override - public Promise addListener(GenericFutureListener> listener) { - return (Promise) super.addListener(listener); - } - - @Override - public Promise addListeners(GenericFutureListener>... listeners) { - return (Promise) super.addListeners(listeners); - } - - @Override - public Promise removeListener(GenericFutureListener> listener) { - return (Promise) super.removeListener(listener); - } - - @Override - public Promise removeListeners(GenericFutureListener>... listeners) { - return (Promise) super.removeListeners(listeners); - } -} diff --git a/common/src/main/java/io/netty/util/concurrent/DefaultEventExecutorGroup.java b/common/src/main/java/io/netty/util/concurrent/DefaultEventExecutorGroup.java index c81137c177..faf88a0b8b 100644 --- a/common/src/main/java/io/netty/util/concurrent/DefaultEventExecutorGroup.java +++ b/common/src/main/java/io/netty/util/concurrent/DefaultEventExecutorGroup.java @@ -23,10 +23,19 @@ import java.util.concurrent.ThreadFactory; */ public class DefaultEventExecutorGroup extends MultithreadEventExecutorGroup { + /** + * @see {@link #DefaultEventExecutorGroup(int, ThreadFactory)} + */ public DefaultEventExecutorGroup(int nThreads) { this(nThreads, null); } + /** + * Create a new instance. + * + * @param nThreads the number of threads that will be used by this instance. + * @param threadFactory the ThreadFactory to use, or {@code null} if the default should be used. + */ public DefaultEventExecutorGroup(int nThreads, ThreadFactory threadFactory) { super(nThreads, threadFactory); }