From 00e935fc6b8baae4d9b9ffef2c748202a60b66b4 Mon Sep 17 00:00:00 2001 From: avigaffa Date: Sun, 10 Sep 2017 08:58:51 +0300 Subject: Add latest bug fixes to master Change-Id: Ieddc2330ad4e093984f14a69b52f2ca5cb465a10 Issue-ID: SDC-293 Signed-off-by: avigaffa --- .../healing/impl/SimpleHealingServiceImpl.java | 21 ++-- .../impl/VendorLicenseArtifactsServiceImpl.java | 118 +++++++++++---------- .../util/VendorLicenseArtifactsServiceUtils.java | 83 ++++++++++++--- 3 files changed, 145 insertions(+), 77 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/healing/impl/SimpleHealingServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java index eeed3b069d..7cb3e2e844 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/healing/impl/SimpleHealingServiceImpl.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.vendorlicense.healing.impl; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; @@ -41,9 +40,9 @@ import java.util.UUID; public class SimpleHealingServiceImpl implements HealingService { private static final EntitlementPoolDao entitlementPoolDao = - EntitlementPoolDaoFactory.getInstance().createInterface(); + EntitlementPoolDaoFactory.getInstance().createInterface(); private static final LicenseKeyGroupDao licenseKeyGroupDao = - LicenseKeyGroupDaoFactory.getInstance().createInterface(); + LicenseKeyGroupDaoFactory.getInstance().createInterface(); private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); @Override @@ -51,6 +50,15 @@ public class SimpleHealingServiceImpl implements HealingService { return handleMissingVersionId(toHeal, user); } + @Override + public void persistNoHealing(VersionableEntity alreadyHealed) { + if (alreadyHealed instanceof EntitlementPoolEntity) { + entitlementPoolDao.update((EntitlementPoolEntity) alreadyHealed); + } else if (alreadyHealed instanceof LicenseKeyGroupEntity) { + licenseKeyGroupDao.update((LicenseKeyGroupEntity) alreadyHealed); + } + } + private VersionableEntity handleMissingVersionId(VersionableEntity toHeal, String user) { @@ -68,11 +76,10 @@ public class SimpleHealingServiceImpl implements HealingService { licenseKeyGroupDao.update((LicenseKeyGroupEntity) toHeal); } else { MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.SELF_HEALING, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.UNSUPPORTED_OPERATION); + LoggerTragetServiceName.SELF_HEALING, ErrorLevel.ERROR.name(), + LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.UNSUPPORTED_OPERATION); throw new UnsupportedOperationException( - "Unsupported operation for 1610 release/1607->1610 migration."); - //todo maybe errorbuilder? + "Unsupported operation for 1610 release/1607->1610 migration."); } mdcDataDebugMessage.debugExitMessage(null, null); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java index 7d2cdc5474..282b4e6743 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java @@ -22,21 +22,18 @@ package org.openecomp.sdc.vendorlicense.licenseartifacts.impl; import org.apache.commons.collections.CollectionUtils; import org.openecomp.core.utilities.file.FileContentHandler; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.vendorlicense.HealingServiceFactory; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementPoolEntity; import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupEntity; import org.openecomp.sdc.vendorlicense.dao.types.FeatureGroupModel; import org.openecomp.sdc.vendorlicense.dao.types.LicenseKeyGroupEntity; -import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity; import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory; import org.openecomp.sdc.vendorlicense.healing.HealingService; import org.openecomp.sdc.vendorlicense.licenseartifacts.VendorLicenseArtifactsService; import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.VendorLicenseArtifact; import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.VnfLicenseArtifact; -import org.openecomp.sdc.vendorlicense.licenseartifacts.impl.util.VendorLicenseArtifactsServiceUtils; import org.openecomp.sdc.versioning.dao.types.Version; import java.util.Collection; @@ -48,18 +45,25 @@ import java.util.stream.Collectors; import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH; import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH; +import static org.openecomp.sdc.vendorlicense.licenseartifacts.impl.util.VendorLicenseArtifactsServiceUtils.filterChangedEntities; +import static org.openecomp.sdc.vendorlicense.licenseartifacts.impl.util.VendorLicenseArtifactsServiceUtils.getFinalVersionsForVlm; +import static org.openecomp.sdc.vendorlicense.licenseartifacts.impl.util.VendorLicenseArtifactsServiceUtils.getVendorName; +import static org.openecomp.sdc.vendorlicense.licenseartifacts.impl.util.VendorLicenseArtifactsServiceUtils.healEPs; +import static org.openecomp.sdc.vendorlicense.licenseartifacts.impl.util.VendorLicenseArtifactsServiceUtils.healLkgs; +import static org.openecomp.sdc.vendorlicense.licenseartifacts.impl.util.VendorLicenseArtifactsServiceUtils.prepareForFiltering; public class VendorLicenseArtifactsServiceImpl implements VendorLicenseArtifactsService { public static final VendorLicenseFacade vendorLicenseFacade = - VendorLicenseFacadeFactory.getInstance().createInterface(); + VendorLicenseFacadeFactory.getInstance().createInterface(); public static final HealingService healingService = - HealingServiceFactory.getInstance().createInterface(); + HealingServiceFactory.getInstance().createInterface(); private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); - static byte[] createVnfArtifact(String vspId, String vlmId, Version vlmVersion, String vendorName, - List featureGroups, String user) { + private static byte[] createVnfArtifact(String vspId, String vlmId, Version vlmVersion, + String vendorName, + List featureGroups, String user) { mdcDataDebugMessage.debugEntryMessage("VLM name", vendorName); @@ -68,31 +72,33 @@ public class VendorLicenseArtifactsServiceImpl implements VendorLicenseArtifacts artifact.setVspId(vspId); artifact.setVendorName(vendorName); - if(featureGroups != null) { + if (featureGroups != null) { for (String featureGroupId : featureGroups) { FeatureGroupModel featureGroupModel = vendorLicenseFacade - .getFeatureGroupModel(new FeatureGroupEntity(vlmId, vlmVersion, featureGroupId), user); - Set entitlementPoolEntities = featureGroupModel.getEntitlementPools(); - for(EntitlementPoolEntity entitlementPoolEntity : entitlementPoolEntities){ + .getFeatureGroupModel(new FeatureGroupEntity(vlmId, vlmVersion, featureGroupId), user); + Set entitlementPoolEntities = + featureGroupModel.getEntitlementPools(); + for (EntitlementPoolEntity entitlementPoolEntity : entitlementPoolEntities) { entitlementPoolEntity.setLimits(vendorLicenseFacade.listLimits(vlmId, vlmVersion, - entitlementPoolEntity.getId(), user)); + entitlementPoolEntity.getId(), user)); entitlementPoolEntity.setManufacturerReferenceNumber(featureGroupModel. - getEntityManufacturerReferenceNumber()); + getEntityManufacturerReferenceNumber()); } - Set licenseKeyGroupEntities = featureGroupModel.getLicenseKeyGroups(); - for(LicenseKeyGroupEntity licenseKeyGroupEntity : licenseKeyGroupEntities){ + Set licenseKeyGroupEntities = + featureGroupModel.getLicenseKeyGroups(); + for (LicenseKeyGroupEntity licenseKeyGroupEntity : licenseKeyGroupEntities) { licenseKeyGroupEntity.setLimits(vendorLicenseFacade.listLimits(vlmId, vlmVersion, - licenseKeyGroupEntity.getId(), user)); + licenseKeyGroupEntity.getId(), user)); licenseKeyGroupEntity.setManufacturerReferenceNumber(featureGroupModel. - getEntityManufacturerReferenceNumber()); + getEntityManufacturerReferenceNumber()); } featureGroupModel.setEntitlementPools(entitlementPoolEntities.stream().map( - entitlementPoolEntity -> (EntitlementPoolEntity) healingService - .heal(entitlementPoolEntity, user)).collect(Collectors.toSet())); + entitlementPoolEntity -> (EntitlementPoolEntity) healingService + .heal(entitlementPoolEntity, user)).collect(Collectors.toSet())); featureGroupModel.setLicenseKeyGroups(licenseKeyGroupEntities.stream().map( - licenseKeyGroupEntity -> (LicenseKeyGroupEntity) healingService - .heal(licenseKeyGroupEntity, user)).collect(Collectors.toSet())); + licenseKeyGroupEntity -> (LicenseKeyGroupEntity) healingService + .heal(licenseKeyGroupEntity, user)).collect(Collectors.toSet())); artifact.getFeatureGroups().add(featureGroupModel); } } @@ -101,7 +107,7 @@ public class VendorLicenseArtifactsServiceImpl implements VendorLicenseArtifacts return artifact.toXml().getBytes(); } - static byte[] createVendorLicenseArtifact(String vlmId, String vendorName, String user) { + private static byte[] createVendorLicenseArtifact(String vlmId, String vendorName, String user) { mdcDataDebugMessage.debugEntryMessage("VLM name", vendorName); @@ -111,43 +117,42 @@ public class VendorLicenseArtifactsServiceImpl implements VendorLicenseArtifacts Set entitlementPoolEntities = new HashSet<>(); Set licenseKeyGroupEntities = new HashSet<>(); - List finalVersions = VendorLicenseArtifactsServiceUtils.getFinalVersionsForVlm(vlmId); + List finalVersions = getFinalVersionsForVlm(vlmId); for (Version finalVersion : finalVersions) { Collection coll = vendorLicenseFacade.listEntitlementPools(vlmId, - finalVersion, user); - coll.stream().forEach( entitlementPoolEntity -> { + finalVersion, user); + coll.stream().forEach(entitlementPoolEntity -> { entitlementPoolEntity.setLimits(vendorLicenseFacade.listLimits(vlmId, finalVersion, - entitlementPoolEntity.getId(), user)); + entitlementPoolEntity.getId(), user)); Optional manufacturerReferenceNumber = getFeatureGroupManufactureRefNumber - (entitlementPoolEntity.getReferencingFeatureGroups(), vlmId, finalVersion, user); - manufacturerReferenceNumber.ifPresent(mrn -> entitlementPoolEntity - .setManufacturerReferenceNumber(mrn)); + (entitlementPoolEntity.getReferencingFeatureGroups(), vlmId, finalVersion, user); + manufacturerReferenceNumber + .ifPresent(entitlementPoolEntity::setManufacturerReferenceNumber); }); entitlementPoolEntities.addAll(coll); Collection coll2 = vendorLicenseFacade.listLicenseKeyGroups(vlmId, - finalVersion, user); + finalVersion, user); - coll2.stream().forEach( licenseKeyGroupEntity -> { + coll2.stream().forEach(licenseKeyGroupEntity -> { licenseKeyGroupEntity.setLimits(vendorLicenseFacade.listLimits(vlmId, finalVersion, - licenseKeyGroupEntity.getId(), user)); + licenseKeyGroupEntity.getId(), user)); Optional manufacturerReferenceNumber = getFeatureGroupManufactureRefNumber - (licenseKeyGroupEntity.getReferencingFeatureGroups(), vlmId, finalVersion, user); - manufacturerReferenceNumber.ifPresent(mrn -> licenseKeyGroupEntity - .setManufacturerReferenceNumber(mrn)); + (licenseKeyGroupEntity.getReferencingFeatureGroups(), vlmId, finalVersion, user); + manufacturerReferenceNumber + .ifPresent(licenseKeyGroupEntity::setManufacturerReferenceNumber); }); licenseKeyGroupEntities.addAll(coll2); } - entitlementPoolEntities = VendorLicenseArtifactsServiceUtils - .healEPs(user, - VendorLicenseArtifactsServiceUtils.filterChangedEntities(entitlementPoolEntities)); - licenseKeyGroupEntities = VendorLicenseArtifactsServiceUtils - .healLkgs(user, - VendorLicenseArtifactsServiceUtils.filterChangedEntities(licenseKeyGroupEntities)); - + entitlementPoolEntities = + healEPs(user, filterChangedEntities(prepareForFiltering(entitlementPoolEntities, user, + true))); + licenseKeyGroupEntities = + healLkgs(user, filterChangedEntities(prepareForFiltering(licenseKeyGroupEntities, user, + false))); vendorLicenseArtifact.setEntitlementPoolEntities(entitlementPoolEntities); vendorLicenseArtifact.setLicenseKeyGroupEntities(licenseKeyGroupEntities); @@ -156,30 +161,33 @@ public class VendorLicenseArtifactsServiceImpl implements VendorLicenseArtifacts } private static Optional getFeatureGroupManufactureRefNumber(Set featureGroupIds, - String vlmId, Version finalVersion, String user) { + String vlmId, + Version finalVersion, + String user) { String manufactureReferenceNumber = null; if (CollectionUtils.isNotEmpty(featureGroupIds)) { Object[] featureGroupIdsList = featureGroupIds.toArray(); - if (featureGroupIdsList != null && featureGroupIdsList.length > 0) { + if (featureGroupIdsList.length > 0) { FeatureGroupEntity featureGroup = - vendorLicenseFacade.getFeatureGroup(new FeatureGroupEntity(vlmId, finalVersion, - featureGroupIdsList[0].toString()), user); + vendorLicenseFacade.getFeatureGroup(new FeatureGroupEntity(vlmId, finalVersion, + featureGroupIdsList[0].toString()), user); manufactureReferenceNumber = featureGroup != null ? featureGroup - .getManufacturerReferenceNumber() : null; + .getManufacturerReferenceNumber() : null; } } return manufactureReferenceNumber != null ? Optional.of(manufactureReferenceNumber) : - Optional.empty(); + Optional.empty(); } /** * Create License Artifacts. - * @param vspId vspId - * @param vlmId vlmId - * @param vlmVersion vlmVersion + * + * @param vspId vspId + * @param vlmId vlmId + * @param vlmVersion vlmVersion * @param featureGroups featureGroups - * @param user user + * @param user user * @return FileContentHandler */ public FileContentHandler createLicenseArtifacts(String vspId, String vlmId, Version vlmVersion, @@ -189,12 +197,12 @@ public class VendorLicenseArtifactsServiceImpl implements VendorLicenseArtifacts mdcDataDebugMessage.debugEntryMessage("VSP Id", vspId); FileContentHandler artifacts = new FileContentHandler(); - String vendorName = VendorLicenseArtifactsServiceUtils.getVendorName(vlmId, user); + String vendorName = getVendorName(vlmId, user); artifacts.addFile(VNF_ARTIFACT_NAME_WITH_PATH, - createVnfArtifact(vspId, vlmId, vlmVersion, vendorName, featureGroups, user)); + createVnfArtifact(vspId, vlmId, vlmVersion, vendorName, featureGroups, user)); artifacts.addFile(VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH, - createVendorLicenseArtifact(vlmId, vendorName, user)); + createVendorLicenseArtifact(vlmId, vendorName, user)); mdcDataDebugMessage.debugExitMessage("VSP Id", vspId); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/util/VendorLicenseArtifactsServiceUtils.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/util/VendorLicenseArtifactsServiceUtils.java index f3e09766db..502aa350b9 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/util/VendorLicenseArtifactsServiceUtils.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/util/VendorLicenseArtifactsServiceUtils.java @@ -45,15 +45,15 @@ import java.util.Set; public class VendorLicenseArtifactsServiceUtils { private static final HealingService healingService = - HealingServiceFactory.getInstance().createInterface(); + HealingServiceFactory.getInstance().createInterface(); /** * maps the entities by id * * @return a Map of id -> list of versionable entities with that id */ - static MultiValuedMap mapById( - Collection versionableEntities) { + private static MultiValuedMap mapById( + Collection versionableEntities) { MultiValuedMap mappedById = new ArrayListValuedHashMap<>(); for (VersionableEntity ve : versionableEntities) { mappedById.put(ve.getId(), ve); @@ -64,16 +64,15 @@ public class VendorLicenseArtifactsServiceUtils { /** * For all entities with same id, only entities that differ from one another will be returned. * If no change has occured, the entity with the earlier VLM version will be returned. - * If only one version of said entitity exists it will be returned - * @param versionableEntities + * If only one version of said entities exists it will be returned * @return a list of entities that has been changed */ public static List filterChangedEntities( - Collection versionableEntities) { + Collection versionableEntities) { MultiValuedMap entitiesById = mapById( - versionableEntities); + versionableEntities); MultiValuedMap entitiesByVersionUuId = - new ArrayListValuedHashMap<>(); + new ArrayListValuedHashMap<>(); List changedOnly = new ArrayList<>(); for (String epId : entitiesById.keySet()) { @@ -86,7 +85,7 @@ public class VendorLicenseArtifactsServiceUtils { //for every list of eps which have the same uuid, get the one with the earliest vlm version. for (String versionUid : entitiesByVersionUuId.keySet()) { List versionableEntitiesForUuid = - (List) entitiesByVersionUuId.get(versionUid); + (List) entitiesByVersionUuId.get(versionUid); versionableEntitiesForUuid.sort(new VersionableEntitySortByVlmMajorVersion()); changedOnly.add(versionableEntitiesForUuid.get(0)); } @@ -99,7 +98,7 @@ public class VendorLicenseArtifactsServiceUtils { Set healed = new HashSet<>(); for (VersionableEntity licenseKeyGroupEntity : licenseKeyGroupEntities) { healed.add((LicenseKeyGroupEntity) VendorLicenseArtifactsServiceImpl.healingService - .heal(licenseKeyGroupEntity, user)); + .heal(licenseKeyGroupEntity, user)); } return healed; @@ -110,7 +109,7 @@ public class VendorLicenseArtifactsServiceUtils { Set healed = new HashSet<>(); for (VersionableEntity entitlementPoolEntity : entitlementPoolEntities) { healed.add((EntitlementPoolEntity) VendorLicenseArtifactsServiceImpl.healingService - .heal(entitlementPoolEntity, user)); + .heal(entitlementPoolEntity, user)); } return healed; @@ -118,15 +117,69 @@ public class VendorLicenseArtifactsServiceUtils { public static List getFinalVersionsForVlm(String vlmId) { VersionInfo versionInfo = - VendorLicenseArtifactsServiceImpl.vendorLicenseFacade - .getVersionInfo(vlmId, VersionableEntityAction.Read, ""); + VendorLicenseArtifactsServiceImpl.vendorLicenseFacade + .getVersionInfo(vlmId, VersionableEntityAction.Read, ""); return versionInfo.getFinalVersions(); } public static String getVendorName(String vendorLicenseModelId, String user) { return VendorLicenseArtifactsServiceImpl.vendorLicenseFacade - .getVendorLicenseModel(vendorLicenseModelId, null, user) - .getVendorLicenseModel().getVendorName(); + .getVendorLicenseModel(vendorLicenseModelId, null, user) + .getVendorLicenseModel().getVendorName(); } + + + /** + * Written to handle the consequences of ATTASDC-4780 where version_uuid was not saved or + * retrieved correctly by DAO for EPs and LKGs. Performs a healing of sorts according to the + * following : 1. all versions of a specific entity (EP or LKG that have the same invariant_uuid) + * are ordered by their VLM version 2. first element is sent to healing (which will set a + * versionUUID for it IF it doesnt exist) 3. each subsequent element is compared to previous . If + * same, UUID is copied from the previous element , if they differ - the current element is sent + * to healing as before. For VLMs created post-bugfix this code should not update any element + */ + public static Collection prepareForFiltering(Collection versionableEntities, String user, boolean isEP) { + MultiValuedMap entitiesById = mapById( + versionableEntities); + + for (String epId : entitiesById.keySet()) { + List versionableEntitiesForId = new ArrayList<>(); + versionableEntitiesForId.addAll(entitiesById.get(epId)); + versionableEntitiesForId.sort(new VersionableEntitySortByVlmMajorVersion()); + healingService.heal(versionableEntitiesForId.get(0), user); + for (int i = 1; i < versionableEntitiesForId.size(); i++) { + if (isEP) { + EntitlementPoolEntity current = (EntitlementPoolEntity) versionableEntitiesForId.get(i); + EntitlementPoolEntity previous = (EntitlementPoolEntity) versionableEntitiesForId + .get(i - 1); + if (current.equals(previous) && current.getVersionUuId() == null) { + current.setVersionUuId(previous.getVersionUuId()); + healingService.persistNoHealing(current); + } else { + versionableEntitiesForId.set(i, healingService.heal(versionableEntitiesForId.get(i), + user)); + } + + } else { + LicenseKeyGroupEntity current = (LicenseKeyGroupEntity) versionableEntitiesForId.get(i); + LicenseKeyGroupEntity previous = (LicenseKeyGroupEntity) versionableEntitiesForId + .get(i - 1); + if (current.equals(previous) && current.getVersionUuId() == null) { + current.setVersionUuId(previous.getVersionUuId()); + healingService.persistNoHealing(current); + } else { + versionableEntitiesForId.set(i, healingService.heal(versionableEntitiesForId.get(i), + user)); + } + + + } + } + } + return versionableEntities; + } + + } -- cgit 1.2.3-korg