fix: offer the whole inheritance chain of a copied class (GH-259) - #261
Draft
spah-soptim wants to merge 1 commit into
Draft
spah-soptim wants to merge 1 commit into
spah-soptim wants to merge 1 commit into
Conversation
CopyClassReferenceResolver walked each copied class exactly once, so it only ever saw the direct super class. Copying GeneratingUnit out of an SSH schema therefore listed Equipment alone, while PowerSystemResource and IdentifiedObject above it were never discovered - not even the client could ask for them, because CopyClassService filters the resolver's output by URI, so a class the resolver never returned cannot be selected. Only data types were resolved transitively, because they are copied with their attributes. The pasted Equipment stub then lost its own super class as well: resolvableSuperClass dropped the link whenever the grandparent was neither copied nor already in the target, which severed the hierarchy instead of truncating it - and contradicted the top-level class, which keeps a left-behind super class as a reference. - resolve() now follows inheritance up to the root, naming every ancestor after the sub class that inherits from it, so the dialog reads "Equipment -> PowerSystemResource" - the walk stops above a class the target graph already defines: that class is not copied, so its super class would land in the target with nothing inheriting from it - a round that discovers nothing new ends the walk, which also terminates a cyclic hierarchy - a copied stub keeps its super class like the pasted class does, dangling as a reference when the ancestor stays behind, and drops it when the paste asks for no inheritance - the target graph is read only when there is a chain to walk at all Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Signed-off-by: Jan-Hendrik Spahn <jan-hendrik.spahn@soptim.de>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CopyClassReferenceResolver walked each copied class exactly once, so it only ever saw the direct super class. Copying GeneratingUnit out of an SSH schema therefore listed Equipment alone, while PowerSystemResource and IdentifiedObject above it were never discovered - not even the client could ask for them, because CopyClassService filters the resolver's output by URI, so a class the resolver never returned cannot be selected. Only data types were resolved transitively, because they are copied with their attributes.
The pasted Equipment stub then lost its own super class as well: resolvableSuperClass dropped the link whenever the grandparent was neither copied nor already in the target, which severed the hierarchy instead of truncating it - and contradicted the top-level class, which keeps a left-behind super class as a reference.
Related Issues
Closes #259
Checklist
git commit -s) for DCOTesting Notes