Skip to content
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

Unset model operation handling is broken #346

Closed
pcdavid opened this issue Feb 25, 2021 · 1 comment · Fixed by #354
Closed

Unset model operation handling is broken #346

pcdavid opened this issue Feb 25, 2021 · 1 comment · Fixed by #354

Comments

@pcdavid
Copy link
Member

pcdavid commented Feb 25, 2021

The implementation in org.eclipse.sirius.web.emf.compatibility.modeloperations.UnsetOperationHandler which handles the Unset model operations that can be used in Sirius Desktop VSMs is broken. It does not match the Sirius Desktop behavior as defined in org.eclipse.sirius.business.internal.helper.task.operations.UnsetTask.

@pcdavid
Copy link
Member Author

pcdavid commented Feb 25, 2021

There are at least two issues:

  • Although it is not typed as an expression, Sirius Desktop actually evaluates the featureName as one (see org.eclipse.sirius.business.internal.helper.task.operations.UnsetTask.execute())
  • The current implementation in Sirius Components never calls eRemove. It's either eAdd (which makes no sense for an "Unset" operation) or eSet (which is called will null to implement a "clear/unset" operation).

pcdavid added a commit that referenced this issue Feb 26, 2021
The previous implementation did not actually match the behavior of
Sirius Desktop on several points:
- the `featureName` was taken as a fixed string, but Sirius Desktop
  evaluates it as a dynamic expression;
- the previous implementation could never actually remove individual
  elements from a multi-valued feature, only reset/clear it.

In addition, I've restructured the code and inlined the actual
behavior of EcoreIntrinsicExtender for the concrete cases we use it to
avoid the dependency and indirection.

Bug: #346
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
@sbegaudeau sbegaudeau added this to the 0.3.0 milestone Mar 2, 2021
pcdavid added a commit that referenced this issue Mar 4, 2021
The previous implementation did not actually match the behavior of
Sirius Desktop on several points:
- the `featureName` was taken as a fixed string, but Sirius Desktop
  evaluates it as a dynamic expression;
- the previous implementation could never actually remove individual
  elements from a multi-valued feature, only reset/clear it.

In addition, I've restructured the code and inlined the actual
behavior of EcoreIntrinsicExtender for the concrete cases we use it to
avoid the dependency and indirection.

Bug: #346
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
pcdavid added a commit that referenced this issue Mar 4, 2021
The previous implementation did not actually match the behavior of
Sirius Desktop on several points:
- the `featureName` was taken as a fixed string, but Sirius Desktop
  evaluates it as a dynamic expression;
- the previous implementation could never actually remove individual
  elements from a multi-valued feature, only reset/clear it.

In addition, I've restructured the code and inlined the actual
behavior of EcoreIntrinsicExtender for the concrete cases we use it to
avoid the dependency and indirection.

Bug: #346
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
sbegaudeau pushed a commit that referenced this issue Mar 8, 2021
The previous implementation did not actually match the behavior of
Sirius Desktop on several points:
- the `featureName` was taken as a fixed string, but Sirius Desktop
  evaluates it as a dynamic expression;
- the previous implementation could never actually remove individual
  elements from a multi-valued feature, only reset/clear it.

In addition, I've restructured the code and inlined the actual
behavior of EcoreIntrinsicExtender for the concrete cases we use it to
avoid the dependency and indirection.

Bug: #346
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
@sbegaudeau sbegaudeau linked a pull request Mar 8, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants