|
19 | 19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; |
20 | 20 | import org.eclipse.emf.ecore.util.EObjectEList; |
21 | 21 | import org.eclipse.emf.ecore.util.InternalEList; |
22 | | -import org.omg.sysml.lang.sysml.Association; |
23 | 22 | import org.omg.sysml.lang.sysml.BindingConnector; |
24 | 23 | import org.omg.sysml.lang.sysml.Category; |
25 | | -import org.omg.sysml.lang.sysml.Connector; |
26 | 24 | import org.omg.sysml.lang.sysml.EndFeatureMembership; |
27 | 25 | import org.omg.sysml.lang.sysml.Expression; |
28 | 26 | import org.omg.sysml.lang.sysml.Feature; |
@@ -328,14 +326,18 @@ public boolean hasValueType() { |
328 | 326 | } |
329 | 327 |
|
330 | 328 | public EList<Subsetting> getOwnedSubsettingWithComputedRedefinitions(String subsettingDefault) { |
331 | | - EList<Subsetting> redefinitions = getComputedRedefinitions(); |
332 | | - return redefinitions.isEmpty()? getOwnedSubsettingWithDefault(subsettingDefault): redefinitions; |
| 329 | + getComputedRedefinitions(); |
| 330 | + return getOwnedSubsettingWithDefault(subsettingDefault); |
333 | 331 | } |
334 | 332 |
|
335 | 333 | public EList<Subsetting> getOwnedSubsettingWithDefault(String subsettingDefault) { |
336 | 334 | return getOwnedGeneralizationWithDefault(Subsetting.class, SysMLPackage.FEATURE__OWNED_SUBSETTING, SysMLPackage.eINSTANCE.getSubsetting(), subsettingDefault); |
337 | 335 | } |
338 | 336 |
|
| 337 | + public EList<Subsetting> getOwnedSubsettingWithoutDefault() { |
| 338 | + return getOwnedGeneralizationWithoutDefault(Subsetting.class, SysMLPackage.FEATURE__OWNED_SUBSETTING); |
| 339 | + } |
| 340 | + |
339 | 341 | public EList<Redefinition> getOwnedRedefinitionsWithoutDefault() { |
340 | 342 | return getOwnedGeneralizationWithoutDefault(Redefinition.class, SysMLPackage.FEATURE__OWNED_REDEFINITION); |
341 | 343 | } |
@@ -387,16 +389,13 @@ protected void addRedefinitions(EList<Subsetting> redefinitions, List<Redefiniti |
387 | 389 |
|
388 | 390 | /** |
389 | 391 | * Get the relevant Features that may be redefined from the given Category. |
390 | | - * (By default, these are the end Features if the Category is a Association or a Connector.) |
| 392 | + * (By default, these are the end Features of the Category.) |
391 | 393 | */ |
392 | 394 | protected List<? extends Feature> getRelevantFeatures(Category category) { |
393 | 395 | return getOwningFeatureMembership() instanceof EndFeatureMembership? |
394 | | - category instanceof Association? |
395 | | - ((Association)category).getOwnedEndFeatureMembership().stream(). |
396 | | - map(m->m.getMemberFeature()).collect(Collectors.toList()): |
397 | | - category instanceof Connector? |
398 | | - ((Connector)category).getConnectorEnd(): |
399 | | - Collections.emptyList(): |
| 396 | + category.getFeature().stream(). |
| 397 | + filter(f->f.getOwningFeatureMembership() instanceof EndFeatureMembership). |
| 398 | + collect(Collectors.toList()): |
400 | 399 |
|
401 | 400 | // NOTE: This is a temporary measure until connecting to inherited features |
402 | 401 | // is handled generally. |
|
0 commit comments