This PR reduces the complexity of change resolution and recording by removing obsolete logic that is not requires anymore.
Remove everything related to resolution of compound changes, since they do not exist anymore, and simplify the remaining resolution of atomic changes accordingly.
Make change resolution throw exceptions on failure rather than swalling of the error and just returning null or false. Since we expect changes to be resolved when calling the resolution logic (so returning null or false is never an acceptable result), this ensures that the code fails early and exactly where the failure occurs instead of propagating it to a later place where the unresolved change cannot be used anymore, which is much harder to identify and debug then.
Move test factories to test projects to clean up production code.
Move the logic for assigning IDs to changes after the recording phase to have a clear separation between the recording of changes (simply collecting the required objects and additional information) and the assignment of IDs to make the changes resolvable. While this will be particularly useful (and even necessary) later on when replacing UUIDs with a more lightweight ID mechanism, it, in my opinion, already improves the current design by proper separation of concerns, since recording resolved changes would be reasonable even without assigning (UU)IDs to resolve the change later on.
Moves the logic for hierarchic URI calculation to a utility class. We already had a discussion on that in #452, where we actually agreed on having the functionality be provided in a utility class and clearly indicating the limitations of its applicability. I've tried to clearly document the behavior and its limitations, so that it may not be used in an unintended way, even if we stick to the functionality and will not be able to remove it in future development.
Fixes a bug that caused applying commands for a ReplaceSingleValuedEReference of a reference having an EOpposite fail. This only occurs when applying according changes backwards, which we did not do before, such that this bug did not occur. In addition, this PR fixed the printed warnings when commands cannot be applied.
Removes all logic related to resolving changes in the state after the change as we do not need to support that scenario and it introduces unnecessary complexity. Thus basically everthing containing resolveAfter is removed.
Fixes a bug that led to faulty changes being created when changing the URI of a resource. This led to the change for the root removal also contain the resource after the URI change instead of the one before. This only leads to problems when applying such a change backwards, which we never did before, but now do because of adaptations of the change tests due to the removed functionality for resolving changes in the state after they have been applied.
This PR reduces the complexity of change resolution and recording by removing obsolete logic that is not requires anymore.
null
orfalse
. Since we expect changes to be resolved when calling the resolution logic (so returningnull
orfalse
is never an acceptable result), this ensures that the code fails early and exactly where the failure occurs instead of propagating it to a later place where the unresolved change cannot be used anymore, which is much harder to identify and debug then.ReplaceSingleValuedEReference
of a reference having anEOpposite
fail. This only occurs when applying according changes backwards, which we did not do before, such that this bug did not occur. In addition, this PR fixed the printed warnings when commands cannot be applied.resolveAfter
is removed.