Use Uint32.saturatedOf() 16/105116/1
authorRobert Varga <robert.varga@pantheon.tech>
Fri, 31 Mar 2023 14:39:13 +0000 (16:39 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Fri, 31 Mar 2023 14:40:34 +0000 (16:40 +0200)
commitcc71ea45a8e373d50b063a61966245c5e90d4aa8
tree53ffd4641cf1546a0fc491bcb6ac8d3146fcec08
parentceebcbff29da2b83439701db5b41c7854708ab35
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