Cleanup : removed unnecessary 'continue', explicit array creation, unwrapping

This commit is contained in:
Dmitriy Dumanskiy 2017-02-09 16:27:10 +02:00 committed by Norman Maurer
parent 9c03d49f14
commit c95517f759
4 changed files with 4 additions and 10 deletions

View File

@ -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++) {

View File

@ -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) {

View File

@ -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;
}
}

View File

@ -123,7 +123,6 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
if (frame instanceof BinaryWebSocketFrame) {
// Echo the frame
ctx.write(frame.retain());
return;
}
}