From 61b4411b0fb21186d385178805b564bb893f5554 Mon Sep 17 00:00:00 2001 From: shashikanth Date: Tue, 26 Sep 2017 11:08:08 +0530 Subject: [PATCH] Fixed string literal comparision major issue https://sonar.onap.org/component_issues?id=org.openecomp.so%3Aso#fileUuids=AV3BnsdG5bp_wwmIVCEu|resolved=false|severities=MAJOR Issue-Id:SO-118 Change-Id: I9ce4b3cb4c5acc5d19183dc278e4907aae221443 Signed-off-by: shashikanth.vh --- .../mso/asdc/installer/heat/VfResourceInstaller.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/VfResourceInstaller.java b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/VfResourceInstaller.java index 73f37e3f53..bd20eb0bf1 100644 --- a/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/VfResourceInstaller.java +++ b/asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/VfResourceInstaller.java @@ -220,7 +220,7 @@ public class VfResourceInstaller implements IVfResourceInstaller { String resourceType = vfResourceStructure.getResourceInstance().getResourceType(); String resourceCategory = vfResourceStructure.getResourceInstance().getCategory(); - if(resourceType.equals("VF")){ + if("VF".equals(resourceType)){ if(resourceCategory.equalsIgnoreCase("Allotted Resource")){ VfResourceInstaller.createAllottedResourceCustomization(vfResourceStructure); @@ -231,7 +231,7 @@ public class VfResourceInstaller implements IVfResourceInstaller { } } - if(resourceType.equals("VL")){ + if("VL".equals(resourceType)){ VfResourceInstaller.createNetworkResourceCustomization(vfResourceStructure); catalogDB.saveNetworkResourceCustomization(vfResourceStructure.getCatalogNetworkResourceCustomization()); } @@ -243,12 +243,12 @@ public class VfResourceInstaller implements IVfResourceInstaller { catalogDB.saveService(vfResourceStructure.getCatalogService()); // Now that the service has been added we can populate the Service_to_AllottedResources table - if(resourceType.equals("VF") && resourceCategory.equalsIgnoreCase("Allotted Resource")){ + if("VF".equals(resourceType) && "Allotted Resource".equalsIgnoreCase(resourceCategory)){ catalogDB.saveServiceToAllottedResources(vfResourceStructure.getCatalogServiceToAllottedResources()); } // Now that the service has been added we can populate the Service_to_Network table - if(resourceType.equals("VL")){ + if("VL".equals(resourceType)){ catalogDB.saveServiceToNetworks(vfResourceStructure.getCatalogServiceToNetworks()); } @@ -667,7 +667,7 @@ public class VfResourceInstaller implements IVfResourceInstaller { // heatTemplate.setAsdcResourceName(vfResourceStructure.getResourceInstance().getResourceName()); heatTemplate.setAsdcUuid(vfModuleArtifact.getArtifactInfo().getArtifactUUID()); - List typeList = new ArrayList(); + List typeList = new ArrayList<>(); typeList.add(ASDCConfiguration.HEAT_NESTED); typeList.add(ASDCConfiguration.HEAT_ARTIFACT); @@ -707,7 +707,7 @@ public class VfResourceInstaller implements IVfResourceInstaller { // TODO Set the label // heatEnvironment.setAsdcLabel("Label"); - List typeList = new ArrayList(); + List typeList = new ArrayList<>(); typeList.add(ASDCConfiguration.HEAT); typeList.add(ASDCConfiguration.HEAT_VOL); -- 2.16.6