From e5b070acb072d62d7f86e50e51b6b1586b85e307 Mon Sep 17 00:00:00 2001 From: mkidd Date: Mon, 1 Mar 2021 11:13:06 +0000 Subject: fix code smells and vulnerabilities used await method inside an if statement that now runs the same code as the accompanying finally block. removed unused variables from ApexContextAlbumEditForm.js refactored vars that were redelared - this was not needed as there were variables of this name within scope added ! operator Issue-ID: POLICY-3095 Signed-off-by: mkidd Change-Id: Idadf4dd6938be5410fef62140de8b265bbaca138 --- .../java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'gui-pdp-monitoring/src') diff --git a/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java b/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java index 2a2355e..4324124 100644 --- a/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java +++ b/gui-pdp-monitoring/src/main/java/org/onap/policy/gui/pdp/monitoring/PdpMonitoringMain.java @@ -1,6 +1,6 @@ /*- * ============LICENSE_START======================================================= - * Copyright (C) 2020 Nordix Foundation. + * Copyright (C) 2020-2021 Nordix Foundation. * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -121,7 +121,9 @@ public class PdpMonitoringMain { // Find out how long is left to wait long timeRemaining = parameters.getTimeToLive(); if (timeRemaining >= 0) { - shutdownLatch.await(timeRemaining, TimeUnit.SECONDS); + if (!shutdownLatch.await(timeRemaining, TimeUnit.SECONDS)) { + shutdown(); + } } else { shutdownLatch.await(); } -- cgit 1.2.3-korg