diff --git a/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java b/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java index 389636476e..e9e6b34877 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java +++ b/codec-http/src/main/java/io/netty/handler/codec/http/multipart/HttpPostMultipartRequestDecoder.java @@ -1316,7 +1316,6 @@ public class HttpPostMultipartRequestDecoder implements InterfaceHttpPostRequest found = true; break; } - continue; } else { newLine = false; index = 0; @@ -1432,7 +1431,6 @@ public class HttpPostMultipartRequestDecoder implements InterfaceHttpPostRequest found = true; break; } - continue; } else { newLine = false; index = 0; @@ -1538,7 +1536,6 @@ public class HttpPostMultipartRequestDecoder implements InterfaceHttpPostRequest found = true; break; } - continue; } else { newLine = false; index = 0; @@ -1654,7 +1651,6 @@ public class HttpPostMultipartRequestDecoder implements InterfaceHttpPostRequest found = true; break; } - continue; } else { newLine = false; index = 0; @@ -1738,7 +1734,7 @@ public class HttpPostMultipartRequestDecoder implements InterfaceHttpPostRequest * * @return the cleaned String */ - @SuppressWarnings("IfStatementWithIdenticalBranches") + @SuppressWarnings("StatementWithEmptyBody") private static String cleanString(String field) { StringBuilder sb = new StringBuilder(field.length()); for (int i = 0; i < field.length(); i++) { diff --git a/common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java b/common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java index da381a2603..e7099d792f 100644 --- a/common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java +++ b/common/src/main/java/io/netty/util/internal/NativeLibraryLoader.java @@ -267,8 +267,7 @@ public final class NativeLibraryLoader { try { // Invoke the helper to load the native library, if succeed, then the native // library belong to the specified ClassLoader. - Method method = helper.getMethod("loadLibrary", - new Class[] { String.class, boolean.class }); + Method method = helper.getMethod("loadLibrary", String.class, boolean.class); method.setAccessible(true); return method.invoke(null, name, absolute); } catch (Exception e) { diff --git a/common/src/main/java/io/netty/util/internal/ObjectUtil.java b/common/src/main/java/io/netty/util/internal/ObjectUtil.java index 50212c7232..1ab39c4c77 100644 --- a/common/src/main/java/io/netty/util/internal/ObjectUtil.java +++ b/common/src/main/java/io/netty/util/internal/ObjectUtil.java @@ -95,7 +95,7 @@ public final class ObjectUtil { * @return the primitive value */ public static int intValue(Integer wrapper, int defaultValue) { - return wrapper != null ? wrapper.intValue() : defaultValue; + return wrapper != null ? wrapper : defaultValue; } /** @@ -105,6 +105,6 @@ public final class ObjectUtil { * @return the primitive value */ public static long longValue(Long wrapper, long defaultValue) { - return wrapper != null ? wrapper.longValue() : defaultValue; + return wrapper != null ? wrapper : defaultValue; } } diff --git a/example/src/main/java/io/netty/example/http/websocketx/benchmarkserver/WebSocketServerHandler.java b/example/src/main/java/io/netty/example/http/websocketx/benchmarkserver/WebSocketServerHandler.java index 15baf8a3e5..78f61ba14f 100644 --- a/example/src/main/java/io/netty/example/http/websocketx/benchmarkserver/WebSocketServerHandler.java +++ b/example/src/main/java/io/netty/example/http/websocketx/benchmarkserver/WebSocketServerHandler.java @@ -123,7 +123,6 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler if (frame instanceof BinaryWebSocketFrame) { // Echo the frame ctx.write(frame.retain()); - return; } }