diff options
author | k.kazak <k.kazak@samsung.com> | 2019-02-12 15:22:29 +0100 |
---|---|---|
committer | k.kazak <k.kazak@samsung.com> | 2019-02-12 15:22:29 +0100 |
commit | 172be7073ec345f65e7a40cd95da3a97bdbc0f57 (patch) | |
tree | 2baada6c6b0016921cb33066c54698be42161d23 /bpmn/so-bpmn-tasks/src/main/java | |
parent | b80f29cbbeb5ec218b0278deef872f7b5350e292 (diff) |
fix major sonar bug
Removed useless 'instanceof' operator as it always resolves as true
Replaced it with checking for null
Removed unused imports
Added information about modifications on the top
Added junit tests for the method
Change-Id: I7a902ad2852e0ed0d507a6309857a1bab74921de
Issue-ID: SO-1491
Signed-off-by: k.kazak <k.kazak@samsung.com>
Diffstat (limited to 'bpmn/so-bpmn-tasks/src/main/java')
-rw-r--r-- | bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index 0082545fa1..99bda80e4f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -4,6 +4,8 @@ * ================================================================================ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. * ================================================================================ + * Modifications Copyright (c) 2019 Samsung + * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -48,7 +50,6 @@ import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock; import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils; -import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource; import org.onap.so.client.aai.AAICommonObjectMapperProvider; import org.onap.so.client.aai.entities.AAIResultWrapper; import org.onap.so.client.aai.entities.Relationships; @@ -58,13 +59,11 @@ import org.onap.so.db.catalog.beans.CollectionNetworkResourceCustomization; import org.onap.so.db.catalog.beans.CollectionResourceCustomization; import org.onap.so.db.catalog.beans.CollectionResourceInstanceGroupCustomization; import org.onap.so.db.catalog.beans.CvnfcCustomization; -import org.onap.so.db.catalog.beans.NetworkCollectionResourceCustomization; import org.onap.so.db.catalog.beans.VfModuleCustomization; import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization; import org.onap.so.db.catalog.beans.macro.NorthBoundRequest; import org.onap.so.db.catalog.beans.macro.OrchestrationFlow; import org.onap.so.db.catalog.client.CatalogDbClient; -import org.onap.so.logger.MsoLogger; import org.onap.so.serviceinstancebeans.ModelInfo; import org.onap.so.serviceinstancebeans.ModelType; import org.onap.so.serviceinstancebeans.Networks; @@ -439,8 +438,7 @@ public class WorkflowAction { CollectionResourceCustomization networkCollection = null; int count = 0; for(CollectionResourceCustomization collectionCust : service.getCollectionResourceCustomizations()){ - if(catalogDbClient.getNetworkCollectionResourceCustomizationByID(collectionCust.getModelCustomizationUUID()) - instanceof NetworkCollectionResourceCustomization) { + if(catalogDbClient.getNetworkCollectionResourceCustomizationByID(collectionCust.getModelCustomizationUUID()) != null) { networkCollection = collectionCust; count++; } |