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

Fix Deep and RoleTag accessor behavior #447

Merged
merged 2 commits into from
Aug 12, 2024
Merged

Fix Deep and RoleTag accessor behavior #447

merged 2 commits into from
Aug 12, 2024

Conversation

Wuestengecko
Copy link
Member

Fix the bugs in DeepProxyAccessor and RoleTagAccessor, discussed in #446.

By inheriting from DirectProxyAccessor, DeepProxyAccessor also
unintentionally inherited the behaviors that allowed creating objects.
This recently led to confusion as to what's possible and what isn't.

Part of the fix to #446.
Previously when retrieving objects using a RoleTagAccessor that has a
non-empty `classes` argument, objects that didn't match the specified
classes were simply filtered out and ignored.

This caused two problems:

1. It made it more difficult to spot potential metamodel mismatches with
   upstream Capella.
2. The implementation (using `ElementList.filter`) decoupled the list
   from the model and therefore prevented modifying the model through
   it.

This commit changes the implementation to strictly verify that the
actual classes match those expected by the metamodel, and will raise an
exception in case of any mismatch.

Part of the fix to #446.
@Wuestengecko Wuestengecko merged commit 5e0ca5e into master Aug 12, 2024
8 of 9 checks passed
@Wuestengecko Wuestengecko deleted the fix-446 branch August 12, 2024 13:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant