From f2e77cc8209018f6955fba400ab4d0ff609448b1 Mon Sep 17 00:00:00 2001 From: sanchitap Date: Wed, 27 Sep 2017 12:26:01 +0530 Subject: Sonar Critical Fix ProviderStackOperation.java: L98 and L178 Sonar link:https://sonar.onap.org/component_issues/index?id=org.openecomp.appc%3Aappc#resolved=false|severities=CRITICAL|rules=squid%3AS2184 Change-Id: Id73e2153b13716706b0dce4204d8c7519855afe5 Issue-Id :APPC-237 Signed-off-by: sanchitap --- .../iaas/provider/operation/impl/base/ProviderStackOperation.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'appc-adapters') diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderStackOperation.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderStackOperation.java index 28d8e3d4d..9579fec33 100644 --- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderStackOperation.java +++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderStackOperation.java @@ -90,7 +90,8 @@ public abstract class ProviderStackOperation extends ProviderOperation{ } } - private boolean checkStatus(String expectedStatus, int pollInterval, String actualStatus) { +/* Changed the 'pollInterval' type as long. Thread.sleep method needs 'long millis' as an argument */ + private boolean checkStatus(String expectedStatus, long pollInterval, String actualStatus) { if (actualStatus.toUpperCase().equals(expectedStatus)) { return true; } else { @@ -161,8 +162,8 @@ public abstract class ProviderStackOperation extends ProviderOperation{ SvcLogicContext ctx = rc.getSvcLogicContext(); Context context = stack.getContext(); StackService stackService = context.getStackService(); - - int pollInterval = configuration.getIntegerProperty(Constants.PROPERTY_OPENSTACK_POLL_INTERVAL); +/* Changed the 'pollInterval' type as long. Thread.sleep method needs 'long millis' as an argument */ + long pollInterval = configuration.getIntegerProperty(Constants.PROPERTY_OPENSTACK_POLL_INTERVAL); int timeout = configuration.getIntegerProperty(Constants.PROPERTY_STACK_STATE_CHANGE_TIMEOUT); long maxTimeToWait = System.currentTimeMillis() + (long) timeout * 1000; Stack.Status stackStatus; -- cgit 1.2.3-korg