-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Java in-memory model may not match underlying files #130
Comments
A test case which is already in use and which suffers from the same problem. In this specific case the Java files are not moved to the correct directory. |
That's interesting. The essential problem is that the persistence of references uses information that may change without affecting the in-memory representation of a reference. So I see three options:
Currently, either solution will work without noticable drawbacks. I am not in favor of querying cross references on every change. On the other hand, having large projects with a bunch of Java files may result in long saving times. Finally, it is not even necessary to always save the resources in the |
I would be in favour of your options 1 resp. 2. The only reason for option 3 from my perspective is reduced complexity but adding one more method to the VitruvDomain like
My first idea - which fits good with this comment - was to perform saving after a complete change propagation cycle (i.e. |
When propagating changes to the Java domain, the in-memory model might differ from the underlying files after finishing the propagation. This happens when a change indirectly affects objects which are not part of the actual
VitruviusChange
.This is a critical issue, as our test logic uses the in-memory model instead of the underlying files to validate tests thus this issue cannot be discovered by our current test setup.
It seems that the bug is related to determining which files need to be re-written, as the file gets correctly updated when, in addition to the indirect change, a direct change to the affected object is recorded.
Example
To illustrate this problem, let's consider the UML -> Java case and assume there exist 2 classes in both UML and Java,
A
andB
, andA
has an attribute of typeB
. If nowB
is renamed toC
in UML and changes are propagated, the in-memory model of Java correctly reflects this changes (attribute is of typeC
). However, in the generated files,A
is not updated and still refers toB
.If in addition to the renaming of
B
some direct change toA
is applied (like a rename / new attribute / new operation / ...) the file is correctly updated.Example test case
Uses the context of UmlToJavaAttributeTest
The text was updated successfully, but these errors were encountered: