diff options
author | Divesh Mirchandani <Divesh.Mirchandani@amdocs.com> | 2017-09-14 19:14:21 +0530 |
---|---|---|
committer | Divesh Mirchandani <Divesh.Mirchandani@amdocs.com> | 2017-09-18 17:26:38 +0530 |
commit | 396cb378ab8940b1adb8ba1adc656d0b4ad66f99 (patch) | |
tree | b4f6ddc8e7cdfe39bfcbdc75cff7e85c284c5b65 /openecomp-be/lib/openecomp-sdc-tosca-generator-lib | |
parent | 27f5c2b105676eebb477714fd7323467151965d2 (diff) |
Fixed SONAR issues
Fixed blocker, critical, major & minor SONAR issues.
Issue-ID: SDC-343
Change-Id: I72e5a3a7fa7d7407a92f98f77e4334827f70f926
Signed-off-by: dd4616 <Divesh.Mirchandani@amdocs.com>
Diffstat (limited to 'openecomp-be/lib/openecomp-sdc-tosca-generator-lib')
7 files changed, 104 insertions, 95 deletions
diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/ComputeFlavor.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/ComputeFlavor.java index d888bd311b..e34627d62b 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/ComputeFlavor.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/ComputeFlavor.java @@ -41,21 +41,23 @@ public class ComputeFlavor { public boolean equals(Object obj) { if (this == obj) return true; - if (getClass() != obj.getClass()) + if (obj != null && getClass() != obj.getClass()) return false; ComputeFlavor other = (ComputeFlavor) obj; - if (num_cpus != other.num_cpus) - return false; - if (this.disk_size == null) { - if (other.disk_size != null) + if(other != null) { + if (num_cpus != other.num_cpus) return false; - } else if (!disk_size.equals(other.disk_size)) - return false; - if (this.mem_size == null) { - if (other.mem_size != null) + if (this.disk_size == null) { + if (other.disk_size != null) + return false; + } else if (!disk_size.equals(other.disk_size)) return false; - } else if (!mem_size.equals(other.mem_size)) - return false; + if (this.mem_size == null) { + if (other.mem_size != null) + return false; + } else if (!mem_size.equals(other.mem_size)) + return false; + } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/DeploymentFlavorModel.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/DeploymentFlavorModel.java index a0d5f40b8c..3bc338361e 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/DeploymentFlavorModel.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/DeploymentFlavorModel.java @@ -53,29 +53,31 @@ public class DeploymentFlavorModel { public boolean equals(Object obj) { if (this == obj) return true; - if (getClass() != obj.getClass()) + if (obj != null && getClass() != obj.getClass()) return false; DeploymentFlavorModel other = (DeploymentFlavorModel) obj; - if (this.sp_part_number == null) { - if (other.sp_part_number != null) + if (other != null) { + if (this.sp_part_number == null) { + if (other.sp_part_number != null) + return false; + } else if (!sp_part_number.equals(other.sp_part_number)) return false; - } else if (!sp_part_number.equals(other.sp_part_number)) - return false; - if (this.vendor_info == null) { - if (other.vendor_info != null) + if (this.vendor_info == null) { + if (other.vendor_info != null) + return false; + } else if (!vendor_info.equals(other.vendor_info)) return false; - } else if (!vendor_info.equals(other.vendor_info)) - return false; - if (this.compute_flavor == null) { - if (other.compute_flavor != null) + if (this.compute_flavor == null) { + if (other.compute_flavor != null) + return false; + } else if (!compute_flavor.equals(other.compute_flavor)) return false; - } else if (!compute_flavor.equals(other.compute_flavor)) - return false; - if (this.license_flavor == null) { - if (other.license_flavor != null) + if (this.license_flavor == null) { + if (other.license_flavor != null) + return false; + } else if (!license_flavor.equals(other.license_flavor)) return false; - } else if (!license_flavor.equals(other.license_flavor)) - return false; + } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/LicenseFlavor.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/LicenseFlavor.java index f459d9e993..1cdeaca562 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/LicenseFlavor.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/LicenseFlavor.java @@ -24,14 +24,16 @@ public class LicenseFlavor { public boolean equals(Object obj) { if (this == obj) return true; - if (getClass() != obj.getClass()) + if (obj != null && getClass() != obj.getClass()) return false; LicenseFlavor other = (LicenseFlavor) obj; - if (this.feature_group_uuid == null) { - if (other.feature_group_uuid != null) + if (other != null) { + if (this.feature_group_uuid == null) { + if (other.feature_group_uuid != null) + return false; + } else if (!feature_group_uuid.equals(other.feature_group_uuid)) return false; - } else if (!feature_group_uuid.equals(other.feature_group_uuid)) - return false; + } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/MultiFlavorVfcImage.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/MultiFlavorVfcImage.java index 6cd713e2d1..560a7765f2 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/MultiFlavorVfcImage.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/MultiFlavorVfcImage.java @@ -54,29 +54,31 @@ public class MultiFlavorVfcImage { public boolean equals(Object obj) { if (this == obj) return true; - if (getClass() != obj.getClass()) + if (obj != null && getClass() != obj.getClass()) return false; MultiFlavorVfcImage other = (MultiFlavorVfcImage) obj; - if (this.file_name == null) { - if (other.file_name != null) + if (other != null) { + if (this.file_name == null) { + if (other.file_name != null) + return false; + } else if (!file_name.equals(other.file_name)) return false; - } else if (!file_name.equals(other.file_name)) - return false; - if (this.file_hash == null) { - if (other.file_hash != null) + if (this.file_hash == null) { + if (other.file_hash != null) + return false; + } else if (!file_hash.equals(other.file_hash)) return false; - } else if (!file_hash.equals(other.file_hash)) - return false; - if (this.file_hash_type == null) { - if (other.file_hash_type != null) + if (this.file_hash_type == null) { + if (other.file_hash_type != null) + return false; + } else if (!file_hash_type.equals(other.file_hash_type)) return false; - } else if (!file_hash_type.equals(other.file_hash_type)) - return false; - if (this.software_version == null) { - if (other.software_version != null) + if (this.software_version == null) { + if (other.software_version != null) + return false; + } else if (!software_version.equals(other.software_version)) return false; - } else if (!software_version.equals(other.software_version)) - return false; + } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VendorInfo.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VendorInfo.java index 22348f3083..0c2be2508c 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VendorInfo.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VendorInfo.java @@ -32,19 +32,21 @@ public class VendorInfo { public boolean equals(Object obj) { if (this == obj) return true; - if (getClass() != obj.getClass()) + if (obj != null && getClass() != obj.getClass()) return false; VendorInfo other = (VendorInfo) obj; - if (this.manufacturer_reference_number == null) { - if (other.manufacturer_reference_number != null) + if (other != null) { + if (this.manufacturer_reference_number == null) { + if (other.manufacturer_reference_number != null) + return false; + } else if (!manufacturer_reference_number.equals(other.manufacturer_reference_number)) return false; - } else if (!manufacturer_reference_number.equals(other.manufacturer_reference_number)) - return false; - if (this.vendor_model == null) { - if (other.vendor_model != null) + if (this.vendor_model == null) { + if (other.vendor_model != null) + return false; + } else if (!vendor_model.equals(other.vendor_model)) return false; - } else if (!vendor_model.equals(other.vendor_model)) - return false; + } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VspModelInfo.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VspModelInfo.java index 025db1cafc..4372e7f98a 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VspModelInfo.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VspModelInfo.java @@ -82,51 +82,53 @@ public class VspModelInfo { if (this == obj) { return true; } - if (getClass() != obj.getClass()) { + if (obj != null && getClass() != obj.getClass()) { return false; } VspModelInfo other = (VspModelInfo) obj; - if (this.releaseVendor == null) { - if (other.releaseVendor != null) { + if(other != null) { + if (this.releaseVendor == null) { + if (other.releaseVendor != null) { + return false; + } + } else if (!releaseVendor.equals(other.releaseVendor)) { return false; } - } else if (!releaseVendor.equals(other.releaseVendor)) { - return false; - } - if (this.components == null) { - if (other.components != null) { + if (this.components == null) { + if (other.components != null) { + return false; + } + } else if (!components.equals(other.components)) { return false; } - } else if (!components.equals(other.components)) { - return false; - } - if (this.allowedFlavors == null) { - if (other.allowedFlavors != null) { + if (this.allowedFlavors == null) { + if (other.allowedFlavors != null) { + return false; + } + } else if (!allowedFlavors.equals(other.allowedFlavors)) { return false; } - } else if (!allowedFlavors.equals(other.allowedFlavors)) { - return false; - } - if (this.multiFlavorVfcImages == null) { - if (other.multiFlavorVfcImages != null) { + if (this.multiFlavorVfcImages == null) { + if (other.multiFlavorVfcImages != null) { + return false; + } + } else if (!multiFlavorVfcImages.equals(other.multiFlavorVfcImages)) { return false; } - } else if (!multiFlavorVfcImages.equals(other.multiFlavorVfcImages)) { - return false; - } - if (this.multiFlavorVfcImages == null) { - if (other.multiFlavorVfcImages != null) { + if (this.multiFlavorVfcImages == null) { + if (other.multiFlavorVfcImages != null) { + return false; + } + } else if (!multiFlavorVfcImages.equals(other.multiFlavorVfcImages)) { return false; } - } else if (!multiFlavorVfcImages.equals(other.multiFlavorVfcImages)) { - return false; - } - if (this.nics == null) { - if (other.nics != null) { + if (this.nics == null) { + if (other.nics != null) { + return false; + } + } else if (!nics.equals(other.nics)) { return false; } - } else if (!nics.equals(other.nics)) { - return false; } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java index 59b06ba7a8..7e493f2151 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java @@ -18,12 +18,9 @@ import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; import org.openecomp.sdc.tosca.services.DataModelUtil; import org.openecomp.sdc.tosca.services.ToscaAnalyzerService; +import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil; import org.openecomp.sdc.tosca.services.ToscaUtil; import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl; -import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil; -import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; import java.util.ArrayList; import java.util.Arrays; @@ -37,8 +34,8 @@ import java.util.Map; */ public class GeneratorUtils { - public static List<String> supportedCapabilities = new ArrayList<>(); - public static List<String> supportedRequirements = new ArrayList<>(); + private static List<String> supportedCapabilities = new ArrayList<>(); + private static List<String> supportedRequirements = new ArrayList<>(); protected static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); static { |