aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2020-03-27 14:47:30 -0400
committerPamela Dragosh <pdragosh@research.att.com>2020-03-27 14:47:36 -0400
commitaafb645c016c49bd18630e2be15b2405216e5210 (patch)
tree516c574e272727074f74d289b42b5c5b4e0bd5aa
parentf904f966bbfbb7e26fea8410f83b67504b1e6a76 (diff)
AtomicInteger cleanup
Per Jim's last comments. Issue-ID: POLICY-2305 Change-Id: I1bc73dcd264e9a122f6ec0eece08202cbcb3a8e9 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
-rw-r--r--plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/handling/sdc/SdcReceptionHandler.java5
1 files changed, 1 insertions, 4 deletions
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;
}
}