Sonar Critical Fix 15/15815/2
authorsanchitap <sanchita@techmahindra.com>
Wed, 27 Sep 2017 06:56:01 +0000 (12:26 +0530)
committerPatrick Brady <pb071s@att.com>
Wed, 27 Sep 2017 21:59:24 +0000 (21:59 +0000)
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 <sanchita@techmahindra.com>
appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/openecomp/appc/adapter/iaas/provider/operation/impl/base/ProviderStackOperation.java

index 28d8e3d..9579fec 100644 (file)
@@ -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;