From b3d4898d9e8452ea0b8d848c048e712d43b8d9a3 Mon Sep 17 00:00:00 2001 From: Michael Lando Date: Sun, 11 Jun 2017 14:22:02 +0300 Subject: [SDC-29] rebase continue work to align source Change-Id: I218f1c5ee23fb2c8314f1c70921d3ad8682c10f4 Signed-off-by: Michael Lando --- .../dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java | 15 ++++++++++++--- .../impl/zusammen/LicenseAgreementDaoZusammenImpl.java | 9 +++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src') diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java index ee6ffbfca2..624ffeb05e 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/FeatureGroupDaoZusammenImpl.java @@ -176,8 +176,12 @@ public class FeatureGroupDaoZusammenImpl implements FeatureGroupDao { mapElementInfoToFeatureGroup(featureGroup.getId(), featureGroup.getVersion(), elementInfo.get()); - currentFeatureGroup.getEntitlementPoolIds().removeAll(removedEntitlementPools); - currentFeatureGroup.getEntitlementPoolIds().addAll(addedEntitlementPools); + if (!(removedEntitlementPools == null)) { + currentFeatureGroup.getEntitlementPoolIds().removeAll(removedEntitlementPools); + } + if (!(addedEntitlementPools == null)) { + currentFeatureGroup.getEntitlementPoolIds().addAll(addedEntitlementPools); + } if (featureGroupElement.getRelations() == null) { featureGroupElement.setRelations(new ArrayList<>()); } @@ -187,7 +191,12 @@ public class FeatureGroupDaoZusammenImpl implements FeatureGroupDao { .createRelation(RelationType.FeatureGroupToEntitlmentPool, relation)) .collect(Collectors.toList())); - currentFeatureGroup.getLicenseKeyGroupIds().removeAll(removedLicenseKeyGroups); + if (!(removedLicenseKeyGroups == null)) { + currentFeatureGroup.getLicenseKeyGroupIds().removeAll(removedLicenseKeyGroups); + } + if (!(addedLicenseKeyGroups == null)) { + currentFeatureGroup.getLicenseKeyGroupIds().addAll(addedLicenseKeyGroups); + } currentFeatureGroup.getLicenseKeyGroupIds().addAll(addedLicenseKeyGroups); featureGroupElement.getRelations() .addAll(currentFeatureGroup.getLicenseKeyGroupIds().stream() diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java index 55bbae9b33..45c831fbd7 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LicenseAgreementDaoZusammenImpl.java @@ -187,8 +187,13 @@ public class LicenseAgreementDaoZusammenImpl implements LicenseAgreementDao { mapElementInfoToLicenseAgreement(licenseAgreement.getId(), licenseAgreement.getVersion(), elementInfo.get()); - currentLicenseAgreement.getFeatureGroupIds().removeAll(removedFeatureGroupIds); - currentLicenseAgreement.getFeatureGroupIds().addAll(addedFeatureGroupIds); + if (! (removedFeatureGroupIds == null) ) { + currentLicenseAgreement.getFeatureGroupIds().removeAll(removedFeatureGroupIds); + } + + if (! (addedFeatureGroupIds == null)) { + currentLicenseAgreement.getFeatureGroupIds().addAll(addedFeatureGroupIds); + } licenseAgreementElement.setRelations(currentLicenseAgreement.getFeatureGroupIds().stream() .map(relation -> VlmZusammenUtil .createRelation(RelationType.LicenseAgreementToFeatureGroup, relation)) -- cgit 1.2.3-korg