Skip to content

Correct instance filename tracking#22

Open
uiysg wants to merge 7 commits intomainfrom
correct-instance-filename-tracking
Open

Correct instance filename tracking#22
uiysg wants to merge 7 commits intomainfrom
correct-instance-filename-tracking

Conversation

@uiysg
Copy link
Collaborator

@uiysg uiysg commented Feb 25, 2026

Instance filenames were tracked for every EObject in the containment tree, not just root objects. This caused violations to be reported multiple times for the same file. Now only root objects are indexed for filename lookup, while child objects remain available for allInstances() queries.

@uiysg uiysg requested a review from a team as a code owner February 25, 2026 13:35
@arlange arlange requested a review from FabianEger February 25, 2026 15:01
Copy link

@FabianEger FabianEger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fixed the problems stated in the Issue, but maybe I have to be a little bit more precise here. So, from a user perspective, it would be nice to not only get the file where an instance failed a constraint but also get the concrete instance. So maybe if we stick with the examples mentioned in the issue, it would be nice to have an error like: In file mission-apollo.spacemission at instance SpaceCraft with name Discovery the constraint failed. Furthermore, to test the cases where multiple instances in one file fail the constraint, I add two spacecrafts to the mission-apollo.spacemission:

image

When evaluating the constraints, the results also showed satellitesytem files in the violations:

Image

/** Ordered list of context-level (root) EObjects for index-based lookup from evaluator. */
private final List<EObject> contextObjects = new ArrayList<>();

/** Maps instance index to source filename for error reporting (index matches contextObjects) */
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [checkstyle] <com.puppycrawl.tools.checkstyle.checks.javadoc.SummaryJavadocCheck> reported by reviewdog 🐶
First sentence of Javadoc is missing an ending period.

@uiysg uiysg requested a review from FabianEger March 4, 2026 16:54
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.

3 participants