Skip to content

Commit be38610

Browse files
authored
Merge pull request #494 from Systems-Modeling/ST6RI-703
ST6RI-699 End features inherited via feature chains are not redefined
2 parents a7279b1 + bb56da8 commit be38610

4 files changed

Lines changed: 15 additions & 7 deletions

File tree

kerml/src/examples/Simple Tests/Connectors.kerml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ package Connectors {
44
feature a : A;
55
feature b : A;
66

7-
connector from a to b;
8-
connector {
7+
connector c1 from a to b;
8+
connector c2 {
99
end feature references a;
1010
end feature references b;
1111
}
@@ -24,4 +24,9 @@ package Connectors {
2424
end feature references b;
2525
}
2626
}
27+
28+
class B {
29+
feature a : A;
30+
connector :> a.c1 from a.a to a.b;
31+
}
2732
}

org.omg.kerml.xpect.tests/src/org/omg/kerml/xpect/tests/validation/ConnectorTest_NestedConnectorConnectingEndsGoodCase.kerml.xt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ package test{
2828
feature z;
2929
}
3030

31-
connector from end1 to f.z;
31+
connector c from end1 to f.z;
3232
}
3333

34-
connector c:A from x to y;
34+
connector a:A from x to y;
35+
36+
// Checks that ends from connector c are redefined.
37+
connector :> a.c from a.end1 to a.f.z;
3538
}

org.omg.sysml/src/org/omg/sysml/util/TypeUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private static List<Feature> getAllEndFeaturesOf(Type type, Set<Type> visited) {
157157
visited.add(type);
158158
List<Feature> ends = getOwnedEndFeaturesOf(type);
159159
int n = ends.size();
160-
for (Type general: getSupertypesOf(type)) {
160+
for (Type general: getGeneralTypesOf(type)) {
161161
if (general != null && !visited.contains(general)) {
162162
List<Feature> inheritedEnds = getAllEndFeaturesOf(general, visited);
163163
if (inheritedEnds.size() > n) {

sysml/src/examples/Flashlight Example/Flashlight Example.sysml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ package 'Flashlight Example' {
2020
}
2121

2222
interface userToFlashlight connect user.onOffCmdPort to flashlight.onOffCmdPort {
23-
ref flow :> illuminateRegion.onOffCmdFlow
24-
from source.onOffCmd to target.onOffCmd;
23+
ref flow references illuminateRegion.onOffCmdFlow
24+
from source.onOffCmd to target.onOffCmd;
2525
}
2626

2727
part flashlight {

0 commit comments

Comments
 (0)