Fixed string literal comparision 77/15477/2
authorshashikanth <shashikanth.vh@huawei.com>
Tue, 26 Sep 2017 11:39:34 +0000 (17:09 +0530)
committerShashikanth VH <shashikanth.vh@huawei.com>
Wed, 27 Sep 2017 05:04:31 +0000 (05:04 +0000)
Fix Blocker/Critical sonar issues in so module
https://sonar.onap.org/component_issues?id=org.openecomp.so%3Aso#resolved=false|severities=BLOCKER%2CMAJOR|rules=squid%3AS1132%2Csquid%3AS1143

Move the "true" string literal on the left side of this string comparison

Issue-Id: APPC-186
Change-Id: I1a62b36c344ebca1786245e3837a537182c60377
Signed-off-by: shashikanth.vh <shashikanth.vh@huawei.com>
asdc-controller/src/main/java/org/openecomp/mso/asdc/installer/heat/ToscaResourceInstaller.java

index 27a21ec..7789ace 100644 (file)
@@ -784,7 +784,7 @@ public class ToscaResourceInstaller {// implements IVfResourceInstaller {
                \r
                String providerNetwork = toscaResourceStructure.getSdcCsarHelper().getNodeTemplatePropertyLeafValue(networkNodeTemplate, SdcPropertyNames.PROPERTY_NAME_PROVIDERNETWORK_ISPROVIDERNETWORK);\r
                \r
-               if(providerNetwork != null && providerNetwork.equalsIgnoreCase("true")){\r
+               if("true".equalsIgnoreCase(providerNetwork)){\r
                        networkResource.setNeutronNetworkType("PROVIDER");\r
                } else {\r
                        networkResource.setNeutronNetworkType("BASIC");\r