diff options
author | Ed Willink | 2019-09-17 08:03:28 +0000 |
---|---|---|
committer | Ed Willink | 2019-09-17 13:14:42 +0000 |
commit | edb098a5dd12d435d52ea097f65ad341547c8010 (patch) | |
tree | 1172253b54d41658370d8656858c03a0a1e0fb6e | |
parent | 7d36b032ef7a1865d6a7534f8ed1d8b389684104 (diff) | |
download | org.eclipse.qvtd-edb098a5dd12d435d52ea097f65ad341547c8010.tar.gz org.eclipse.qvtd-edb098a5dd12d435d52ea097f65ad341547c8010.tar.xz org.eclipse.qvtd-edb098a5dd12d435d52ea097f65ad341547c8010.zip |
[548757] Fixup AbstractRuleIsOverridden WFR
4 files changed, 23 insertions, 30 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/AbstractPartition2Mapping.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/AbstractPartition2Mapping.java index 5d1828d29..d5ed1da81 100644 --- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/AbstractPartition2Mapping.java +++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/AbstractPartition2Mapping.java @@ -51,11 +51,9 @@ import org.eclipse.qvtd.pivot.qvtimperative.MappingCall; import org.eclipse.qvtd.pivot.qvtimperative.MappingParameter; import org.eclipse.qvtd.pivot.qvtimperative.MappingParameterBinding; import org.eclipse.qvtd.pivot.qvtimperative.utilities.QVTimperativeHelper; -import org.eclipse.qvtd.pivot.qvtschedule.RuleRegion; import org.eclipse.qvtd.pivot.qvtschedule.Node; import org.eclipse.qvtd.pivot.qvtschedule.NodeConnection; import org.eclipse.qvtd.pivot.qvtschedule.Partition; -import org.eclipse.qvtd.pivot.qvtschedule.Region; import org.eclipse.qvtd.pivot.qvtschedule.utilities.QVTscheduleUtil; public abstract class AbstractPartition2Mapping @@ -103,10 +101,6 @@ public abstract class AbstractPartition2Mapping assert mappingName != null; this.mapping = mapping; //helper.createMapping(mappingName); this.mappingName = mappingName; - Region originalRegion = partition.getRegion(); - if (originalRegion instanceof RuleRegion) { - this.mapping.setIsAbstract(((RuleRegion)originalRegion).getReferredRule().isIsAbstract()); - } int firstPass = partition.getFirstPass(); int lastPass = partition.getLastPass(); this.mapping.setFirstPass(firstPass); diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicPartition2Mapping.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicPartition2Mapping.java index 74ff7b732..5a84a2307 100644 --- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicPartition2Mapping.java +++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/BasicPartition2Mapping.java @@ -1686,17 +1686,9 @@ public class BasicPartition2Mapping extends AbstractPartition2Mapping * Determine a traversal order for the old edges then synthesize the patttern matching statements. */ private void createPatternMatch() { - if (mapping.isIsAbstract()) { - // mapping.getOwnedStatements().add(createCheckStatement(helper.createBooleanLiteralExp(false))); // FIXME add a message - OldEdgeSchedule oldSchedule = new OldEdgeSchedule(); - Iterable<@NonNull CheckedCondition> checkedConditions = oldSchedule.analyze(); - oldSchedule.synthesize(checkedConditions); - } - else { - OldEdgeSchedule oldSchedule = new OldEdgeSchedule(); - Iterable<@NonNull CheckedCondition> checkedConditions = oldSchedule.analyze(); - oldSchedule.synthesize(checkedConditions); - } + OldEdgeSchedule oldSchedule = new OldEdgeSchedule(); + Iterable<@NonNull CheckedCondition> checkedConditions = oldSchedule.analyze(); + oldSchedule.synthesize(checkedConditions); } private void createPropertyAssignments() { diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/MappingImpl.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/MappingImpl.java index ea1e2212e..14dc0e5c8 100644 --- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/MappingImpl.java +++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/emf-gen/org/eclipse/qvtd/pivot/qvtimperative/impl/MappingImpl.java @@ -587,21 +587,21 @@ public class MappingImpl extends RuleImpl implements Mapping { switch (featureID) { case RuleImpl.RULE_FEATURE_COUNT + 0: setIsStrict((Boolean)newValue); - return; + return; case RuleImpl.RULE_FEATURE_COUNT + 1: getOwnedMappingParameters().clear(); - getOwnedMappingParameters().addAll((Collection<? extends MappingParameter>)newValue); - return; + getOwnedMappingParameters().addAll((Collection<? extends MappingParameter>)newValue); + return; case RuleImpl.RULE_FEATURE_COUNT + 2: getOwnedStatements().clear(); - getOwnedStatements().addAll((Collection<? extends Statement>)newValue); - return; + getOwnedStatements().addAll((Collection<? extends Statement>)newValue); + return; case RuleImpl.RULE_FEATURE_COUNT + 3: setFirstPass((Integer)newValue); - return; + return; case RuleImpl.RULE_FEATURE_COUNT + 4: setLastPass((Integer)newValue); - return; + return; } super.eSet(featureID, newValue); } @@ -616,19 +616,19 @@ public class MappingImpl extends RuleImpl implements Mapping { switch (featureID) { case RuleImpl.RULE_FEATURE_COUNT + 0: setIsStrict(IS_STRICT_EDEFAULT); - return; + return; case RuleImpl.RULE_FEATURE_COUNT + 1: getOwnedMappingParameters().clear(); - return; + return; case RuleImpl.RULE_FEATURE_COUNT + 2: getOwnedStatements().clear(); - return; + return; case RuleImpl.RULE_FEATURE_COUNT + 3: setFirstPass(FIRST_PASS_EDEFAULT); - return; + return; case RuleImpl.RULE_FEATURE_COUNT + 4: setLastPass(LAST_PASS_EDEFAULT); - return; + return; } super.eUnset(featureID); } @@ -689,4 +689,10 @@ public class MappingImpl extends RuleImpl implements Mapping { return super.accept(visitor); } } + + @Override + public void setIsAbstract(boolean newIsAbstract) { + assert !newIsAbstract; // QVTi does not use abstract mappings + super.setIsAbstract(newIsAbstract); + } } //MappingImpl diff --git a/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/QVTrLoadTests.java b/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/QVTrLoadTests.java index cacff17f5..18a02673e 100644 --- a/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/QVTrLoadTests.java +++ b/tests/org.eclipse.qvtd.xtext.qvtrelation.tests/src/org/eclipse/qvtd/xtext/qvtrelation/tests/QVTrLoadTests.java @@ -148,7 +148,8 @@ public class QVTrLoadTests extends LoadTestCase "The 'Key::IdentifiesIsNotAbstract' constraint is violated for 'key EMOF::Type {EMOF::NamedElement::name}'", "The 'Key::NoSuperKeys' constraint is violated for 'key EMOF::Class {EMOF::NamedElement::name}'", "The 'Key::NoSuperKeys' constraint is violated for 'key QVTBase::Transformation {EMOF::NamedElement::name}'", - "The 'RelationCallExp::WhereInvocationIsANonTopRelation' constraint is violated for 'RelationalTransformationToMappingTransformation(rt, mt)'" + "The 'RelationCallExp::WhereInvocationIsANonTopRelation' constraint is violated for 'RelationalTransformationToMappingTransformation(rt, mt)'", + "The 'Rule::AbstractRuleIsOverridden' constraint is violated for 'relation RExpToMExp'" }); } |