Fix inspector warnings

This commit is contained in:
Trustin Lee 2013-02-11 16:52:43 +09:00
parent 6f8a69b956
commit bf0bfe9a69
12 changed files with 53 additions and 45 deletions

View File

@ -18,7 +18,7 @@ package io.netty.buffer;
/**
* An {@link IllegalStateException} raised when a user attempts to access a {@link Buf} which was freed by
* {@link Buf#free()} already.
* {@link Buf#release()} } already.
*/
public class IllegalBufferAccessException extends IllegalStateException {

View File

@ -17,14 +17,17 @@ package io.netty.handler.codec.http.multipart;
import io.netty.buffer.Unpooled;
import io.netty.handler.codec.DecoderResult;
import io.netty.handler.codec.http.*;
import io.netty.handler.codec.http.DefaultHttpContent;
import io.netty.handler.codec.http.DefaultHttpRequest;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpMethod;
import io.netty.handler.codec.http.HttpVersion;
import io.netty.util.CharsetUtil;
import org.junit.Test;
import java.util.Arrays;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
/** {@link HttpPostRequestDecoder} test case. */
public class HttpPostRequestDecoderTest {
@ -42,13 +45,13 @@ public class HttpPostRequestDecoderTest {
final DefaultHttpDataFactory inMemoryFactory = new DefaultHttpDataFactory(false);
for (String data : Arrays.asList("", "\r", "\r\r", "\r\r\r")) {
final String body = ""
+ "--" + boundary + "\r\n" +
"Content-Disposition: form-data; name=\"file\"; filename=\"tmp-0.txt\"\r\n" +
"Content-Type: image/gif\r\n" +
"\r\n" +
data + "\r\n" +
"--" + boundary + "--\r\n";
final String body =
"--" + boundary + "\r\n" +
"Content-Disposition: form-data; name=\"file\"; filename=\"tmp-0.txt\"\r\n" +
"Content-Type: image/gif\r\n" +
"\r\n" +
data + "\r\n" +
"--" + boundary + "--\r\n";
// Create decoder instance to test.
final HttpPostRequestDecoder decoder = new HttpPostRequestDecoder(inMemoryFactory, req);

View File

@ -34,6 +34,6 @@ public class UtilThreadFactory implements ThreadFactory {
@Override
public Thread newThread(final Runnable runnable) {
return new Thread(runnable, name + "-" + counter.getAndIncrement());
return new Thread(runnable, name + '-' + counter.getAndIncrement());
}
}

View File

@ -19,7 +19,6 @@ import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.logging.InternalLogger;
import io.netty.logging.InternalLoggerFactory;
import io.netty.testsuite.transport.sctp.SctpTestPermutation;
import io.netty.testsuite.transport.sctp.SctpTestPermutation.Factory;
import io.netty.testsuite.util.TestUtils;
import io.netty.util.NetUtil;

View File

@ -17,12 +17,12 @@ package io.netty.testsuite.transport.sctp;
import io.netty.bootstrap.Bootstrap;
import io.netty.bootstrap.ServerBootstrap;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.oio.OioEventLoopGroup;
import io.netty.channel.sctp.nio.NioSctpChannel;
import io.netty.channel.sctp.nio.NioSctpServerChannel;
import io.netty.channel.sctp.oio.OioSctpChannel;
import io.netty.channel.sctp.oio.OioSctpServerChannel;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.oio.OioEventLoopGroup;
import io.netty.testsuite.util.TestUtils;
import java.util.ArrayList;
@ -30,8 +30,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
public class SctpTestPermutation {
public final class SctpTestPermutation {
static List<Factory<ServerBootstrap>> sctpServerChannel() {
if (!TestUtils.isSctpSupported()) {

View File

@ -31,19 +31,19 @@ import io.netty.channel.ChannelConfig;
* <tr>
* <th>Name</th><th>Associated setter method</th>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#BAUD_RATE}</td><td>{@link #setBaudrate(int)}</td>
* <td>{@link RxtxChannelOption#BAUD_RATE}</td><td>{@link #setBaudrate(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#DTR}</td><td>{@link #setDtr(boolean)}</td>
* <td>{@link RxtxChannelOption#DTR}</td><td>{@link #setDtr(boolean)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#RTS}</td><td>{@link #setRts(boolean)}</td>
* <td>{@link RxtxChannelOption#RTS}</td><td>{@link #setRts(boolean)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#STOP_BITS}</td><td>{@link #setStopbits(Stopbits)}</td>
* <td>{@link RxtxChannelOption#STOP_BITS}</td><td>{@link #setStopbits(Stopbits)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#DATA_BITS}</td><td>{@link #setDatabits(Databits)}</td>
* <td>{@link RxtxChannelOption#DATA_BITS}</td><td>{@link #setDatabits(Databits)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#PARITY_BIT}</td><td>{@link #setParitybit(Paritybit)}</td>
* <td>{@link RxtxChannelOption#PARITY_BIT}</td><td>{@link #setParitybit(Paritybit)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.rxtx.RxtxChannelOption#WAIT_TIME}</td><td>{@link #setWaitTimeMillis(int)}</td>
* <td>{@link RxtxChannelOption#WAIT_TIME}</td><td>{@link #setWaitTimeMillis(int)}</td>
* </tr>
* </table>
*/

View File

@ -18,8 +18,6 @@ package io.netty.channel.udt;
import io.netty.channel.ServerChannel;
import io.netty.channel.udt.nio.NioUdtProvider;
import java.net.InetSocketAddress;
/**
* UDT {@link ServerChannel}.
* <p>

View File

@ -16,12 +16,10 @@
package io.netty.test.udt.nio;
import static org.junit.Assume.*;
import io.netty.test.udt.util.UnitHelp;
import org.junit.BeforeClass;
import com.barchart.udt.SocketUDT;
import static org.junit.Assume.*;
/**
* Base for UDT tests.

View File

@ -46,13 +46,13 @@ import java.util.Map;
* <tr>
* <th>Name</th><th>Associated setter method</th>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#CONNECT_TIMEOUT_MILLIS}</td><td>{@link #setConnectTimeoutMillis(int)}</td>
* <td>{@link ChannelOption#CONNECT_TIMEOUT_MILLIS}</td><td>{@link #setConnectTimeoutMillis(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#WRITE_SPIN_COUNT}</td><td>{@link #setWriteSpinCount(int)}</td>
* <td>{@link ChannelOption#WRITE_SPIN_COUNT}</td><td>{@link #setWriteSpinCount(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#ALLOCATOR}</td><td>{@link #setAllocator(ByteBufAllocator)}</td>
* <td>{@link ChannelOption#ALLOCATOR}</td><td>{@link #setAllocator(ByteBufAllocator)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#AUTO_READ}</td><td>{@link #setAutoRead(boolean)}</td>
* <td>{@link ChannelOption#AUTO_READ}</td><td>{@link #setAutoRead(boolean)}</td>
* </tr>
* </table>
* <p>

View File

@ -369,6 +369,16 @@ public final class ChannelTaskScheduler {
return unit.convert(delayNanos(), TimeUnit.NANOSECONDS);
}
@Override
public int hashCode() {
return System.identityHashCode(this);
}
@Override
public boolean equals(Object obj) {
return this == obj;
}
@Override
public int compareTo(Delayed o) {
if (this == o) {

View File

@ -17,6 +17,8 @@ package io.netty.channel.socket;
import io.netty.buffer.ByteBufAllocator;
import io.netty.channel.ChannelConfig;
import io.netty.channel.ChannelOption;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.net.StandardSocketOptions;
@ -33,27 +35,27 @@ import java.net.StandardSocketOptions;
* <tr>
* <th>Name</th><th>Associated setter method</th>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_BROADCAST}</td><td>{@link #setBroadcast(boolean)}</td>
* <td>{@link ChannelOption#SO_BROADCAST}</td><td>{@link #setBroadcast(boolean)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#IP_MULTICAST_ADDR}</td><td>{@link #setInterface(InetAddress)}</td>
* <td>{@link ChannelOption#IP_MULTICAST_ADDR}</td><td>{@link #setInterface(InetAddress)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#IP_MULTICAST_LOOP_DISABLED}</td>
* <td>{@link ChannelOption#IP_MULTICAST_LOOP_DISABLED}</td>
* <td>{@link #setLoopbackModeDisabled(boolean)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#IP_MULTICAST_IF}</td>
* <td>{@link ChannelOption#IP_MULTICAST_IF}</td>
* <td>{@link #setNetworkInterface(NetworkInterface)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_REUSEADDR}</td><td>{@link #setReuseAddress(boolean)}</td>
* <td>{@link ChannelOption#SO_REUSEADDR}</td><td>{@link #setReuseAddress(boolean)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
* <td>{@link ChannelOption#SO_RCVBUF}</td><td>{@link #setReceiveBufferSize(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
* <td>{@link ChannelOption#SO_SNDBUF}</td><td>{@link #setSendBufferSize(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#IP_MULTICAST_TTL}</td><td>{@link #setTimeToLive(int)}</td>
* <td>{@link ChannelOption#IP_MULTICAST_TTL}</td><td>{@link #setTimeToLive(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#IP_TOS}</td><td>{@link #setTrafficClass(int)}</td>
* <td>{@link ChannelOption#IP_TOS}</td><td>{@link #setTrafficClass(int)}</td>
* </tr><tr>
* <td>{@link io.netty.channel.ChannelOption#UDP_RECEIVE_PACKET_SIZE}</td><td>{@link #setReceivePacketSize(int)}</td>
* <td>{@link ChannelOption#UDP_RECEIVE_PACKET_SIZE}</td><td>{@link #setReceivePacketSize(int)}</td>
* </tr>
* </table>
*/

View File

@ -17,9 +17,8 @@ package io.netty.channel.nio;
import io.netty.channel.AbstractEventLoopTest;
import io.netty.channel.EventLoopGroup;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.nio.NioServerSocketChannel;
import io.netty.channel.socket.ServerSocketChannel;
import io.netty.channel.socket.nio.NioServerSocketChannel;
public class NioEventLoopTest extends AbstractEventLoopTest {