Cleanup : removed unnecessary 'continue', explicit array creation, unwrapping
This commit is contained in:
parent
9c03d49f14
commit
c95517f759
@ -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++) {
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -123,7 +123,6 @@ public class WebSocketServerHandler extends SimpleChannelInboundHandler<Object>
|
||||
if (frame instanceof BinaryWebSocketFrame) {
|
||||
// Echo the frame
|
||||
ctx.write(frame.retain());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user