From 11c43843cc8da467e1c43fc2dc0e88a6667168af Mon Sep 17 00:00:00 2001 From: Avi Ziv Date: Sun, 16 Jul 2017 15:21:15 +0300 Subject: [SDC] OnBoarding rebase. Change-Id: I07d496057b8057e953c97c99a19fae9e406b7e35 Signed-off-by: Avi Ziv Signed-off-by: Michael Lando --- .../dao/impl/zusammen/EntitlementPoolZusammenDaoImpl.java | 4 +++- .../dao/impl/zusammen/LicenseKeyGroupZusammenDaoImpl.java | 9 +++++---- 2 files changed, 8 insertions(+), 5 deletions(-) (limited to 'openecomp-be/lib') 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/EntitlementPoolZusammenDaoImpl.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/EntitlementPoolZusammenDaoImpl.java index ffaf7809c8..a31210a81a 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/EntitlementPoolZusammenDaoImpl.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/EntitlementPoolZusammenDaoImpl.java @@ -83,7 +83,9 @@ public class EntitlementPoolZusammenDaoImpl implements EntitlementPoolDao { if (entitlmentpoolElement.getRelations() == null) { entitlmentpoolElement.setRelations(new ArrayList<>()); } - entitlmentpoolElement.getRelations().addAll(epFromDb.get().getRelations()); + if (epFromDb.get().getRelations() != null) { + entitlmentpoolElement.getRelations().addAll(epFromDb.get().getRelations()); + } } zusammenAdaptor.saveElement(context,elementContext, entitlmentpoolElement, 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/LicenseKeyGroupZusammenDaoImpl.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/LicenseKeyGroupZusammenDaoImpl.java index 03537a287b..f5d905cf35 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/LicenseKeyGroupZusammenDaoImpl.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/LicenseKeyGroupZusammenDaoImpl.java @@ -74,14 +74,15 @@ public class LicenseKeyGroupZusammenDaoImpl implements LicenseKeyGroupDao { Optional lkgFromDb = zusammenAdaptor.getElementInfo(context, elementContext, new Id(licenseKeyGroup.getId())); - if(lkgFromDb.isPresent()) { + if (lkgFromDb.isPresent()) { - if( licenseKeyGroupElement.getRelations() == null) { + if (licenseKeyGroupElement.getRelations() == null) { licenseKeyGroupElement.setRelations(new ArrayList<>()); } - lkgFromDb.get().getRelations().forEach(relation -> - licenseKeyGroupElement.getRelations().add(relation)); + if (lkgFromDb.get().getRelations() != null) { + licenseKeyGroupElement.getRelations().addAll(lkgFromDb.get().getRelations()); + } } zusammenAdaptor.saveElement(context, elementContext, -- cgit 1.2.3-korg