Decide on how to decide if two PCVs are equal, e.g. for the reasons of
- calling item.remove(value) e.g. when applying an item delta with a "delete" part,
- comparing PCs,
- computing diff for two PCs,
- deleting values from item delta.
Current approach is not well defined. For example, item.remove(value) consider two PCVs equal if
- either they "represent the same value" - i.e. they have the same IDs, or in lax mode, at least one is single-valued,
- or they "have the same real value" (equalsRealValue) - i.e. their content is the same, irrespective of IDs and operational items
This caused problems recently because wrong triggers got deleted (see TestParseDiffPatch.testCampaign). Solution was to set trigger timestamp to be NOT operational. See https://github.com/Evolveum/midpoint/commit/9556eccae0149e050e22183e4ff020c05100a0b4.
Other places might treat this a bit differently. We have to unify this. Search for the ID of this issue in the source code.
(For PRVs, situation is also interesting: representSameValue means OID + relation equality, which is also to be discussed.)