Sonar suggestion - don't use bit operator in a boolean expression

Change-Id: I69e254ffea0c72a040077d6e6a13c326d44c1197
This commit is contained in:
Ray Milkey 2017-12-15 15:58:12 -08:00
parent faed9f3b44
commit e559bcf45d

View File

@ -39,7 +39,7 @@ public final class PacketUtils {
public static void checkBufferLength(int byteLength, int offset, int length)
throws DeserializationException {
boolean ok = (offset >= 0 && offset < byteLength);
ok = ok & (length >= 0 && offset + length <= byteLength);
ok = ok && (length >= 0 && offset + length <= byteLength);
if (!ok) {
throw new DeserializationException("Unable to read " + length + " bytes from a "