Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
skublik committed Oct 1, 2021
2 parents 02aebfc + 6574d57 commit 6e0be17
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -807,7 +807,7 @@ default List<? extends Task> listSubtasks(OperationResult parentResult) throws S
/**
* Changes in-memory representation immediately and schedules a corresponding batched modification.
*/
void modify(ItemDelta<?, ?> delta) throws SchemaException;
void modify(@NotNull ItemDelta<?, ?> delta) throws SchemaException;

/**
* Applies given collection of deltas.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ public OperationStatsType getStoredOperationStatsOrClone() {
return null;
}

@Override public void modify(ItemDelta<?, ?> delta) {
@Override public void modify(@NotNull ItemDelta<?, ?> delta) {
}

public void modifyAndFlush(ItemDelta<?, ?> delta, OperationResult result) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,10 +354,15 @@ void addPendingModification(ItemDelta<?, ?> delta) {
}

@Override
public void modify(ItemDelta<?, ?> delta) throws SchemaException {
public void modify(@NotNull ItemDelta<?, ?> delta) throws SchemaException {
LOGGER.debug("Applying {} to {}", delta, this);
if (isPersistent()) {
addPendingModification(delta);
// If we not cloned the delta, another thread might attempt to modify it, failing with CME
// (conflicting with delta.applyTo below). Note that deltas are not thread-safe. See MID-7264.
// An alternative would be to guard this code by prismAccess, along with the delta application below.
// But it would make delta accessible to a different thread nevertheless. The caller should be cautious
// not to access the delta after the call. We don't want to impose this restriction to the callers.
addPendingModification(delta.clone());
}
synchronized (prismAccess) {
delta.applyTo(taskPrism);
Expand Down

0 comments on commit 6e0be17

Please sign in to comment.