Skip to content

Commit

Permalink
improved delta preprocessing
Browse files Browse the repository at this point in the history
  • Loading branch information
1azyman committed Jan 31, 2018
1 parent 8928826 commit 14435e1
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -114,15 +114,15 @@ public <T extends ObjectType> RObject<T> modifyObject(Class<T> type, String oid,
// preprocess modifications
PrismObject changed = prismObject.clone();
ItemDelta.applyTo(modifications, changed);
modifications = prismObject.diffModifications(changed, false,true);
Collection<? extends ItemDelta> processedModifications = prismObject.diffModifications(changed, false,true);

// process only real modifications
Class<? extends RObject> objectClass = RObjectType.getByJaxbType(type).getClazz();
RObject<T> object = session.byId(objectClass).getReference(oid);

ManagedType mainEntityType = entityRegistry.getJaxbMapping(type);

for (ItemDelta delta : modifications) {
for (ItemDelta delta : processedModifications) {
ItemPath path = delta.getPath();

if (isObjectExtensionDelta(path) || isShadowAttributesDelta(path)) {
Expand Down Expand Up @@ -170,7 +170,7 @@ public <T extends ObjectType> RObject<T> modifyObject(Class<T> type, String oid,
}
}

handleObjectCommonAttributes(type, modifications, prismObject, object);
handleObjectCommonAttributes(type, processedModifications, prismObject, object);

LOGGER.debug("Entity changes applied");

Expand Down

0 comments on commit 14435e1

Please sign in to comment.