Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordwagelaar2014-08-28 16:36:49 -0400
committerdwagelaar2014-08-28 16:36:49 -0400
commite54700d6bd8ef72bfc1d6b0dd4a72b3428aa230c (patch)
tree93e28e21af17c8d02bf3418e6a4502c42adddc14 /plugins/org.eclipse.m2m.atl.emftvm
parentbe2fdd5f5f556c974958a906d65fd0ab63205ec3 (diff)
downloadorg.eclipse.atl-e54700d6bd8ef72bfc1d6b0dd4a72b3428aa230c.tar.gz
org.eclipse.atl-e54700d6bd8ef72bfc1d6b0dd4a72b3428aa230c.tar.xz
org.eclipse.atl-e54700d6bd8ef72bfc1d6b0dd4a72b3428aa230c.zip
Fix + test.
441027: Enum type in 'from' section of lazy rules https://bugs.eclipse.org/bugs/show_bug.cgi?id=441027
Diffstat (limited to 'plugins/org.eclipse.m2m.atl.emftvm')
-rw-r--r--plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/RuleImpl.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/RuleImpl.java b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/RuleImpl.java
index 64e23c0a..0ce6078f 100644
--- a/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/RuleImpl.java
+++ b/plugins/org.eclipse.m2m.atl.emftvm/src/org/eclipse/m2m/atl/emftvm/impl/RuleImpl.java
@@ -26,6 +26,8 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
@@ -52,6 +54,7 @@ import org.eclipse.m2m.atl.emftvm.trace.TraceFactory;
import org.eclipse.m2m.atl.emftvm.trace.TraceLink;
import org.eclipse.m2m.atl.emftvm.trace.TraceLinkSet;
import org.eclipse.m2m.atl.emftvm.trace.TracedRule;
+import org.eclipse.m2m.atl.emftvm.util.EnumLiteral;
import org.eclipse.m2m.atl.emftvm.util.FieldContainer;
import org.eclipse.m2m.atl.emftvm.util.LazySet;
import org.eclipse.m2m.atl.emftvm.util.StackFrame;
@@ -2103,7 +2106,13 @@ public class RuleImpl extends NamedElementImpl implements Rule {
"Cannot match rule input element %s against null value for %s",
re, this));
}
- if (!re.getEType().isInstance(value)) {
+ EClassifier eType = re.getEType();
+ if (eType instanceof EEnum) {
+ // Fix for Bug # 441027
+ if (!(value instanceof EnumLiteral)) {
+ return false;
+ }
+ } else if (!eType.isInstance(value)) {
return false;
}
EList<Model> inmodels = re.getEModels();

Back to the top