Skip to content

Commit

Permalink
Fix extended rule source with extended type (#934)
Browse files Browse the repository at this point in the history
* Fix extended rule source with extended type

* Fix test
  • Loading branch information
hugohills-regnosys authored Feb 24, 2025
1 parent e236a83 commit c466b11
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public List<ExternalAnnotationSource> getSuperSources(ExternalAnnotationSource s

public Optional<RosettaExternalClass> getExternalType(ExternalAnnotationSource source, RDataType type) {
for (RosettaExternalClass extT: source.getExternalClasses()) {
if (extT.getTypeRef().equals(type.getEObject())) {
if (type.getAllSuperTypes().stream().anyMatch(t -> extT.getTypeRef().equals(t.getEObject()))) {
return Optional.of(extT);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,23 +678,19 @@ class TabulatorTest {
extract value/2
rule source BaseRuleSource {
BaseReport:
Report:
- basic1
+ basic1
[ruleReference Basic1InSource]
+ basic2
[ruleReference Basic2]
Report:
+ basic2
[ruleReference Basic2]
}
rule source RuleSource extends BaseRuleSource {
BaseReport:
Report:
- basic1
+ basic1
[ruleReference Basic1InSourceModified]
Report:
- basic2
+ basic2
[ruleReference Basic2Modified]
Expand Down

0 comments on commit c466b11

Please sign in to comment.