From aafb645c016c49bd18630e2be15b2405216e5210 Mon Sep 17 00:00:00 2001 From: Pamela Dragosh Date: Fri, 27 Mar 2020 14:47:30 -0400 Subject: AtomicInteger cleanup Per Jim's last comments. Issue-ID: POLICY-2305 Change-Id: I1bc73dcd264e9a122f6ec0eece08202cbcb3a8e9 Signed-off-by: Pamela Dragosh --- .../distribution/reception/handling/sdc/SdcReceptionHandler.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java index 5d011f0c..df968f99 100644 --- a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java +++ b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java @@ -370,10 +370,7 @@ public class SdcReceptionHandler extends AbstractReceptionHandler implements INo * @param newStatus the new status */ private void handleIdleStatusChange(final SdcReceptionHandlerStatus newStatus) { - if (nbOfNotificationsOngoing.get() > 1) { - nbOfNotificationsOngoing.decrementAndGet(); - } else { - nbOfNotificationsOngoing.set(0); + if (nbOfNotificationsOngoing.getAndUpdate(curval -> Math.max(0, curval - 1)) == 0) { sdcReceptionHandlerStatus = newStatus; } } -- cgit 1.2.3-korg