BUG-2825: do not check tautology 73/35373/5
authorRobert Varga <robert.varga@pantheon.sk>
Thu, 25 Feb 2016 02:06:38 +0000 (03:06 +0100)
committerGerrit Code Review <gerrit@opendaylight.org>
Thu, 25 Feb 2016 15:23:30 +0000 (15:23 +0000)
We do not need to check j for size if we previously set it. Move
the verification check into its own branch.

Change-Id: I18766f1ec9733fc5065c384256d9f2a5af69a497
Signed-off-by: Robert Varga <robert.varga@pantheon.sk>
model/ietf/ietf-type-util/src/main/java/org/opendaylight/mdsal/model/ietf/util/Ipv6Utils.java

index e73c5b613ac160bad9fb760e86d6bf38a1981e33..e8fecef4376006a2812909612a7b356b0301e307 100644 (file)
@@ -142,10 +142,10 @@ final class Ipv6Utils {
                dst[INADDR6SZ - i] = dst[colonp + n - i];
                dst[colonp + n - i] = 0;
            }
-           j = INADDR6SZ;
+       } else {
+           Verify.verify(j == INADDR6SZ, "Overrun in parsing of '%s', should not occur", addrStr);
        }
 
-       Verify.verify(j == INADDR6SZ, "Overrun in parsing of '%s', should not occur", addrStr);
        return dst;
    }
 }