Skip to content

Commit c586675

Browse files
committed
ST6RI-636 Updated the derivation of Type::multiplicity.
1 parent ce5f0ab commit c586675

1 file changed

Lines changed: 2 additions & 16 deletions

File tree

org.omg.sysml/src/org/omg/sysml/delegate/Type_multiplicity_SettingDelegate.java

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*******************************************************************************
22
* SysML 2 Pilot Implementation
3-
* Copyright (c) 2022 Model Driven Solutions, Inc.
3+
* Copyright (c) 2022, 2023 Model Driven Solutions, Inc.
44
*
55
* This program is free software: you can redistribute it and/or modify
66
* it under the terms of the GNU Lesser General Public License as published by
@@ -22,16 +22,13 @@
2222
package org.omg.sysml.delegate;
2323

2424
import java.util.HashSet;
25-
import java.util.List;
2625
import java.util.Set;
2726

2827
import org.eclipse.emf.ecore.EStructuralFeature;
2928
import org.eclipse.emf.ecore.InternalEObject;
3029
import org.omg.sysml.lang.sysml.Membership;
3130
import org.omg.sysml.lang.sysml.Multiplicity;
3231
import org.omg.sysml.lang.sysml.Type;
33-
import org.omg.sysml.lang.sysml.impl.TypeImpl;
34-
import org.omg.sysml.util.TypeUtil;
3532

3633
public class Type_multiplicity_SettingDelegate extends BasicDerivedObjectSettingDelegate {
3734

@@ -45,21 +42,10 @@ protected Multiplicity basicGet(InternalEObject owner) {
4542
}
4643

4744
protected static Multiplicity getMultiplicityOf(Type type, Set<Type> visited) {
48-
Multiplicity multiplicity = (Multiplicity)type.getOwnedMembership().stream().
45+
return (Multiplicity)type.getOwnedMembership().stream().
4946
map(Membership::getMemberElement).
5047
filter(Multiplicity.class::isInstance).
5148
findFirst().orElse(null);
52-
if (multiplicity == null) {
53-
visited.add(type);
54-
List<Type> superTypes = TypeUtil.getSupertypesOf(type);
55-
if (!superTypes.isEmpty()) {
56-
Type general = TypeUtil.getSupertypesOf(type).get(0);
57-
if (general != null && !visited.contains(general)) {
58-
multiplicity = getMultiplicityOf((TypeImpl)general, visited);
59-
}
60-
}
61-
}
62-
return multiplicity;
6349
}
6450

6551
}

0 commit comments

Comments
 (0)