Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,43 @@ default List<PortUsageSymbol> resolvePortUsageLocallyMany(
return new ArrayList<>(inherited);
}

@Override
default List<PartUsageSymbol> resolvePartUsageLocallyMany(
boolean foundSymbols,
String name,
AccessModifier modifier,
Predicate<PartUsageSymbol> 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<RequirementSymbol> resolveAdaptedRequirementLocallyMany(
boolean foundSymbols,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

public class InheritedConnectionResolutionTest {

@Disabled("resolvePartUsageLocallyMany not overridden yet")
@Test
public void testAA3InheritedSubPartUsage() throws IOException {
LogStub.init();
Expand Down
Loading