Fix various Javadoc issues / Do not use argN parameter names

This commit is contained in:
Trustin Lee 2012-11-12 12:26:18 +09:00
parent d92236a124
commit 669fa64829
26 changed files with 58 additions and 225 deletions

View File

@ -15,9 +15,6 @@
*/
package org.jboss.netty.bootstrap;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelConfig;
import org.jboss.netty.channel.ChannelFactory;
@ -28,6 +25,9 @@ import org.jboss.netty.channel.ChannelPipelineException;
import org.jboss.netty.channel.ChannelPipelineFactory;
import org.jboss.netty.channel.Channels;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
/**
* A helper class which creates a new client-side {@link Channel} and makes a
* connection attempt.
@ -233,12 +233,10 @@ public class ClientBootstrap extends Bootstrap {
* Attempts to bind a channel with the specified {@code localAddress}. later the channel can
* be connected to a remoteAddress by calling {@link Channel#connect(SocketAddress)}.This method
* is useful where bind and connect need to be done in separate steps.
*
* This can also be useful if you want to set an attachment to the {@link Channel} via
* {@link Channel#setAttachment(Object)} so you can use it after the {@link #bind(SocketAddress)}
* was done.
* <br>
* For example:
* <p>
* For an instance, a user can set an attachment to the {@link Channel} via
* {@link Channel#setAttachment(Object)} before beginning a connection attempt so that the user can access
* the attachment once the connection is established:
*
* <pre>
* ChannelFuture bindFuture = bootstrap.bind(new InetSocketAddress("192.168.0.15", 0));
@ -246,9 +244,8 @@ public class ClientBootstrap extends Bootstrap {
* channel.setAttachment(dataObj);
* channel.connect(new InetSocketAddress("192.168.0.30", 8080));
* </pre>
* <br>
*
* You can use it then in your handlers like this:
* The attachment can be accessed then in the handler like the following:
*
* <pre>
* public class YourHandler extends SimpleChannelUpstreamHandler {

View File

@ -175,8 +175,12 @@ public class ServerBootstrap extends Bootstrap {
}
/**
* {@inheritDoc}
* Sets the {@link ServerChannelFactory} that will be used to perform an I/O
* operation. This method can be called only once and can't be called at
* all if the factory was specified in the constructor.
*
* @throws IllegalStateException
* if the factory is already set
* @throws IllegalArgumentException
* if the specified {@code factory} is not a
* {@link ServerChannelFactory}

View File

@ -318,7 +318,7 @@ public interface ChannelBuffer extends Comparable<ChannelBuffer> {
* buf.readerIndex(2);
* </pre>
*
* By contrast, {@link #setIndex(int, int)} guarantees that it never
* By contrast, this method guarantees that it never
* throws an {@link IndexOutOfBoundsException} as long as the specified
* indexes meet basic constraints, regardless what the current index
* values of the buffer are:

View File

@ -18,7 +18,7 @@ package org.jboss.netty.channel;
/**
* A {@link RuntimeException} which is thrown when an I/O operation fails.
*
* @apiviz.hidden
* @apiviz.exclude
*/
public class ChannelException extends RuntimeException {

View File

@ -20,7 +20,7 @@ package org.jboss.netty.channel;
* {@link LifeCycleAwareChannelHandler} throws an {@link Exception}
* in its handler methods.
*
* @apiviz.hidden
* @apiviz.exclude
*/
public class ChannelHandlerLifeCycleException extends RuntimeException {

View File

@ -20,7 +20,7 @@ package org.jboss.netty.channel;
* failed to process a {@link ChannelEvent} or when a {@link ChannelPipelineFactory}
* failed to initialize a {@link ChannelPipeline}.
*
* @apiviz.hidden
* @apiviz.exclude
*/
public class ChannelPipelineException extends ChannelException {

View File

@ -188,8 +188,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
/**
* Start the {@link AbstractNioWorker} and return the {@link Selector} that will be used for
* the {@link AbstractNioChannel}'s when they get registered
*
* @return selector
*/
private void openSelector() {
try {
@ -918,10 +916,6 @@ abstract class AbstractNioWorker implements Worker, ExternalResourceReleasable {
/**
* Create a new {@link Runnable} which will register the {@link AbstractNioWorker} with the {@link Channel}
*
* @param channel
* @param future
* @return task
*/
protected abstract Runnable createRegisterTask(AbstractNioChannel<?> channel, ChannelFuture future);

View File

@ -214,8 +214,6 @@ public class HttpUploadServerHandler extends SimpleChannelUpstreamHandler {
/**
* Example of reading all InterfaceHttpData from finished transfer
*
* @param channel
*/
private void readHttpDataAllReceive(Channel channel) {
List<InterfaceHttpData> datas = null;
@ -238,8 +236,6 @@ public class HttpUploadServerHandler extends SimpleChannelUpstreamHandler {
/**
* Example of reading request by chunk and getting values from chunk to
* chunk
*
* @param channel
*/
private void readHttpDataChunkByChunk(Channel channel) {
try {

View File

@ -19,7 +19,7 @@ package org.jboss.netty.handler.codec.frame;
* An {@link Exception} which is thrown when the received frame data can not
* be decoded by a {@link FrameDecoder} implementation.
*
* @apiviz.hidden
* @apiviz.exclude
*/
public class CorruptedFrameException extends Exception {

View File

@ -19,7 +19,7 @@ package org.jboss.netty.handler.codec.frame;
* An {@link Exception} which is thrown when the length of the frame
* decoded is greater than the maximum.
*
* @apiviz.hidden
* @apiviz.exclude
*/
public class TooLongFrameException extends Exception {

View File

@ -68,9 +68,7 @@ public abstract class AbstractDiskHttpData extends AbstractHttpData {
protected abstract boolean deleteOnExit();
/**
*
* @return a new Temp File from getDiskFilename(), default prefix, postfix and baseDirectory
* @throws IOException
*/
private File tempFile() throws IOException {
String newpostfix = null;
@ -317,9 +315,7 @@ public abstract class AbstractDiskHttpData extends AbstractHttpData {
/**
* Utility function
* @param src
* @return the array of bytes
* @throws IOException
*/
private static byte[] readFrom(File src) throws IOException {
long srcsize = src.length();

View File

@ -28,7 +28,6 @@ public interface Attribute extends HttpData {
/**
* Sets the value of this HttpData.
* @param value
*/
void setValue(String value) throws IOException;
}

View File

@ -60,7 +60,6 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
/**
* HttpData will be always on Disk if useDisk is True, else always in Memory if False
* @param useDisk
*/
public DefaultHttpDataFactory(boolean useDisk) {
this.useDisk = useDisk;
@ -70,7 +69,6 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
/**
* HttpData will be on Disk if the size of the file is greater than minSize, else it
* will be in memory. The type will be Mixed.
* @param minSize
*/
public DefaultHttpDataFactory(long minSize) {
useDisk = false;
@ -79,8 +77,6 @@ public class DefaultHttpDataFactory implements HttpDataFactory {
}
/**
*
* @param request
* @return the associated list of Files for the request
*/
private List<HttpData> getList(HttpRequest request) {

View File

@ -35,19 +35,10 @@ public class DiskAttribute extends AbstractDiskHttpData implements Attribute {
/**
* Constructor used for huge Attribute
* @param name
*/
public DiskAttribute(String name) {
super(name, HttpConstants.DEFAULT_CHARSET, 0);
}
/**
*
* @param name
* @param value
* @throws NullPointerException
* @throws IllegalArgumentException
* @throws IOException
*/
public DiskAttribute(String name, String value) throws IOException {
super(name, HttpConstants.DEFAULT_CHARSET, 0); // Attribute have no default size
setValue(value);

View File

@ -30,7 +30,6 @@ public interface FileUpload extends HttpData {
/**
* Set the original filename
* @param filename
*/
void setFilename(String filename);
@ -48,7 +47,6 @@ public interface FileUpload extends HttpData {
/**
* Set the Content-Transfer-Encoding type from String as 7bit, 8bit or binary
* @param contentTransferEncoding
*/
void setContentTransferEncoding(String contentTransferEncoding);

View File

@ -15,13 +15,13 @@
*/
package org.jboss.netty.handler.codec.http.multipart;
import org.jboss.netty.buffer.ChannelBuffer;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.charset.Charset;
import org.jboss.netty.buffer.ChannelBuffer;
/**
* Extended interface for InterfaceHttpData
*/
@ -105,10 +105,8 @@ public interface HttpData extends InterfaceHttpData {
* read. Once it arrives at the end, it returns an EMPTY_BUFFER and it
* resets the current position to 0.
*
* @param length
* @return a ChannelBuffer for the content from the current position or an
* EMPTY_BUFFER if there is no more data to return
* @throws IOException
*/
ChannelBuffer getChunk(int length) throws IOException;
@ -118,7 +116,6 @@ public interface HttpData extends InterfaceHttpData {
*
* @return the contents of the file item as a String, using the default
* character encoding.
* @exception IOException
*/
String getString() throws IOException;

View File

@ -15,10 +15,10 @@
*/
package org.jboss.netty.handler.codec.http.multipart;
import java.nio.charset.Charset;
import org.jboss.netty.handler.codec.http.HttpRequest;
import java.nio.charset.Charset;
/**
* Interface to enable creation of InterfaceHttpData objects
*/
@ -26,31 +26,19 @@ public interface HttpDataFactory {
/**
*
* @param request associated request
* @param name
* @return a new Attribute with no value
* @throws NullPointerException
* @throws IllegalArgumentException
*/
Attribute createAttribute(HttpRequest request, String name);
/**
*
* @param request associated request
* @param name
* @param value
* @return a new Attribute
* @throws NullPointerException
* @throws IllegalArgumentException
*/
Attribute createAttribute(HttpRequest request, String name, String value);
/**
*
* @param request associated request
* @param name
* @param filename
* @param contentType
* @param charset
* @param size the size of the Uploaded file
* @return a new FileUpload
*/
@ -62,7 +50,6 @@ public interface HttpDataFactory {
* Remove the given InterfaceHttpData from clean list (will not delete the file, except if the file
* is still a temporary one as setup at construction)
* @param request associated request
* @param data
*/
void removeHttpDataFromClean(HttpRequest request, InterfaceHttpData data);

View File

@ -140,9 +140,6 @@ final class HttpPostBodyUtil {
int limit;
ChannelBuffer buffer;
/**
* @param buffer
*/
SeekAheadOptimize(ChannelBuffer buffer) throws SeekAheadNoBackArrayException {
if (!buffer.hasArray()) {
throw new SeekAheadNoBackArrayException();
@ -155,7 +152,6 @@ final class HttpPostBodyUtil {
}
/**
*
* @param minus this value will be used as (currentPos - minus) to set
* the current readerIndex in the buffer.
*/
@ -185,8 +181,6 @@ final class HttpPostBodyUtil {
/**
* Find the first non whitespace
* @param sb
* @param offset
* @return the rank of the first non whitespace
*/
static int findNonWhitespace(String sb, int offset) {
@ -201,8 +195,6 @@ final class HttpPostBodyUtil {
/**
* Find the first whitespace
* @param sb
* @param offset
* @return the rank of the first whitespace
*/
static int findWhitespace(String sb, int offset) {
@ -217,7 +209,6 @@ final class HttpPostBodyUtil {
/**
* Find the end of String
* @param sb
* @return the rank of the end of string
*/
static int findEndOfString(String sb) {

View File

@ -249,8 +249,6 @@ public class HttpPostRequestDecoder {
/**
* Check from the request ContentType if this request is a Multipart request.
* @param contentType
* @throws ErrorDataDecoderException
*/
private void checkMultipart(String contentType)
throws ErrorDataDecoderException {
@ -260,7 +258,7 @@ public class HttpPostRequestDecoder {
HttpHeaders.Values.MULTIPART_FORM_DATA) &&
headerContentType[1].toLowerCase().startsWith(
HttpHeaders.Values.BOUNDARY)) {
String[] boundary = headerContentType[1].split("=");
String[] boundary = StringUtil.split(headerContentType[1], '=');
if (boundary.length != 2) {
throw new ErrorDataDecoderException("Needs a boundary value");
}
@ -303,7 +301,6 @@ public class HttpPostRequestDecoder {
* If chunked, all chunks must have been offered using offer() method.
* If not, NotEnoughDataDecoderException will be raised.
* @param name
* @return All Body HttpDatas with the given name (ignore case)
* @throws NotEnoughDataDecoderException need more chunks
*/
@ -321,7 +318,6 @@ public class HttpPostRequestDecoder {
* If chunked, all chunks must have been offered using offer() method.
* If not, NotEnoughDataDecoderException will be raised.
*
* @param name
* @return The first Body InterfaceHttpData with the given name (ignore case)
* @throws NotEnoughDataDecoderException need more chunks
*/
@ -413,7 +409,6 @@ public class HttpPostRequestDecoder {
/**
* Utility function to add a new decoded data
* @param data
*/
private void addHttpData(InterfaceHttpData data) {
if (data == null) {
@ -695,10 +690,7 @@ public class HttpPostRequestDecoder {
/**
* Decode component
* @param s
* @param charset
* @return the decoded component
* @throws ErrorDataDecoderException
*/
private static String decodeAttribute(String s, Charset charset)
throws ErrorDataDecoderException {
@ -747,7 +739,6 @@ public class HttpPostRequestDecoder {
*
* Inspired from HttpMessageDecoder
*
* @param state
* @return the next decoded InterfaceHttpData or null if none until now.
* @throws ErrorDataDecoderException if an error occurs
*/
@ -1493,7 +1484,6 @@ public class HttpPostRequestDecoder {
/**
* Read a FileUpload data as Byte (Binary) and add the bytes directly to the
* FileUpload. If the delimiter is found, the FileUpload is completed.
* @param delimiter
* @throws NotEnoughDataDecoderException Need more chunks but
* do not reset the readerInder since some values will be already added to the FileOutput
* @throws ErrorDataDecoderException write IO error occurs with the FileUpload
@ -1587,7 +1577,6 @@ public class HttpPostRequestDecoder {
/**
* Read a FileUpload data as Byte (Binary) and add the bytes directly to the
* FileUpload. If the delimiter is found, the FileUpload is completed.
* @param delimiter
* @throws NotEnoughDataDecoderException Need more chunks but
* do not reset the readerInder since some values will be already added to the FileOutput
* @throws ErrorDataDecoderException write IO error occurs with the FileUpload
@ -1943,7 +1932,6 @@ public class HttpPostRequestDecoder {
/**
* Split the very first line (Content-Type value) in 2 Strings
* @param sb
* @return the array of 2 Strings
*/
private static String[] splitHeaderContentType(String sb) {
@ -1968,7 +1956,6 @@ public class HttpPostRequestDecoder {
/**
* Split one header in Multipart
* @param sb
* @return an array of String where rank 0 is the name of the header, follows by several
* values that were separated by ';' or ','
*/
@ -2017,35 +2004,21 @@ public class HttpPostRequestDecoder {
* data are available (need more chunks)
*/
public static class NotEnoughDataDecoderException extends Exception {
/**
*/
private static final long serialVersionUID = -7846841864603865638L;
/**
*/
public NotEnoughDataDecoderException() {
}
/**
* @param arg0
*/
public NotEnoughDataDecoderException(String arg0) {
super(arg0);
public NotEnoughDataDecoderException(String msg) {
super(msg);
}
/**
* @param arg0
*/
public NotEnoughDataDecoderException(Throwable arg0) {
super(arg0);
public NotEnoughDataDecoderException(Throwable cause) {
super(cause);
}
/**
* @param arg0
* @param arg1
*/
public NotEnoughDataDecoderException(String arg0, Throwable arg1) {
super(arg0, arg1);
public NotEnoughDataDecoderException(String msg, Throwable cause) {
super(msg, cause);
}
}
@ -2053,45 +2026,28 @@ public class HttpPostRequestDecoder {
* Exception when the body is fully decoded, even if there is still data
*/
public static class EndOfDataDecoderException extends Exception {
/**
*/
private static final long serialVersionUID = 1336267941020800769L;
}
/**
* Exception when an error occurs while decoding
*/
public static class ErrorDataDecoderException extends Exception {
/**
*/
private static final long serialVersionUID = 5020247425493164465L;
/**
*/
public ErrorDataDecoderException() {
}
/**
* @param arg0
*/
public ErrorDataDecoderException(String arg0) {
super(arg0);
public ErrorDataDecoderException(String msg) {
super(msg);
}
/**
* @param arg0
*/
public ErrorDataDecoderException(Throwable arg0) {
super(arg0);
public ErrorDataDecoderException(Throwable cause) {
super(cause);
}
/**
* @param arg0
* @param arg1
*/
public ErrorDataDecoderException(String arg0, Throwable arg1) {
super(arg0, arg1);
public ErrorDataDecoderException(String msg, Throwable cause) {
super(msg, cause);
}
}
@ -2099,35 +2055,21 @@ public class HttpPostRequestDecoder {
* Exception when an unappropriated method was called on a request
*/
public static class IncompatibleDataDecoderException extends Exception {
/**
*/
private static final long serialVersionUID = -953268047926250267L;
/**
*/
public IncompatibleDataDecoderException() {
}
/**
* @param arg0
*/
public IncompatibleDataDecoderException(String arg0) {
super(arg0);
public IncompatibleDataDecoderException(String msg) {
super(msg);
}
/**
* @param arg0
*/
public IncompatibleDataDecoderException(Throwable arg0) {
super(arg0);
public IncompatibleDataDecoderException(Throwable cause) {
super(cause);
}
/**
* @param arg0
* @param arg1
*/
public IncompatibleDataDecoderException(String arg0, Throwable arg1) {
super(arg0, arg1);
public IncompatibleDataDecoderException(String msg, Throwable cause) {
super(msg, cause);
}
}
}

View File

@ -224,7 +224,6 @@ public class HttpPostRequestEncoder implements ChunkedInput {
/**
* Set the Body HttpDatas list
* @param datas
* @throws NullPointerException for datas
* @throws ErrorDataEncoderException if the encoding is in error or if the finalize were already done
*/
@ -323,7 +322,6 @@ public class HttpPostRequestEncoder implements ChunkedInput {
/**
* Add the InterfaceHttpData to the Body list
* @param data
* @throws NullPointerException for data
* @throws ErrorDataEncoderException if the encoding is in error or if the finalize were already done
*/
@ -660,8 +658,6 @@ public class HttpPostRequestEncoder implements ChunkedInput {
/**
* Encode one attribute
* @param s
* @param charset
* @return the encoded attribute
* @throws ErrorDataEncoderException if the encoding is in error
*/
@ -954,35 +950,21 @@ public class HttpPostRequestEncoder implements ChunkedInput {
* Exception when an error occurs while encoding
*/
public static class ErrorDataEncoderException extends Exception {
/**
*/
private static final long serialVersionUID = 5020247425493164465L;
/**
*/
public ErrorDataEncoderException() {
}
/**
* @param arg0
*/
public ErrorDataEncoderException(String arg0) {
super(arg0);
public ErrorDataEncoderException(String msg) {
super(msg);
}
/**
* @param arg0
*/
public ErrorDataEncoderException(Throwable arg0) {
super(arg0);
public ErrorDataEncoderException(Throwable cause) {
super(cause);
}
/**
* @param arg0
* @param arg1
*/
public ErrorDataEncoderException(String arg0, Throwable arg1) {
super(arg0, arg1);
public ErrorDataEncoderException(String msg, Throwable cause) {
super(msg, cause);
}
}
}

View File

@ -29,14 +29,7 @@ public class MemoryAttribute extends AbstractMemoryHttpData implements Attribute
public MemoryAttribute(String name) {
super(name, HttpConstants.DEFAULT_CHARSET, 0);
}
/**
*
* @param name
* @param value
* @throws NullPointerException
* @throws IllegalArgumentException
* @throws IOException
*/
public MemoryAttribute(String name, String value) throws IOException {
super(name, HttpConstants.DEFAULT_CHARSET, 0); // Attribute have no default size
setValue(value);
@ -85,12 +78,12 @@ public class MemoryAttribute extends AbstractMemoryHttpData implements Attribute
return getName().equalsIgnoreCase(attribute.getName());
}
public int compareTo(InterfaceHttpData arg0) {
if (!(arg0 instanceof Attribute)) {
public int compareTo(InterfaceHttpData other) {
if (!(other instanceof Attribute)) {
throw new ClassCastException("Cannot compare " + getHttpDataType() +
" with " + arg0.getHttpDataType());
" with " + other.getHttpDataType());
}
return compareTo((Attribute) arg0);
return compareTo((Attribute) other);
}
public int compareTo(Attribute o) {

View File

@ -29,10 +29,6 @@ public class CIDR4 extends CIDR {
/** The integer for the end address */
private final int addressEndInt;
/**
* @param newaddr
* @param mask
*/
protected CIDR4(Inet4Address newaddr, int mask) {
cidrMask = mask;
addressInt = ipv4AddressToInt(newaddr);

View File

@ -36,10 +36,6 @@ public class CIDR6 extends CIDR {
/** The big integer for the end address */
private final BigInteger addressEndBigInt;
/**
* @param newaddress
* @param newmask
*/
protected CIDR6(Inet6Address newaddress, int newmask) {
cidrMask = newmask;
addressBigInt = ipv6AddressToBigInteger(newaddress);

View File

@ -112,8 +112,6 @@ public class SslBufferPool {
/**
* Release a previous acquired {@link ByteBuffer}
*
* @param buffer
*/
public synchronized void releaseBuffer(ByteBuffer buffer) {
if (index < maxBufferCount) {
@ -122,10 +120,7 @@ public class SslBufferPool {
}
/**
* Will get removed. Please use {@link #releaseBuffer(ByteBuffer)}
*
* @deprecated
*
* @deprecated Use {@link #releaseBuffer(ByteBuffer)}
*/
@Deprecated
void release(ByteBuffer buffer) {

View File

@ -266,10 +266,6 @@ public abstract class AbstractTrafficShapingHandler extends
/**
* Change the underlying limitations and check interval.
*
* @param newWriteLimit
* @param newReadLimit
* @param newCheckInterval
*/
public void configure(long newWriteLimit, long newReadLimit,
long newCheckInterval) {
@ -279,9 +275,6 @@ public abstract class AbstractTrafficShapingHandler extends
/**
* Change the underlying limitations.
*
* @param newWriteLimit
* @param newReadLimit
*/
public void configure(long newWriteLimit, long newReadLimit) {
writeLimit = newWriteLimit;
@ -293,8 +286,6 @@ public abstract class AbstractTrafficShapingHandler extends
/**
* Change the check interval.
*
* @param newCheckInterval
*/
public void configure(long newCheckInterval) {
checkInterval = newCheckInterval;

View File

@ -15,15 +15,15 @@
*/
package org.jboss.netty.handler.traffic;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import org.jboss.netty.channel.ChannelHandlerContext;
import org.jboss.netty.util.Timeout;
import org.jboss.netty.util.Timer;
import org.jboss.netty.util.TimerTask;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
/**
* TrafficCounter is associated with {@link AbstractTrafficShapingHandler}.<br>
* <br>
@ -135,10 +135,6 @@ public class TrafficCounter {
*/
private final TrafficCounter counter;
/**
* @param trafficShapingHandler
* @param counter
*/
protected TrafficMonitoringTask(
AbstractTrafficShapingHandler trafficShapingHandler,
TrafficCounter counter) {
@ -199,8 +195,6 @@ public class TrafficCounter {
/**
* Reset the accounting on Read and Write
*
* @param newLastTime
*/
void resetAccounting(long newLastTime) {
synchronized (lastTime) {
@ -241,8 +235,6 @@ public class TrafficCounter {
/**
* Change checkInterval between
* two computations in millisecond
*
* @param newcheckInterval
*/
public void configure(long newcheckInterval) {
long newInterval = newcheckInterval / 10 * 10;