Skip to content

Commit

Permalink
Fixes after refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
semancik committed Jul 30, 2014
1 parent 0bdde0f commit 1c579c7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Expand Up @@ -936,6 +936,13 @@ public static void applyTo(Collection<? extends ItemDelta> deltas, PrismContaine
}
}

public static void applyToMatchingPath(Collection<? extends ItemDelta> deltas, PrismContainer propertyContainer)
throws SchemaException {
for (ItemDelta delta : deltas) {
delta.applyToMatchingPath(propertyContainer);
}
}

public void applyTo(Item item) throws SchemaException {
ItemPath itemPath = item.getPath();
ItemPath deltaPath = getPath();
Expand All @@ -947,7 +954,7 @@ public void applyTo(Item item) throws SchemaException {
if (item instanceof PrismContainer<?>) {
PrismContainer<?> container = (PrismContainer<?>)item;
ItemPath remainderPath = deltaPath.remainder(itemPath);
Item subItem = container.findOrCreateItem(remainderPath, getItemClass());
Item subItem = container.findOrCreateItem(remainderPath, getItemClass(), getDefinition());
applyToMatchingPath(subItem);
} else {
throw new SchemaException("Cannot apply delta "+this+" to "+item+" as delta path is below the item path and the item is not a container");
Expand Down
Expand Up @@ -625,7 +625,7 @@ private Collection<PropertyModificationOperation> distillRenameDeltas(Collection
return null;
}

PrismProperty<String> name = nameDelta.getPropertyNew();
PrismProperty<String> name = nameDelta.getPropertyNewMatchingPath();
String newName = name.getRealValue();

Collection<PropertyModificationOperation> deltas = new ArrayList<PropertyModificationOperation>();
Expand Down

0 comments on commit 1c579c7

Please sign in to comment.