Conversation
There was a problem hiding this comment.
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:
When evaluating the constraints, the results also showed satellitesytem files in the violations:
| /** 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) */ |
There was a problem hiding this comment.
First sentence of Javadoc is missing an ending period.
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.