Merge this if statement with the enclosing one. 34/98034/1
authoranushadasari <danush10@in.ibm.com>
Wed, 6 Nov 2019 10:52:45 +0000 (16:22 +0530)
committeranushadasari <danush10@in.ibm.com>
Wed, 6 Nov 2019 10:53:09 +0000 (16:23 +0530)
Merging collapsible if statements increases the code's readability.

Issue-ID: VID-699
Change-Id: Ia2b7408dd4ed73d57ead0fb4f2b404e74745b4ec
Signed-off-by: anushadasari <danush10@in.ibm.com>
vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java

index 1c8a465..45478e2 100644 (file)
@@ -360,12 +360,10 @@ public class ServiceModel {
                                " Associated VF Module customizationName=" + vfModuleComponent.getKey() + " with VNF customization name=" + vnfCustomizationName);
 
                // now find if this vf module has volume groups, if so, find the volume group with the same customization name and put it under the VNF
-               if ( vfModuleComponent.getValue().isVolumeGroupAllowed() ) {
-            if (isVolumeGroupsContainsVfModuleCustomName(vfModuleCustomizationName)) {
+               if ( vfModuleComponent.getValue().isVolumeGroupAllowed() && isVolumeGroupsContainsVfModuleCustomName(vfModuleCustomizationName) ) {
                        (vnfComponent.getValue().getVolumeGroups()).put(vfModuleCustomizationName, (getVolumeGroups()).get(vfModuleCustomizationName));
                }
        }
-       }
 
        private boolean isVolumeGroupsContainsVfModuleCustomName(String vfModuleCustomizationName) {
                return (!MapUtils.isEmpty(getVolumeGroups())) && (getVolumeGroups().containsKey((vfModuleCustomizationName)));