BUG-2825: do not check tautology 44/35644/5
authorRobert Varga <robert.varga@pantheon.sk>
Thu, 25 Feb 2016 02:06:38 +0000 (03:06 +0100)
committerRobert Varga <rovarga@cisco.com>
Fri, 4 Mar 2016 01:45:34 +0000 (02:45 +0100)
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>
(cherry picked from commit 30f8b36bd2b1ebd9697af125aacc8ddedb86d3b1)

model/ietf/ietf-type-util/src/main/java/org/opendaylight/mdsal/model/ietf/util/Ipv6Utils.java

index c5dfeb07176d2145f76025b4fd0e2e2ed8ee4c5e..3b8e8e323cc2105e6439f10066cc348c9549c3ff 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;
    }
 }