- marked as minor
Changing the return type to void does not remove return values from message view
After changing the return type of an operation to void, if the message view had a return value, it is not being deleted and there is no way to remove it.
Steps to reproduce:
- Create a class
- Create an operation to this class with a return type other than void
- Create a message view and select a return value
- Go back to the structural view and update the return type of the operation to void
- Go to the message view, the return value is still there
Comments (31)
-
reporter -
- changed milestone to Introduction
-
Not sure if it should automatically remove it. It might be better to have a constraint and allow to remove it, because the modeller might not be aware of this problem otherwise.
-
reporter I think it is alright to not remove it automatically but it should allow to remove it manually.
-
-
assigned issue to
-
assigned issue to
-
I just realized that the same applies to assignments on message calls as well. If a message is created to an operation that does return something, in the UI there will be shown the assignment view. However, if the operation that is called is changed to return
void
this assignment is invalid. -
I tried to force TouchCORE to update the messageViewView every time that the user switches to the message view screen (from my understanding this was not the case before). I am unsure whether it affects the performance, but it seems to fix this issue (the assignment is removed when the return type is changed to
void
, at least visually).(I modified the
showMessageView
method in theDisplayAspectScene
class) -
Usually, all the updates come in as notifications from the model that something has changed. That's why this is generally not required to force updating at some point. So I consider this more of a workaround/hack ;)
The other issue is that this only removes it visually, however, in the model there is still (if it was set before) a reference in the message to a property (Message.assignTo).
For example, a similar problem existed when adding/removing a parameter from an operation. Because messages have a
ParameterValueMapping
for each parameter. See methodscreateParameter
/removeParameter
inClassController
. -
The other issue is that this only removes it visually, however, in the model there is still (if it was set before) a reference in the message to a property (Message.assignTo or Message.returns).
For this it would be good to have test cases.
-
References
#409: Adds the OCL constraint for invalid reply messages→ <<cset ea3d62811d16>>
-
References
#409: Adds the quickfix class→ <<cset 328a0276400b>>
-
References
#409: Adds quickfix class→ <<cset 66d87f42fae8>>
-
References
#409: Removes the return values when the quickfix is clicked→ <<cset 01e3df5a73d5>>
-
References
#409: Adds invalid assignemnts OCL constraint and quickfix→ <<cset 2f153827956a>>
-
References
#409: Updates message call views correctly when their return values are removed by the quickfix→ <<cset c17aafd3aa49>>
-
References
#409: Updates the message call views when their assignTo value is set to null→ <<cset 902ea64d519e>>
-
References
#409: Adds two quick fixes for void assignments→ <<cset d7bb9359a9b3>>
-
References
#409: Updates the OCL constraint→ <<cset 401b34113676>>
-
References
#409: Changes the quickfixes→ <<cset 227721523b53>>
-
References
#409: Adds signature highlighting when the validation error is selected→ <<cset 21a5204dc633>>
-
References
#409: Improves error messages→ <<cset 995242b42841>>
-
References
#409: Adds test case for changeAssignTo→ <<cset 5786b341e050>>
-
References
#409: Adds test case for change return value→ <<cset 0ffb8677a76c>>
-
References
#409: Fixes the temporary property issue→ <<cset 83cfaa4ccea8>>
-
References
#409: Changes the visibility of removeUnusedTemporaryProperties to protected→ <<cset e3f0a3060c9e>>
-
References
#409: Adds a test case for removeAssignTo(message, false) (keep assignments)→ <<cset 07437b20da22>>
-
References
#409: Removes the assignTo attribute of affected messages→ <<cset 9975706e0394>>
-
References
#409: Removes removal of all other assignments to the same property.Only the "assignTo" of the affected message is removed. In addition, if it assigned to a temporary property that is not assigned anywhere else, the property is also removed.
→ <<cset 86a23da87ea0>>
-
References
#409: Renames quickfix class to match its new purpose.→ <<cset a35fa9bedeef>>
-
References
#409& Bug fix: Fixes a bug in changeAssignTo and createTemporaryAssignment where temporary properties were always deleted.Now, the proper method from FragmentsController is used to determine whether temporary properties need to be removed.
Removal of assignment now uses changeAssignTo to set the assignment to null.
Adds additional test cases to handle the different cases.
→ <<cset 88ba4cff3c3d>>
-
- changed status to resolved
Resolved with pull request #104.
- Log in to comment