commit | ff31b1eea7a5aec585fbbdf5004d2c1d93f4437e | [log] [tgz] |
---|---|---|
author | lding7 <liang.ding@intel.com> | Mon Mar 19 16:22:01 2018 +0800 |
committer | Vitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com> | Wed Mar 28 12:12:41 2018 +0000 |
tree | 4094fb9c4018a669241098be5c40575da2cf8869 | |
parent | 65029c3dfc0f876284489009a01252e1088eac03 [diff] |
fix sonar complaints NullPointerException in SDC bugs from https://sonar.onap.org/project/issues?id= org.openecomp.sdc%3Asdc-main%3A1.2.0-SNAPSHOT&open= AWIFjPUXRGy6eclHC_Q6&resolved=false&types=BUG and https://sonar.onap.org/project/issues?id= org.openecomp.sdc%3Asdc-main%3A1.2.0-SNAPSHOT&open= AWIFjPUXRGy6eclHC_Q5&resolved=false&types=BUG Change-Id: I88225e4da197bed62d588026564bd688a9627c8a Issue-ID: SDC-1146 Signed-off-by: lding7 <liang.ding@intel.com>
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/CompositionEntityDataManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/CompositionEntityDataManagerImpl.java index a00bd8e..faa5386 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/CompositionEntityDataManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/CompositionEntityDataManagerImpl.java
@@ -212,16 +212,14 @@ @Override public Set<CompositionEntityValidationData> getAllErrorsByVsp(String vspId) { - CompositionEntityValidationData matchVsp = null; Set<CompositionEntityValidationData> entitiesWithErrors = new HashSet<>(); for (CompositionEntityValidationData root : roots) { if (root.getEntityId().equals(vspId)) { - matchVsp = root; + getEntityListWithErrors(root, entitiesWithErrors); break; } } - getEntityListWithErrors(matchVsp, entitiesWithErrors); if (CollectionUtils.isNotEmpty(entitiesWithErrors)) { updateValidationCompositionEntityName(entitiesWithErrors); return entitiesWithErrors; @@ -449,6 +447,9 @@ case vsp: CompositionEntityData vspEntity = getCompositionEntityDataById(entity); + if (Objects.isNull(vspEntity)) { + return null; + } VspQuestionnaireEntity vspQuestionnaireEntity = (VspQuestionnaireEntity) vspEntity.entity; VspDetails vspDetails = vspInfoDao.get(new VspDetails(vspQuestionnaireEntity.getId(),