From 92b812ed2e2f5c4da786817754669925c95bf516 Mon Sep 17 00:00:00 2001 From: ojasdubey Date: Mon, 16 Oct 2017 16:07:29 +0530 Subject: Bugfix - Submit failed for existing VSP Added preventive null checks for onboardingMethod attribute Issue ID: SDC-466 Change-Id: I061b608446b895568724f71ae46c2ef8859cb600 Signed-off-by: ojasdubey --- .../impl/VendorSoftwareProductManagerImpl.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'openecomp-be') diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java index 0a3428579d..1891cddfd5 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java @@ -329,7 +329,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa validateQuestionnaire(vspDetails.getId(), vspDetails.getVersion(), vspDetails .getOnboardingMethod())); - if (vspDetails.getOnboardingMethod().equals("Manual")) { + if ("Manual".equals(vspDetails.getOnboardingMethod())) { Collection deploymentFlavourValidationErrList = deploymentFlavorValidation(vspDetails.getId(), vspDetails.getVersion()); if (validationResponse.getVspErrors() != null) { @@ -527,7 +527,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa if (vspDetails.getSubCategory() == null) { errors.add(createMissingMandatoryFieldError("sub category")); } - if (vspDetails.getOnboardingMethod().equals("Manual")) { + if ("Manual".equals(vspDetails.getOnboardingMethod())) { //Manual Onboarding specific validations Collection deploymentFlavorEntities = vendorSoftwareProductDao .listDeploymentFlavors(vspDetails.getId(), vspDetails.getVersion()); @@ -729,7 +729,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa mdcDataDebugMessage.debugEntryMessage("VSP id", vspDetails.getId()); VspDetails retrieved = vspInfoDao.get(vspDetails); - if (!retrieved.getOnboardingMethod().equals(vspDetails.getOnboardingMethod())) { + if (!Objects.equals(retrieved.getOnboardingMethod(), vspDetails.getOnboardingMethod())) { final ErrorCode onboardingMethodUpdateErrorCode = OnboardingMethodErrorBuilder .getOnboardingUpdateError(); -- cgit 1.2.3-korg