Use Uint32.saturatedOf() 16/105116/2
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 31 Mar 2023 14:39:13 +0000 (16:39 +0200)
committerRobert Varga <nite@hq.sk>
Sat, 1 Apr 2023 17:01:38 +0000 (17:01 +0000)
commitff7593ca46094f2b3697591749a0749f0fba19e2
tree16331dd54f61928e21db883eeda5bd252b4ea823
parenta4eb8b6920e40e653e7e512fb8b9975f93ec1ffe
Use Uint32.saturatedOf()

We are receiving a splat when the sum ends up being negative. While the
underlying cause needs to be investigated, we also should be properly
defensive. Uint32.saturatedOf() catches negative values and squashes
them to 0.

JIRA: BGPCEP-1021
Change-Id: Ia376305aa677ebd05a41629c5083f8829891615f
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/openconfig-state/src/main/java/org/opendaylight/protocol/bgp/state/PeerGroupUtil.java