Fix more inspector warnings introduced by recent mergences
This commit is contained in:
parent
6208c62888
commit
00c4b944e4
|
@ -73,7 +73,7 @@ public abstract class SocksMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte getByteValue() {
|
public byte getByteValue() {
|
||||||
return this.b;
|
return b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ public abstract class SocksMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte getByteValue() {
|
public byte getByteValue() {
|
||||||
return this.b;
|
return b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ public abstract class SocksMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte getByteValue() {
|
public byte getByteValue() {
|
||||||
return this.b;
|
return b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ public abstract class SocksMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte getByteValue() {
|
public byte getByteValue() {
|
||||||
return this.b;
|
return b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ public abstract class SocksMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte getByteValue() {
|
public byte getByteValue() {
|
||||||
return this.b;
|
return b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ public abstract class SocksMessage {
|
||||||
}
|
}
|
||||||
|
|
||||||
public byte getByteValue() {
|
public byte getByteValue() {
|
||||||
return this.b;
|
return b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,13 @@ package io.netty.codec.socks;
|
||||||
|
|
||||||
import io.netty.channel.embedded.EmbeddedByteChannel;
|
import io.netty.channel.embedded.EmbeddedByteChannel;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
public class SocksAuthRequestDecoderTest {
|
public class SocksAuthRequestDecoderTest {
|
||||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(SocksAuthRequestDecoderTest.class);
|
private static final Logger logger = LoggerFactory.getLogger(SocksAuthRequestDecoderTest.class);
|
||||||
@Test
|
@Test
|
||||||
public void testAuthRequestDecoder() {
|
public void testAuthRequestDecoder() {
|
||||||
String username = "test";
|
String username = "test";
|
||||||
|
|
|
@ -17,12 +17,13 @@ package io.netty.codec.socks;
|
||||||
|
|
||||||
import io.netty.channel.embedded.EmbeddedByteChannel;
|
import io.netty.channel.embedded.EmbeddedByteChannel;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
public class SocksAuthResponseDecoderTest {
|
public class SocksAuthResponseDecoderTest {
|
||||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(SocksAuthResponseDecoderTest.class);
|
private static final Logger logger = LoggerFactory.getLogger(SocksAuthResponseDecoderTest.class);
|
||||||
private static void testSocksAuthResponseDecoderWithDifferentParams(SocksMessage.AuthStatus authStatus){
|
private static void testSocksAuthResponseDecoderWithDifferentParams(SocksMessage.AuthStatus authStatus){
|
||||||
logger.debug("Testing SocksAuthResponseDecoder with authStatus: "+ authStatus);
|
logger.debug("Testing SocksAuthResponseDecoder with authStatus: "+ authStatus);
|
||||||
SocksAuthResponse msg = new SocksAuthResponse(authStatus);
|
SocksAuthResponse msg = new SocksAuthResponse(authStatus);
|
||||||
|
|
|
@ -17,13 +17,14 @@ package io.netty.codec.socks;
|
||||||
|
|
||||||
import io.netty.channel.embedded.EmbeddedByteChannel;
|
import io.netty.channel.embedded.EmbeddedByteChannel;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import sun.net.util.IPAddressUtil;
|
import sun.net.util.IPAddressUtil;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
public class SocksCmdRequestDecoderTest {
|
public class SocksCmdRequestDecoderTest {
|
||||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(SocksCmdRequestDecoderTest.class);
|
private static final Logger logger = LoggerFactory.getLogger(SocksCmdRequestDecoderTest.class);
|
||||||
|
|
||||||
private static void testSocksCmdRequestDecoderWithDifferentParams(SocksMessage.CmdType cmdType, SocksMessage.AddressType addressType, String host, int port) {
|
private static void testSocksCmdRequestDecoderWithDifferentParams(SocksMessage.CmdType cmdType, SocksMessage.AddressType addressType, String host, int port) {
|
||||||
logger.debug("Testing cmdType: " + cmdType + " addressType: " + addressType + " host: " + host + " port: " + port);
|
logger.debug("Testing cmdType: " + cmdType + " addressType: " + addressType + " host: " + host + " port: " + port);
|
||||||
|
|
|
@ -17,12 +17,13 @@ package io.netty.codec.socks;
|
||||||
|
|
||||||
import io.netty.channel.embedded.EmbeddedByteChannel;
|
import io.netty.channel.embedded.EmbeddedByteChannel;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import static org.junit.Assert.*;
|
import static org.junit.Assert.*;
|
||||||
|
|
||||||
public class SocksCmdResponseDecoderTest {
|
public class SocksCmdResponseDecoderTest {
|
||||||
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(SocksCmdResponseDecoderTest.class);
|
private static final Logger logger = LoggerFactory.getLogger(SocksCmdResponseDecoderTest.class);
|
||||||
|
|
||||||
private static void testSocksCmdResponseDecoderWithDifferentParams(SocksMessage.CmdStatus cmdStatus, SocksMessage.AddressType addressType){
|
private static void testSocksCmdResponseDecoderWithDifferentParams(SocksMessage.CmdStatus cmdStatus, SocksMessage.AddressType addressType){
|
||||||
logger.debug("Testing cmdStatus: " + cmdStatus + " addressType: " + addressType);
|
logger.debug("Testing cmdStatus: " + cmdStatus + " addressType: " + addressType);
|
||||||
|
|
|
@ -19,7 +19,7 @@ import io.netty.buffer.ByteBuf;
|
||||||
import io.netty.buffer.Unpooled;
|
import io.netty.buffer.Unpooled;
|
||||||
import io.netty.channel.embedded.EmbeddedByteChannel;
|
import io.netty.channel.embedded.EmbeddedByteChannel;
|
||||||
|
|
||||||
class SocksCommonTestUtils {
|
final class SocksCommonTestUtils {
|
||||||
/**
|
/**
|
||||||
* A constructor to stop this class being constructed.
|
* A constructor to stop this class being constructed.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -208,7 +208,7 @@ public class DelimiterBasedFrameDecoder extends ByteToMessageDecoder<Object> {
|
||||||
* Return {@code true} if the current instance is a subclass of DelimiterBasedFrameDecoder
|
* Return {@code true} if the current instance is a subclass of DelimiterBasedFrameDecoder
|
||||||
*/
|
*/
|
||||||
private boolean isSubclass() {
|
private boolean isSubclass() {
|
||||||
return this.getClass() != DelimiterBasedFrameDecoder.class;
|
return getClass() != DelimiterBasedFrameDecoder.class;
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
|
public Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
|
||||||
|
|
|
@ -71,7 +71,7 @@ public final class SocksServerHandler extends ChannelInboundMessageHandlerAdapte
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx, Throwable throwable) throws Exception {
|
public void exceptionCaught(ChannelHandlerContext ctx, Throwable throwable) throws Exception {
|
||||||
throwable.printStackTrace();
|
throwable.printStackTrace();
|
||||||
SocksServerUtils.closeOnFlush(ctx.channel());
|
SocksServerUtils.closeOnFlush(ctx.channel());
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,17 +71,17 @@ public class DefaultChannelPipelineTest {
|
||||||
final String prefixX = "x";
|
final String prefixX = "x";
|
||||||
for (int i = 0; i < handlerNum; i++) {
|
for (int i = 0; i < handlerNum; i++) {
|
||||||
if (i % 2 == 0) {
|
if (i % 2 == 0) {
|
||||||
pipeline.addFirst(prefixX + String.valueOf(i), handlers1[i]);
|
pipeline.addFirst(prefixX + i, handlers1[i]);
|
||||||
} else {
|
} else {
|
||||||
pipeline.addLast(prefixX + String.valueOf(i), handlers1[i]);
|
pipeline.addLast(prefixX + i, handlers1[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < handlerNum; i++) {
|
for (int i = 0; i < handlerNum; i++) {
|
||||||
if (i % 2 != 0) {
|
if (i % 2 != 0) {
|
||||||
pipeline.addBefore(prefixX + String.valueOf(i), String.valueOf(i), handlers2[i]);
|
pipeline.addBefore(prefixX + i, String.valueOf(i), handlers2[i]);
|
||||||
} else {
|
} else {
|
||||||
pipeline.addAfter(prefixX + String.valueOf(i), String.valueOf(i), handlers2[i]);
|
pipeline.addAfter(prefixX + i, String.valueOf(i), handlers2[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -115,7 +115,7 @@ public class DefaultChannelPipelineTest {
|
||||||
verifyContextNumber(pipeline, 8);
|
verifyContextNumber(pipeline, 8);
|
||||||
}
|
}
|
||||||
|
|
||||||
private int next(DefaultChannelHandlerContext ctx) {
|
private static int next(DefaultChannelHandlerContext ctx) {
|
||||||
DefaultChannelHandlerContext next = ctx.next;
|
DefaultChannelHandlerContext next = ctx.next;
|
||||||
if (next == null) {
|
if (next == null) {
|
||||||
return Integer.MAX_VALUE;
|
return Integer.MAX_VALUE;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user