Deleting message broken
As first pointed out in pull request #76 (see comment), the deleting of messages is somewhat broken.
Consider the following example:
When deleting the message betterName := betterName()
from target
, the following two errors occur:
- the assignment statement inside the combined fragment is not deleted properly (i.e., it is deleted, because it's container is removed, however, it is still referenced by the lifeline)
- the message inside the combined fragment is not removed from the interaction
This shows that the way of how messages are removed is not ideal. Currently, all fragments are collected between the first and last found index, however, messages inside combined fragments are not dealt with specifically. Also, fragments inside combined fragments are not handled specifically.
I propose to use the createRemoveInteractionFragmentCommand
of FragmentsController
, which already takes care of all the different fragments, and messages inside combined fragments.
Comments (11)
-
reporter -
reporter References
#438: Adds test cases for message removal.→ <<cset 92fb38ded429>>
-
reporter References
#438: Refactors test cases for message removal.Adds specific model for message removal tests. Adds additional test case for assignment statement.
→ <<cset 13fe29a66358>>
-
reporter References
#438: Adds test cases for removal of empty lifelines after message removal.→ <<cset 975dfe4c4cc7>>
-
reporter References
#438and#194: Adds more test cases for nested behaviour.Also, for
#194, a specific test case is added (testRemoveMessages_NestedNestedBehaviour), which fails right now.→ <<cset 8f664f61f16c>>
-
reporter References
#438and#194: Adds another test case for nested nested behaviour.This test cases checks the second case of getting the toIndex, where no other fragment is on the outgoing lifeline, which causes only the one message being removed.
→ <<cset 5edfe37d93f6>>
-
reporter References
#304,#438,#194: Improves removal of fragments and messages.All removal is now performed by the FragmentsController, i.e., the MessageViewController delegates this task to it now.
Removal is improved significantly in that: - all to be deleted fragments are determined - all affected messages are deleted - unused properties are removed - unused combined fragments are removed from lifelines (when no other fragment within a combined fragment covers a lifeline) - unused lifelines are removed
The end of the message behaviour (for nested behaviour) is properly detected. Nested behaviour needs to be terminated with a reply message. However, it still works in the case that another fragment is placed on the same originating lifeline.
→ <<cset 569a78a97a89>>
-
reporter References
#304,#438,#194: Fixes test cases and models to address changes introduced.Create message with nested behaviour now have a reply message. When removing a combined fragment or operand, the fragments are not specifically removed, but are removed by removing the container (operand).
→ <<cset 0dadc71a6aea>>
-
reporter References
#304,#438,#194: Moves helper method to remove temporary properties to FragmentsController.→ <<cset 225c64c31658>>
-
reporter - changed status to resolved
Merged in Issues/165-MessageView-Improvements (pull request #94)
Message View Moving and Stability and Association and Code Generator Improvements
Resolves
#165,#304,#438,#194Approved-by: Emmanuel Ng Cheng Hin emmanuel.ngchenghin@mail.mcgill.ca
→ <<cset 5cb678b133d5>>
-
reporter References
#304,#438,#194: Fixes order of fragment removal commands to prevent problem when undoing.The call to isSelfMessage caused an OCL exception because the coveredBy of the send event was not set yet. Therefore the coveredBy is removed separately after all fragments are removed, so that this is already set when undoing it.
Small refactoring in MessageViewController to pass the message instead of the end, to ensure that the send event is passed to removeInteractionFragment.
→ <<cset f8ccee565d88>>
- Log in to comment
See also
#305which seems to be related.