Closed jGleitz closed 3 years ago
corresponding application change: https://github.com/vitruv-tools/Vitruv-Applications-ComponentBasedSystems/pull/118
I fixed the failing test. This was actually an error in the production code, however, I don’t know why we didn’t discover it sooner.
I updated this branch to match the latest master
. It is ready for review.
This PR contains a weird race condition where models are not saved if you don’t debug through the code slowly enough.
That sounds really strange. I hope that the race condition is actually "only" an issue of this PR and was not introduced by a recent one, which we did not recognize before merging it? At least, those PRs changed synchronization behavior and placement of the save
operation for the VirtualModel
.
It seems to affect only the Commonalities, which could mean that the IntermediateResourceBridgeI
hack broke.
‘Fixed’ it by mimicking the old behaviour more closely. Somehow this error occurred when recording separately for every ChangePropagationSpecification
was not introduced by a recent one, which we did not recognize before merging it?
No, it was specific to this PR. I still don’t understand why the issue sometimes did not occur when debugging, though.
ResourceRepository
did not create copies of the lists it hands out. I fixed that and went back to trusting ChangePropagationSpecifications
regarding which domain was changedAtomicEmfChangeRecorder
because it contained quite some convoluted code.AtomicEmfChangeRecorder
’s functionality of removing create changes that are followed by a delete. I had multiple reasons for this change:
All tests pass now, as far as I can see.
Okay, so now I have pushed two more changes:
CompositeChange
immutable. Together with the polymorphic copy
method, this brings us one step closer to immutable changesConcreteChangeWithFixedVuri
since it is not needed for normal domains. Introduce a similar class in the Java domain instead. This means that this PR now also requires a change to the Java domain: https://github.com/vitruv-tools/Vitruv-Domains-ComponentBasedSystems/pull/86
All in all, this PR has gotten pretty big. I didn’t anticipate that supporting changes to multiple resources would result in so many changes to the framework. Neither was I planning to do yet another big refactoring. But hey, I think the framework improved quite a bit with this.
This should hopefully be the final state and ready for review.
:+1:
:angry:. I made sure to check all tests, but forgot about the transitive change tests. The errors are cryptic and I have no idea what’s going wrong. The Commonalities and Mappings Tests work fine, though.
After rebasing on #419, this PR only fails the Transactional tests. A lot of those failures are related to the TUID mechanism that causes bad unloads. So I propose to wait with this PR until we migrated entirely to UUIDs.
I merged this branch with master
and it is now ready for review.
Regarding whether composite changes should take a List
or a Collection
: I used the most general interface possible (Iterable
is not possible because we'll just size
when copying).
The collection will be copied and internally will always be a List
. The current state allows to pass on something like a LinkedHashSet
. That would not be possible if a List
was required.
So I don't object to changing to List
, but I also don't see the need.
To me, it'a bit weird that one can pass an unordered collection to a change which then becomes an order assigned, which is then also used to compare the changes. If an order is important (and in my opinion it is important for changes), it should already be clarified when passing it to a composite change.
We may also pass an Iterable
instead of a List
to cover your issue with LinkedHashSet
. I do not understand you point why this should not be possible. We take the Iterable
and internally store it in a List
, like we do now for the passed Collection
?
I do not understand you point why this should not be possible.
It’s possible but more cumbersome. The nice thing about List#copyOf
is that it doesn’t create a copy if the list is already read-only. But List#copyOf only takes a Collection
.
To me, it'a bit weird that one can pass an unordered collection to a change which then becomes an order assigned, which is then also used to compare the changes.
We may also pass an
Iterable
instead of aList
Those two statements are somewhat contradictory since Collection
inherits from Iterable
. So in both cases, Collection
and Iterable
, we’d just make a copy of the collection in the order of iteration.
I changed the constructors to take a List
. The factories still take an Iterable
. Should I change this too?
For me, it's fine to accept an Iterable
, so you can keep it as it is.
@HeikoKlare I pushed some more cleanup:
EChange#getInvolvedObjects
and ConcreteChange#affectedObjectsEquals
ChangedResourceTracker
ChangePropagator
Perfect, thanks! All changes are fine for me. I make a final run of the applications against these changes and merge them afterwards.
This seems to work with all tests, ~except for one:
OperationRequiredRoleMappingTransformationTest#testChangeOperationRequiredRole
~Changes:
VitruviusChange
s don’t store a URI any more, but derive it from the resolvedEChange
ChangePropagationSpecification
regarding which domain was modifiedVitruviusChange
s