From 51011e010362d1acd57e59d0458c3da925df621a Mon Sep 17 00:00:00 2001 From: dinesha Date: Mon, 29 Jul 2019 18:32:12 +0530 Subject: Sonar Fix- RestoreStack.java Fixed Sonar issues accross the file Issue-ID: APPC-1669 Change-Id: Icd598fa6c9954c22d4bfd7ab0155823e8b946638 Signed-off-by: dinesha --- .../adapter/iaas/provider/operation/impl/RestoreStack.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'appc-adapters') diff --git a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/RestoreStack.java b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/RestoreStack.java index 6c930142a..959ae5652 100644 --- a/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/RestoreStack.java +++ b/appc-adapters/appc-iaas-adapter/appc-iaas-adapter-bundle/src/main/java/org/onap/appc/adapter/iaas/provider/operation/impl/RestoreStack.java @@ -89,7 +89,7 @@ public class RestoreStack extends ProviderStackOperation { } public Stack restoreStack(Map params, SvcLogicContext ctx) - throws IllegalArgumentException, APPCException { + throws APPCException { Stack stack = null; RequestContext rc = new RequestContext(ctx); rc.isAlive(); @@ -97,7 +97,7 @@ public class RestoreStack extends ProviderStackOperation { ctx.setAttribute("SNAPSHOT_STATUS", "STACK_NOT_FOUND"); String appName = configuration.getProperty(Constants.PROPERTY_APPLICATION_NAME); - String vm_url = null; + String vmUrl = null; Context context = null; String tenantName = "Unknown";//to be used also in case of exception try { @@ -107,15 +107,15 @@ public class RestoreStack extends ProviderStackOperation { ProviderAdapter.PROPERTY_INPUT_SNAPSHOT_ID); String stackId = params.get(ProviderAdapter.PROPERTY_STACK_ID); - vm_url = params.get(ProviderAdapter.PROPERTY_INSTANCE_URL); + vmUrl = params.get(ProviderAdapter.PROPERTY_INSTANCE_URL); String snapshotId = params.get(ProviderAdapter.PROPERTY_INPUT_SNAPSHOT_ID); - context = resolveContext(rc, params, appName, vm_url); + context = resolveContext(rc, params, appName, vmUrl); if (context != null) { tenantName = context.getTenantName();//this varaible also is used in case of exception stack = lookupStack(rc, context, stackId); - logger.debug(Msg.STACK_FOUND, vm_url, tenantName, stack.getStatus().toString()); + logger.debug(Msg.STACK_FOUND, vmUrl, tenantName, stack.getStatus().toString()); logger.info(EELFResourceManager.format(Msg.TERMINATING_STACK, stack.getName())); restoreStack(stack, snapshotId); logger.info(EELFResourceManager.format(Msg.TERMINATE_STACK, stack.getName())); @@ -126,7 +126,7 @@ public class RestoreStack extends ProviderStackOperation { } } catch (ResourceNotFoundException e) { - String msg = EELFResourceManager.format(Msg.STACK_NOT_FOUND, e, vm_url); + String msg = EELFResourceManager.format(Msg.STACK_NOT_FOUND, e, vmUrl); logger.error(msg); doFailure(rc, HttpStatus.NOT_FOUND_404, msg, e); } catch (RequestFailedException e) { @@ -134,7 +134,7 @@ public class RestoreStack extends ProviderStackOperation { doFailure(rc, e.getStatus(), e.getMessage(), e); } catch (Exception e1) { String msg = EELFResourceManager.format(Msg.STACK_OPERATION_EXCEPTION, e1, e1.getClass().getSimpleName(), - "restoreStack", vm_url, tenantName); + "restoreStack", vmUrl, tenantName); logger.error(msg, e1); doFailure(rc, HttpStatus.INTERNAL_SERVER_ERROR_500, msg, e1); } -- cgit 1.2.3-korg