Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnsgar Radermacher2015-10-28 22:52:07 +0000
committerGerrit Code Review @ Eclipse.org2015-11-09 10:33:33 +0000
commite638c413ede22d94939ac1528de9f17b5da0e5e7 (patch)
tree58e4c15526074ce9d15f32dbbc25676b69702c3e /plugins/infra/services
parentfc34843cebb9b1ba93e1a6558a791536b9704662 (diff)
downloadorg.eclipse.papyrus-e638c413ede22d94939ac1528de9f17b5da0e5e7.tar.gz
org.eclipse.papyrus-e638c413ede22d94939ac1528de9f17b5da0e5e7.tar.xz
org.eclipse.papyrus-e638c413ede22d94939ac1528de9f17b5da0e5e7.zip
479331 - UML metamodel constraints are evaluated twice
446865 - lowerValue and upperValue cardinality values not accessible through UI Change-Id: Ia9c901dd5728c47aa61021b04171278503693a61
Diffstat (limited to 'plugins/infra/services')
-rw-r--r--plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/EValidatorAdapter.java7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/EValidatorAdapter.java b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/EValidatorAdapter.java
index a1008a63d6d..7fababa7de9 100644
--- a/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/EValidatorAdapter.java
+++ b/plugins/infra/services/org.eclipse.papyrus.infra.services.validation/src/org/eclipse/papyrus/infra/services/validation/EValidatorAdapter.java
@@ -37,6 +37,7 @@ import org.eclipse.emf.validation.service.ModelValidationService;
import org.eclipse.uml2.uml.LiteralInteger;
import org.eclipse.uml2.uml.LiteralUnlimitedNatural;
import org.eclipse.uml2.uml.MultiplicityElement;
+import org.eclipse.uml2.uml.ValueSpecification;
import org.eclipse.uml2.uml.util.UMLValidator;
@@ -149,8 +150,10 @@ public class EValidatorAdapter
boolean result = true;
if (eObject instanceof MultiplicityElement) {
final MultiplicityElement multiplicityElement = (MultiplicityElement) eObject;
- if ((!((multiplicityElement.getLowerValue() instanceof LiteralInteger || multiplicityElement.getLowerValue() instanceof LiteralUnlimitedNatural)
- && (multiplicityElement.getUpperValue() instanceof LiteralInteger || multiplicityElement.getUpperValue() instanceof LiteralUnlimitedNatural)))) {
+ ValueSpecification lower = multiplicityElement.getLowerValue();
+ ValueSpecification upper = multiplicityElement.getUpperValue();
+ if (!((lower instanceof LiteralInteger || lower instanceof LiteralUnlimitedNatural || lower == null)
+ && (upper instanceof LiteralInteger || upper instanceof LiteralUnlimitedNatural || upper == null))) {
result = false;
}
}

Back to the top