From 743be4d126ea6569251715d3e602f0ac16c04001 Mon Sep 17 00:00:00 2001 From: linggd Date: Wed, 30 Sep 2026 19:49:35 +0200 Subject: [PATCH 1/2] fix inherited partusages in connection --- .../sysmlv2/_symboltable/ISysMLv2Scope.java | 37 +++++++++++++++++++ .../InheritedConnectionResolutionTest.java | 1 - 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/language/src/main/java/de/monticore/lang/sysmlv2/_symboltable/ISysMLv2Scope.java b/language/src/main/java/de/monticore/lang/sysmlv2/_symboltable/ISysMLv2Scope.java index 771a8fdb..fe5527be 100644 --- a/language/src/main/java/de/monticore/lang/sysmlv2/_symboltable/ISysMLv2Scope.java +++ b/language/src/main/java/de/monticore/lang/sysmlv2/_symboltable/ISysMLv2Scope.java @@ -298,6 +298,43 @@ default List resolvePortUsageLocallyMany( return new ArrayList<>(inherited); } + @Override + default List resolvePartUsageLocallyMany( + boolean foundSymbols, + String name, + AccessModifier modifier, + Predicate predicate + ) { + var resolved = + ISysMLv2ScopeTOP.super.resolvePartUsageLocallyMany( + foundSymbols, + name, + modifier, + predicate + ); + + if (!resolved.isEmpty() + || !isPresentSpanningSymbol() + || !(getSpanningSymbol() instanceof PartDefSymbol) + || !getSpanningSymbol().isPresentAstNode()) { + return resolved; + } + + var inherited = ((PartDefSymbol) getSpanningSymbol()).getAstNode() + .getSpecializationList().stream() + .filter(s -> s instanceof ASTSysMLSpecialization) + .flatMap(s -> s.getSuperTypesList().stream()) + .map(s -> s.getDefiningSymbol()) + .filter(s -> s.isPresent()) + .map(s -> s.get()) + .filter(s -> s instanceof PartDef2TypeSymbolAdapter) + .map(s -> (ISysMLv2Scope)((PartDef2TypeSymbolAdapter) s).getSpannedScope()) + .flatMap(scope -> scope.resolvePartUsageLocallyMany(false, name, modifier, predicate).stream()) + .collect(Collectors.toCollection(LinkedHashSet::new)); + + return new ArrayList<>(inherited); + } + @Override default List resolveAdaptedRequirementLocallyMany( boolean foundSymbols, diff --git a/language/src/test/java/cocos/InheritedConnectionResolutionTest.java b/language/src/test/java/cocos/InheritedConnectionResolutionTest.java index c2750ef5..67ae5da5 100644 --- a/language/src/test/java/cocos/InheritedConnectionResolutionTest.java +++ b/language/src/test/java/cocos/InheritedConnectionResolutionTest.java @@ -19,7 +19,6 @@ public class InheritedConnectionResolutionTest { - @Disabled("resolvePartUsageLocallyMany not overridden yet") @Test public void testAA3InheritedSubPartUsage() throws IOException { LogStub.init(); From 34f1c3a7eb0246ee899cf0c3bcea3a70ea2478b7 Mon Sep 17 00:00:00 2001 From: linggd Date: Wed, 30 Sep 2026 19:52:17 +0200 Subject: [PATCH 2/2] bump version to 7.8.97 --- gradle.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle.properties b/gradle.properties index 5847eead..595e1afe 100644 --- a/gradle.properties +++ b/gradle.properties @@ -25,4 +25,4 @@ assertj_version = 3.21.0 junit_version = 5.8.2 # Version of published artifacts -version = 7.8.96 +version = 7.8.97