Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2015-04-29 21:59:03 +0000
committerEd Willink2015-05-03 18:01:37 +0000
commitf11addf8731420e33866675f000944386672247f (patch)
treef44a5e34f5ba6ac23ee675a4d4434be476637499
parent7e88ac07a384ede3cbc0369183f4a8fff8382037 (diff)
downloadorg.eclipse.qvtd-f11addf8731420e33866675f000944386672247f.tar.gz
org.eclipse.qvtd-f11addf8731420e33866675f000944386672247f.tar.xz
org.eclipse.qvtd-f11addf8731420e33866675f000944386672247f.zip
[445105] Regenerate, support alias names in generated imports
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/etl/MtcBroker.java3
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/META-INF/MANIFEST.MF1
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/model/QVTbaseLibrary.java98
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/model/QVTbaseMetamodel.java2
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/model-gen/QVTbaseLibrary.oclas67
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbaseLibrary.oclstdlib11
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/attributes/TransformationAttribution.java3
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/evaluation/TransformationInstance.java14
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/evaluation/TypedModelInstance.java23
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/AllObjectsOperation.java42
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/ModelObjectsOfKindOperation.java31
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/ModelObjectsOfTypeOperation.java43
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/RootObjectsOperation.java32
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/analysis/AbstractDomainUsageAnalysis.java5
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/analysis/RootDomainUsageAnalysis.java9
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEnvironmentFactory.java3
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiModelManager.java69
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiPivotEvaluator.java22
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtcorebase/src/org/eclipse/qvtd/xtext/qvtcorebase/cs2as/QVTcoreBaseCSLeft2RightVisitor.java52
-rw-r--r--plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java32
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2Target.qvtias43
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2Target.qvtp.qvtias34
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/TargetLookup.ocl6
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2as.qvtias2
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2as.qvtp.qvtias2
-rw-r--r--tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/cg/classescs2as_qvtp_qvtias.java14
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src-gen/cg/classescs2as_Bug459225.java15
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/HSV2HLS/HSV2HLS.qvti3
-rw-r--r--tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/QVTiSerializeTests.java7
29 files changed, 580 insertions, 108 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/etl/MtcBroker.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/etl/MtcBroker.java
index 56ca17a34..82d611346 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/etl/MtcBroker.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/etl/MtcBroker.java
@@ -11,9 +11,7 @@
package org.eclipse.qvtd.compiler.internal.etl;
import java.io.BufferedWriter;
-import java.io.File;
import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
@@ -26,7 +24,6 @@ import java.util.Iterator;
import java.util.List;
import java.util.Map;
-import org.eclipse.core.runtime.URIUtil;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/META-INF/MANIFEST.MF b/plugins/org.eclipse.qvtd.pivot.qvtbase/META-INF/MANIFEST.MF
index d3a39bee1..e225136bd 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtbase/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/META-INF/MANIFEST.MF
@@ -11,6 +11,7 @@ Export-Package: org.eclipse.qvtd.pivot.qvtbase,
org.eclipse.qvtd.pivot.qvtbase.attributes,
org.eclipse.qvtd.pivot.qvtbase.evaluation,
org.eclipse.qvtd.pivot.qvtbase.impl,
+ org.eclipse.qvtd.pivot.qvtbase.library.model,
org.eclipse.qvtd.pivot.qvtbase.model,
org.eclipse.qvtd.pivot.qvtbase.scoping,
org.eclipse.qvtd.pivot.qvtbase.util,
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/model/QVTbaseLibrary.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/model/QVTbaseLibrary.java
index d61af1bfd..fcb8a8275 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/model/QVTbaseLibrary.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/model/QVTbaseLibrary.java
@@ -235,14 +235,18 @@ public class QVTbaseLibrary extends ASResourceImpl
{
private final @NonNull Model model;
private final @NonNull Library qvtbaselibrary;
+ private final @NonNull Package orphanage;
private Contents(@NonNull String asURI)
{
model = createModel(asURI);
qvtbaselibrary = createLibrary("qvtbaselibrary", "qvtbaselib", "http://www.eclipse.org/qvt/2015/QVTbaseLibrary", null);
+ orphanage = createPackage("$$", "orphanage", "http://www.eclipse.org/ocl/2015/Orphanage", null);
installPackages();
installClassTypes();
+ installCollectionTypes();
installOperations();
+ installTemplateBindings();
installComments();
}
@@ -251,19 +255,38 @@ public class QVTbaseLibrary extends ASResourceImpl
}
private final @NonNull Package _ocl = getPackage(org.eclipse.ocl.pivot.model.OCLstdlib.getDefaultModel(), "ocl");
+ private final @NonNull Package _qvtbase = getPackage(org.eclipse.qvtd.pivot.qvtbase.model.QVTbaseMetamodel.getDefaultModel(), "qvtbase");
+ private final @NonNull CollectionType _Collection = getCollectionType(_ocl, "Collection");
private final @NonNull AnyType _OclAny = getAnyType(_ocl, "OclAny");
private final @NonNull Class _OclElement = getClass(_ocl, "OclElement");
- private final @NonNull InvalidType _OclInvalid = getInvalidType(_ocl, "OclInvalid");
+ private final @NonNull SetType _Set = getSetType(_ocl, "Set");
+ private final @NonNull CollectionType _UniqueCollection = getCollectionType(_ocl, "UniqueCollection");
+ private final @NonNull TemplateParameter _Collection_T = getTemplateParameter(_Collection, 0);
+ private final @NonNull TemplateParameter _Set_T = getTemplateParameter(_Set, 0);
+ private final @NonNull TemplateParameter _UniqueCollection_T = getTemplateParameter(_UniqueCollection, 0);
private void installPackages() {
model.getOwnedPackages().add(qvtbaselibrary);
- model.getOwnedImports().add(createImport(_ocl));
+ model.getOwnedPackages().add(orphanage);
+ model.getOwnedImports().add(createImport(null, _ocl));
+ model.getOwnedImports().add(createImport("qvtb", _qvtbase));
}
private final @NonNull Class _Model = createClass("Model");
private final @NonNull Class _Transformation = createClass("Transformation");
private final @NonNull TemplateParameter tp_Model_objectsOfKind_TT = createTemplateParameter("TT");
+ private final @NonNull TemplateParameter tp_Model_objectsOfType_TT = createTemplateParameter("TT");
+
+ private final @NonNull CollectionType _Collection_OclElement = createCollectionType(_Collection, _OclElement);
+ private final @NonNull CollectionType _Collection_Model_objectsOfKind_TT = createCollectionType(_Collection, tp_Model_objectsOfKind_TT);
+ private final @NonNull CollectionType _Collection_Model_objectsOfType_TT = createCollectionType(_Collection, tp_Model_objectsOfType_TT);
+ private final @NonNull SetType _Set_OclElement = createSetType(_Set, _OclElement);
+ private final @NonNull SetType _Set_Model_objectsOfKind_TT = createSetType(_Set, tp_Model_objectsOfKind_TT);
+ private final @NonNull SetType _Set_Model_objectsOfType_TT = createSetType(_Set, tp_Model_objectsOfType_TT);
+ private final @NonNull CollectionType _UniqueCollection_OclElement = createCollectionType(_UniqueCollection, _OclElement);
+ private final @NonNull CollectionType _UniqueCollection_Model_objectsOfKind_TT = createCollectionType(_UniqueCollection, tp_Model_objectsOfKind_TT);
+ private final @NonNull CollectionType _UniqueCollection_Model_objectsOfType_TT = createCollectionType(_UniqueCollection, tp_Model_objectsOfType_TT);
private void installClassTypes() {
List<Class> ownedClasses;
@@ -279,9 +302,45 @@ public class QVTbaseLibrary extends ASResourceImpl
superClasses.add(_OclElement);
}
- private final @NonNull Operation op_Model_objects = createOperation("objects", _OclInvalid, null, null);
- private final @NonNull Operation op_Model_objectsOfKind = createOperation("objectsOfKind", _OclInvalid, "org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfKindOperation", org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfKindOperation.INSTANCE, tp_Model_objectsOfKind_TT);
- private final @NonNull Operation op_Model_rootObjects = createOperation("rootObjects", _OclInvalid, null, null);
+ private void installCollectionTypes() {
+ List<Class> ownedClasses;
+ List<Class> superClasses;
+ CollectionType type;
+
+ ownedClasses = orphanage.getOwnedClasses();
+ ownedClasses.add(type = _Collection_OclElement);
+ superClasses = type.getSuperClasses();
+ superClasses.add(_OclElement);
+ ownedClasses.add(type = _Collection_Model_objectsOfKind_TT);
+ superClasses = type.getSuperClasses();
+ superClasses.add(_OclElement);
+ ownedClasses.add(type = _Collection_Model_objectsOfType_TT);
+ superClasses = type.getSuperClasses();
+ superClasses.add(_OclElement);
+ ownedClasses.add(type = _Set_OclElement);
+ superClasses = type.getSuperClasses();
+ superClasses.add(_UniqueCollection_OclElement);
+ ownedClasses.add(type = _Set_Model_objectsOfKind_TT);
+ superClasses = type.getSuperClasses();
+ superClasses.add(_UniqueCollection_Model_objectsOfKind_TT);
+ ownedClasses.add(type = _Set_Model_objectsOfType_TT);
+ superClasses = type.getSuperClasses();
+ superClasses.add(_UniqueCollection_Model_objectsOfType_TT);
+ ownedClasses.add(type = _UniqueCollection_OclElement);
+ superClasses = type.getSuperClasses();
+ superClasses.add(_Collection_OclElement);
+ ownedClasses.add(type = _UniqueCollection_Model_objectsOfKind_TT);
+ superClasses = type.getSuperClasses();
+ superClasses.add(_Collection_Model_objectsOfKind_TT);
+ ownedClasses.add(type = _UniqueCollection_Model_objectsOfType_TT);
+ superClasses = type.getSuperClasses();
+ superClasses.add(_Collection_Model_objectsOfType_TT);
+ }
+
+ private final @NonNull Operation op_Model_allObjects = createOperation("allObjects", _Set_OclElement, "org.eclipse.qvtd.pivot.qvtbase.library.model.AllObjectsOperation", org.eclipse.qvtd.pivot.qvtbase.library.model.AllObjectsOperation.INSTANCE);
+ private final @NonNull Operation op_Model_objectsOfKind = createOperation("objectsOfKind", _Set_Model_objectsOfKind_TT, "org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfKindOperation", org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfKindOperation.INSTANCE, tp_Model_objectsOfKind_TT);
+ private final @NonNull Operation op_Model_objectsOfType = createOperation("objectsOfType", _Set_Model_objectsOfType_TT, "org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfTypeOperation", org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfTypeOperation.INSTANCE, tp_Model_objectsOfType_TT);
+ private final @NonNull Operation op_Model_rootObjects = createOperation("rootObjects", _Set_OclElement, "org.eclipse.qvtd.pivot.qvtbase.library.model.RootObjectsOperation", org.eclipse.qvtd.pivot.qvtbase.library.model.RootObjectsOperation.INSTANCE);
private void installOperations() {
List<Operation> ownedOperations;
@@ -290,14 +349,39 @@ public class QVTbaseLibrary extends ASResourceImpl
Parameter parameter;
ownedOperations = _Model.getOwnedOperations();
- ownedOperations.add(operation = op_Model_objects);
+ ownedOperations.add(operation = op_Model_allObjects);
ownedOperations.add(operation = op_Model_objectsOfKind);
ownedParameters = operation.getOwnedParameters();
- ownedParameters.add(parameter = createParameter("type", tp_Model_objectsOfKind_TT, true));
+ ownedParameters.add(parameter = createParameter("type", tp_Model_objectsOfKind_TT, false));
+ parameter.setIsTypeof(true);
+ ownedOperations.add(operation = op_Model_objectsOfType);
+ ownedParameters = operation.getOwnedParameters();
+ ownedParameters.add(parameter = createParameter("type", tp_Model_objectsOfType_TT, false));
parameter.setIsTypeof(true);
ownedOperations.add(operation = op_Model_rootObjects);
}
+ private void installTemplateBindings() {
+ _Collection_OclElement.getOwnedBindings().add(createTemplateBinding(
+ createTemplateParameterSubstitution(_Collection_T, _OclElement)));
+ _Collection_Model_objectsOfKind_TT.getOwnedBindings().add(createTemplateBinding(
+ createTemplateParameterSubstitution(_Collection_T, tp_Model_objectsOfKind_TT)));
+ _Collection_Model_objectsOfType_TT.getOwnedBindings().add(createTemplateBinding(
+ createTemplateParameterSubstitution(_Collection_T, tp_Model_objectsOfType_TT)));
+ _Set_OclElement.getOwnedBindings().add(createTemplateBinding(
+ createTemplateParameterSubstitution(_Set_T, _OclElement)));
+ _Set_Model_objectsOfKind_TT.getOwnedBindings().add(createTemplateBinding(
+ createTemplateParameterSubstitution(_Set_T, tp_Model_objectsOfKind_TT)));
+ _Set_Model_objectsOfType_TT.getOwnedBindings().add(createTemplateBinding(
+ createTemplateParameterSubstitution(_Set_T, tp_Model_objectsOfType_TT)));
+ _UniqueCollection_OclElement.getOwnedBindings().add(createTemplateBinding(
+ createTemplateParameterSubstitution(_UniqueCollection_T, _OclElement)));
+ _UniqueCollection_Model_objectsOfKind_TT.getOwnedBindings().add(createTemplateBinding(
+ createTemplateParameterSubstitution(_UniqueCollection_T, tp_Model_objectsOfKind_TT)));
+ _UniqueCollection_Model_objectsOfType_TT.getOwnedBindings().add(createTemplateBinding(
+ createTemplateParameterSubstitution(_UniqueCollection_T, tp_Model_objectsOfType_TT)));
+ }
+
private void installComments() {
}
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/model/QVTbaseMetamodel.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/model/QVTbaseMetamodel.java
index 75e80807c..16c2ed89f 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/model/QVTbaseMetamodel.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/emf-gen/org/eclipse/qvtd/pivot/qvtbase/model/QVTbaseMetamodel.java
@@ -159,7 +159,7 @@ public class QVTbaseMetamodel extends ASResourceImpl
root.getOwnedPackages().add(pivot);
root.getOwnedPackages().add(qvtbase);
root.getOwnedPackages().add(orphanage);
- root.getOwnedImports().add(createImport(_ocl));
+ root.getOwnedImports().add(createImport(null, _ocl));
}
private final @NonNull Class _Annotation = createClass(PivotPackage.Literals.ANNOTATION);
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/model-gen/QVTbaseLibrary.oclas b/plugins/org.eclipse.qvtd.pivot.qvtbase/model-gen/QVTbaseLibrary.oclas
index a8a52a8e7..956a5a614 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtbase/model-gen/QVTbaseLibrary.oclas
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/model-gen/QVTbaseLibrary.oclas
@@ -5,16 +5,75 @@
<ownedPackages xsi:type="pivot:Library" xmi:id="P.qvtbaselibrary" URI="http://www.eclipse.org/qvt/2015/QVTbaseLibrary" name="qvtbaselibrary"
nsPrefix="qvtbaselib">
<ownedClasses xmi:id="T.qvtbaselibrary.Model" name="Model" superClasses="http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclElement">
- <ownedOperations xmi:id="o.qvtbaselibrary.Model.objects" name="objects" type="pivot:InvalidType http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclInvalid"/>
+ <ownedOperations xmi:id="o.qvtbaselibrary.Model.allObjects" implementationClass="org.eclipse.qvtd.pivot.qvtbase.library.model.AllObjectsOperation"
+ name="allObjects" type="#//@ownedPackages.1/@ownedClasses.3"/>
<ownedOperations xmi:id="o.qvtbaselibrary.Model.objectsOfKind..TT" implementationClass="org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfKindOperation"
- name="objectsOfKind" type="pivot:InvalidType http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclInvalid">
- <ownedParameters xmi:id="p0o.qvtbaselibrary.Model.objectsOfKind..TT" isTypeof="true" name="type" type="#t.qvtbaselibrary.Model..objectsOfKindTT"/>
+ name="objectsOfKind" type="#//@ownedPackages.1/@ownedClasses.4">
+ <ownedParameters xmi:id="p0o.qvtbaselibrary.Model.objectsOfKind..TT" isRequired="false" isTypeof="true" name="type" type="#t.qvtbaselibrary.Model..objectsOfKindTT"/>
<ownedSignature xmi:id="s.o.qvtbaselibrary.Model.objectsOfKind..TT">
<ownedParameters xmi:id="t.qvtbaselibrary.Model..objectsOfKindTT" name="TT"/>
</ownedSignature>
</ownedOperations>
- <ownedOperations xmi:id="o.qvtbaselibrary.Model.rootObjects" name="rootObjects" type="pivot:InvalidType http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclInvalid"/>
+ <ownedOperations xmi:id="o.qvtbaselibrary.Model.objectsOfType..TT" implementationClass="org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfTypeOperation"
+ name="objectsOfType" type="#//@ownedPackages.1/@ownedClasses.5">
+ <ownedParameters xmi:id="p0o.qvtbaselibrary.Model.objectsOfType..TT" isRequired="false" isTypeof="true" name="type" type="#t.qvtbaselibrary.Model..objectsOfTypeTT"/>
+ <ownedSignature xmi:id="s.o.qvtbaselibrary.Model.objectsOfType..TT">
+ <ownedParameters xmi:id="t.qvtbaselibrary.Model..objectsOfTypeTT" name="TT"/>
+ </ownedSignature>
+ </ownedOperations>
+ <ownedOperations xmi:id="o.qvtbaselibrary.Model.rootObjects" implementationClass="org.eclipse.qvtd.pivot.qvtbase.library.model.RootObjectsOperation"
+ name="rootObjects" type="#//@ownedPackages.1/@ownedClasses.3"/>
</ownedClasses>
<ownedClasses xmi:id="T.qvtbaselibrary.Transformation" name="Transformation" superClasses="http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclElement"/>
</ownedPackages>
+ <ownedPackages xmi:id="P.$$" URI="http://www.eclipse.org/ocl/2015/Orphanage" name="$$" nsPrefix="orphanage">
+ <ownedClasses xsi:type="pivot:CollectionType" elementType="pivot:Class http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclElement"
+ name="Collection" superClasses="http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclAny">
+ <ownedBindings>
+ <ownedSubstitutions actual="pivot:Class http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclElement" formal="http://www.eclipse.org/ocl/2015/Library.oclas#t.ocl..CollectionT"/>
+ </ownedBindings>
+ </ownedClasses>
+ <ownedClasses xsi:type="pivot:CollectionType" elementType="#t.qvtbaselibrary.Model..objectsOfKindTT" name="Collection" superClasses="http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclAny">
+ <ownedBindings>
+ <ownedSubstitutions actual="#t.qvtbaselibrary.Model..objectsOfKindTT" formal="http://www.eclipse.org/ocl/2015/Library.oclas#t.ocl..CollectionT"/>
+ </ownedBindings>
+ </ownedClasses>
+ <ownedClasses xsi:type="pivot:CollectionType" elementType="#t.qvtbaselibrary.Model..objectsOfTypeTT" name="Collection" superClasses="http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclAny">
+ <ownedBindings>
+ <ownedSubstitutions actual="#t.qvtbaselibrary.Model..objectsOfTypeTT" formal="http://www.eclipse.org/ocl/2015/Library.oclas#t.ocl..CollectionT"/>
+ </ownedBindings>
+ </ownedClasses>
+ <ownedClasses xsi:type="pivot:SetType" elementType="pivot:Class http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclElement" name="Set"
+ superClasses="#//@ownedPackages.1/@ownedClasses.6">
+ <ownedBindings>
+ <ownedSubstitutions actual="pivot:Class http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclElement" formal="http://www.eclipse.org/ocl/2015/Library.oclas#t.ocl..SetT"/>
+ </ownedBindings>
+ </ownedClasses>
+ <ownedClasses xsi:type="pivot:SetType" elementType="#t.qvtbaselibrary.Model..objectsOfKindTT" name="Set" superClasses="#//@ownedPackages.1/@ownedClasses.7">
+ <ownedBindings>
+ <ownedSubstitutions actual="#t.qvtbaselibrary.Model..objectsOfKindTT" formal="http://www.eclipse.org/ocl/2015/Library.oclas#t.ocl..SetT"/>
+ </ownedBindings>
+ </ownedClasses>
+ <ownedClasses xsi:type="pivot:SetType" elementType="#t.qvtbaselibrary.Model..objectsOfTypeTT" name="Set" superClasses="#//@ownedPackages.1/@ownedClasses.8">
+ <ownedBindings>
+ <ownedSubstitutions actual="#t.qvtbaselibrary.Model..objectsOfTypeTT" formal="http://www.eclipse.org/ocl/2015/Library.oclas#t.ocl..SetT"/>
+ </ownedBindings>
+ </ownedClasses>
+ <ownedClasses xsi:type="pivot:CollectionType" elementType="pivot:Class http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclElement"
+ name="UniqueCollection" superClasses="#//@ownedPackages.1/@ownedClasses.0">
+ <ownedBindings>
+ <ownedSubstitutions actual="pivot:Class http://www.eclipse.org/ocl/2015/Library.oclas#T.ocl.OclElement" formal="http://www.eclipse.org/ocl/2015/Library.oclas#t.ocl..UniqueCollectionT"/>
+ </ownedBindings>
+ </ownedClasses>
+ <ownedClasses xsi:type="pivot:CollectionType" elementType="#t.qvtbaselibrary.Model..objectsOfKindTT" name="UniqueCollection" superClasses="#//@ownedPackages.1/@ownedClasses.1">
+ <ownedBindings>
+ <ownedSubstitutions actual="#t.qvtbaselibrary.Model..objectsOfKindTT" formal="http://www.eclipse.org/ocl/2015/Library.oclas#t.ocl..UniqueCollectionT"/>
+ </ownedBindings>
+ </ownedClasses>
+ <ownedClasses xsi:type="pivot:CollectionType" elementType="#t.qvtbaselibrary.Model..objectsOfTypeTT" name="UniqueCollection" superClasses="#//@ownedPackages.1/@ownedClasses.2">
+ <ownedBindings>
+ <ownedSubstitutions actual="#t.qvtbaselibrary.Model..objectsOfTypeTT" formal="http://www.eclipse.org/ocl/2015/Library.oclas#t.ocl..UniqueCollectionT"/>
+ </ownedBindings>
+ </ownedClasses>
+ </ownedPackages>
</pivot:Model>
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbaseLibrary.oclstdlib b/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbaseLibrary.oclstdlib
index a0f90c782..fe74754b4 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbaseLibrary.oclstdlib
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/model/QVTbaseLibrary.oclstdlib
@@ -2,10 +2,11 @@ import qvtb : 'QVTbase.ecore#/';
library qvtbaselibrary : qvtbaselib = 'http://www.eclipse.org/qvt/2015/QVTbaseLibrary'
{
-type Model {
- operation objects() : Set(OclElement);
- operation objectsOfKind(TT)(type : typeof(TT)) : Set(TT) => 'org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfKindOperation';
- operation rootObjects() : Set(OclElement);
+type Model : TypedModel {
+ operation allObjects() : ocl::Set(ocl::OclElement) => 'org.eclipse.qvtd.pivot.qvtbase.library.model.AllObjectsOperation';
+ operation objectsOfKind(TT)(type : typeof(TT)) : ocl::Set(TT) => 'org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfKindOperation';
+ operation objectsOfType(TT)(type : typeof(TT)) : ocl::Set(TT) => 'org.eclipse.qvtd.pivot.qvtbase.library.model.ModelObjectsOfTypeOperation';
+ operation rootObjects() : ocl::Set(ocl::OclElement) => 'org.eclipse.qvtd.pivot.qvtbase.library.model.RootObjectsOperation';
}
-type Transformation {}
+type Transformation : Transformation {}
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/attributes/TransformationAttribution.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/attributes/TransformationAttribution.java
index 6024426b8..9dfd486f3 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/attributes/TransformationAttribution.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/attributes/TransformationAttribution.java
@@ -24,9 +24,6 @@ public class TransformationAttribution extends ClassAttribution
@Override
public ScopeView computeLookup(@NonNull EObject target, @NonNull EnvironmentView environmentView, @NonNull ScopeView scopeView) {
- if ("modelFor".equals(environmentView.getName())) {
- System.out.println("Got it");
- }
Transformation transformation = (Transformation)target;
environmentView.addNamedElements(transformation.getModelParameter());
QVTbaseUtil.addAllNamedElements(environmentView, transformation.getOwnedOperations());
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/evaluation/TransformationInstance.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/evaluation/TransformationInstance.java
new file mode 100644
index 000000000..8cbdb63f4
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/evaluation/TransformationInstance.java
@@ -0,0 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2015 E.D.Willink and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.qvtd.pivot.qvtbase.evaluation;
+
+public interface TransformationInstance {
+}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/evaluation/TypedModelInstance.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/evaluation/TypedModelInstance.java
new file mode 100644
index 000000000..c309b7e81
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/evaluation/TypedModelInstance.java
@@ -0,0 +1,23 @@
+/*******************************************************************************
+ * Copyright (c) 2015 E.D.Willink and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.qvtd.pivot.qvtbase.evaluation;
+
+import java.util.Set;
+
+import org.eclipse.jdt.annotation.NonNull;
+
+public interface TypedModelInstance
+{
+ @NonNull Set<Object> getAllObjects();
+ @NonNull Set<Object> getObjectsOfKind(@NonNull org.eclipse.ocl.pivot.Class type);
+ @NonNull Set<Object> getObjectsOfType(@NonNull org.eclipse.ocl.pivot.Class type);
+ @NonNull Set<Object> getRootObjects();
+}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/AllObjectsOperation.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/AllObjectsOperation.java
new file mode 100644
index 000000000..dd7b3d438
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/AllObjectsOperation.java
@@ -0,0 +1,42 @@
+/*******************************************************************************
+ * Copyright (c) 2015 E.D.Willink and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.qvtd.pivot.qvtbase.library.model;
+
+import java.util.Set;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.ocl.pivot.evaluation.Evaluator;
+import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
+import org.eclipse.ocl.pivot.library.AbstractUnaryOperation;
+import org.eclipse.ocl.pivot.messages.PivotMessages;
+import org.eclipse.ocl.pivot.values.InvalidValueException;
+import org.eclipse.ocl.pivot.values.SetValue;
+import org.eclipse.qvtd.pivot.qvtbase.evaluation.TypedModelInstance;
+
+/**
+ * AllObjectsOperation realises the Model::allObjects() library operation.
+ */
+public class AllObjectsOperation extends AbstractUnaryOperation
+{
+ public static final @NonNull AllObjectsOperation INSTANCE = new AllObjectsOperation();
+
+ @Override
+ public @NonNull SetValue evaluate(@NonNull Evaluator evaluator, @NonNull TypeId returnTypeId, @Nullable Object sourceVal) {
+ if (!(sourceVal instanceof TypedModelInstance)) {
+ throw new InvalidValueException(PivotMessages.TypedValueRequired, "TypedModelInstance", getTypeName(sourceVal));
+ }
+ TypedModelInstance typedModelInstance = (TypedModelInstance)sourceVal;
+ Set<Object> results = typedModelInstance.getAllObjects();
+ return createSetValue((CollectionTypeId)returnTypeId, results);
+ }
+}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/ModelObjectsOfKindOperation.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/ModelObjectsOfKindOperation.java
index 4fb78e6f5..68b2cba3d 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/ModelObjectsOfKindOperation.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/ModelObjectsOfKindOperation.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2013 E.D.Willink and others.
+ * Copyright (c) 2015 E.D.Willink and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -10,39 +10,34 @@
*******************************************************************************/
package org.eclipse.qvtd.pivot.qvtbase.library.model;
-import java.util.HashSet;
import java.util.Set;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ocl.pivot.evaluation.Evaluator;
-import org.eclipse.ocl.pivot.evaluation.ModelManager;
import org.eclipse.ocl.pivot.ids.CollectionTypeId;
import org.eclipse.ocl.pivot.ids.TypeId;
-import org.eclipse.ocl.pivot.library.AbstractUnaryOperation;
+import org.eclipse.ocl.pivot.library.AbstractBinaryOperation;
+import org.eclipse.ocl.pivot.messages.PivotMessages;
+import org.eclipse.ocl.pivot.values.InvalidValueException;
import org.eclipse.ocl.pivot.values.SetValue;
+import org.eclipse.qvtd.pivot.qvtbase.evaluation.TypedModelInstance;
/**
- * ClassifierAllInstancesOperation realises the Classifier::allInstances() library operation.
+ * ModelObjectsOfKindOperation realises the Model::objectsOfKind() library operation.
*/
-public class ModelObjectsOfKindOperation extends AbstractUnaryOperation
+public class ModelObjectsOfKindOperation extends AbstractBinaryOperation
{
public static final @NonNull ModelObjectsOfKindOperation INSTANCE = new ModelObjectsOfKindOperation();
@Override
- public @NonNull SetValue evaluate(@NonNull Evaluator evaluator, @NonNull TypeId returnTypeId, @Nullable Object sourceVal) {
- org.eclipse.ocl.pivot.Class type = asClass(sourceVal);
-// if (type instanceof DomainMetaclass) {
-// type = ((DomainMetaclass)type).getInstanceType();
-// }
- ModelManager modelManager = evaluator.getModelManager();
- Set<Object> results = new HashSet<Object>();
- Set<?> instances = modelManager.get(type);
- for (Object instance : instances) {
- if (instance != null){
- results.add(evaluator.getIdResolver().boxedValueOf(instance)); // FIXME Move to model manager
- }
+ public @NonNull SetValue evaluate(@NonNull Evaluator evaluator, @NonNull TypeId returnTypeId, @Nullable Object sourceVal, @Nullable Object typeVal) {
+ org.eclipse.ocl.pivot.Class type = asClass(typeVal);
+ if (!(sourceVal instanceof TypedModelInstance)) {
+ throw new InvalidValueException(PivotMessages.TypedValueRequired, "TypedModelInstance", getTypeName(sourceVal));
}
+ TypedModelInstance typedModelInstance = (TypedModelInstance)sourceVal;
+ Set<Object> results = typedModelInstance.getObjectsOfKind(type);
return createSetValue((CollectionTypeId)returnTypeId, results);
}
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/ModelObjectsOfTypeOperation.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/ModelObjectsOfTypeOperation.java
new file mode 100644
index 000000000..c339586eb
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/ModelObjectsOfTypeOperation.java
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2015 E.D.Willink and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * E.D.Willink - Initial API and implementation
+ *******************************************************************************/
+package org.eclipse.qvtd.pivot.qvtbase.library.model;
+
+import java.util.Set;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.ocl.pivot.evaluation.Evaluator;
+import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
+import org.eclipse.ocl.pivot.library.AbstractBinaryOperation;
+import org.eclipse.ocl.pivot.messages.PivotMessages;
+import org.eclipse.ocl.pivot.values.InvalidValueException;
+import org.eclipse.ocl.pivot.values.SetValue;
+import org.eclipse.qvtd.pivot.qvtbase.evaluation.TypedModelInstance;
+
+/**
+ * ModelObjectsOfTypeOperation realises the Model::objectsOfType() library operation.
+ */
+public class ModelObjectsOfTypeOperation extends AbstractBinaryOperation
+{
+ public static final @NonNull ModelObjectsOfTypeOperation INSTANCE = new ModelObjectsOfTypeOperation();
+
+ @Override
+ public @NonNull SetValue evaluate(@NonNull Evaluator evaluator, @NonNull TypeId returnTypeId, @Nullable Object sourceVal, @Nullable Object typeVal) {
+ org.eclipse.ocl.pivot.Class type = asClass(typeVal);
+ if (!(sourceVal instanceof TypedModelInstance)) {
+ throw new InvalidValueException(PivotMessages.TypedValueRequired, "TypedModelInstance", getTypeName(sourceVal));
+ }
+ TypedModelInstance typedModelInstance = (TypedModelInstance)sourceVal;
+ Set<Object> results = typedModelInstance.getObjectsOfType(type);
+ return createSetValue((CollectionTypeId)returnTypeId, results);
+ }
+}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/RootObjectsOperation.java b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/RootObjectsOperation.java
new file mode 100644
index 000000000..343f6a457
--- /dev/null
+++ b/plugins/org.eclipse.qvtd.pivot.qvtbase/src/org/eclipse/qvtd/pivot/qvtbase/library/model/RootObjectsOperation.java
@@ -0,0 +1,32 @@
+package org.eclipse.qvtd.pivot.qvtbase.library.model;
+
+import java.util.Set;
+
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.ocl.pivot.evaluation.Evaluator;
+import org.eclipse.ocl.pivot.ids.CollectionTypeId;
+import org.eclipse.ocl.pivot.ids.TypeId;
+import org.eclipse.ocl.pivot.library.AbstractUnaryOperation;
+import org.eclipse.ocl.pivot.messages.PivotMessages;
+import org.eclipse.ocl.pivot.values.InvalidValueException;
+import org.eclipse.ocl.pivot.values.SetValue;
+import org.eclipse.qvtd.pivot.qvtbase.evaluation.TypedModelInstance;
+
+/**
+ * RootObjectsOperation realises the Model::rootObjects() library operation.
+ */
+public class RootObjectsOperation extends AbstractUnaryOperation
+{
+ public static final @NonNull RootObjectsOperation INSTANCE = new RootObjectsOperation();
+
+ @Override
+ public @NonNull SetValue evaluate(@NonNull Evaluator evaluator, @NonNull TypeId returnTypeId, @Nullable Object sourceVal) {
+ if (!(sourceVal instanceof TypedModelInstance)) {
+ throw new InvalidValueException(PivotMessages.TypedValueRequired, "TypedModelInstance", getTypeName(sourceVal));
+ }
+ TypedModelInstance typedModelInstance = (TypedModelInstance)sourceVal;
+ Set<Object> results = typedModelInstance.getRootObjects();
+ return createSetValue((CollectionTypeId)returnTypeId, results);
+ }
+}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/analysis/AbstractDomainUsageAnalysis.java b/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/analysis/AbstractDomainUsageAnalysis.java
index 55326ca6a..c8ed6257a 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/analysis/AbstractDomainUsageAnalysis.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/analysis/AbstractDomainUsageAnalysis.java
@@ -602,6 +602,11 @@ public abstract class AbstractDomainUsageAnalysis extends AbstractExtendingQVTco
// for (TypedModel typedModel : object.getModelParameter()) { -- done in analyzeTransformation
// visit(typedModel);
// }
+ Variable ownedContext = object.getOwnedContext();
+ DomainUsage domainUsage = getUsage(object);
+ if ((ownedContext != null) && (domainUsage != null)) {
+ setUsage(ownedContext, domainUsage);
+ }
//
// Ensure all operations are analyzed even if not used.
//
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/analysis/RootDomainUsageAnalysis.java b/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/analysis/RootDomainUsageAnalysis.java
index ade550e84..fb8afea17 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/analysis/RootDomainUsageAnalysis.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtcorebase/src/org/eclipse/qvtd/pivot/qvtcorebase/analysis/RootDomainUsageAnalysis.java
@@ -25,6 +25,7 @@ import org.eclipse.ocl.pivot.Detail;
import org.eclipse.ocl.pivot.Element;
import org.eclipse.ocl.pivot.Operation;
import org.eclipse.ocl.pivot.Property;
+import org.eclipse.ocl.pivot.Variable;
import org.eclipse.ocl.pivot.internal.complete.CompleteModelInternal;
import org.eclipse.ocl.pivot.internal.utilities.EnvironmentFactoryInternal;
import org.eclipse.ocl.pivot.utilities.ClassUtil;
@@ -336,6 +337,10 @@ public class RootDomainUsageAnalysis extends AbstractDomainUsageAnalysis
enforceableMask |= bitMask;
}
setUsage(typedModel, typedModelUsage);
+ Variable ownedContext = typedModel.getOwnedContext();
+ if (ownedContext != null) {
+ setUsage(ownedContext, typedModelUsage);
+ }
Set<CompleteClass> completeClasses = new HashSet<CompleteClass>();
for (org.eclipse.ocl.pivot.Package asPackage : QVTbaseUtil.getAllUsedPackages(typedModel)) {
for (org.eclipse.ocl.pivot.Class asClass : asPackage.getOwnedClasses()) {
@@ -389,6 +394,10 @@ public class RootDomainUsageAnalysis extends AbstractDomainUsageAnalysis
checkableUsage = getConstantUsage(getAnyMask() & checkableMask);
enforceableUsage = getConstantUsage(getAnyMask() & enforceableMask);
middleUsage = getConstantUsage(getAnyMask() & ~checkableMask & ~enforceableMask);
+ Variable ownedContext = transformation.getOwnedContext();
+ if (ownedContext != null) {
+ setUsage(ownedContext, getAnyUsage());
+ }
visit(transformation);
return element2usage;
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEnvironmentFactory.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEnvironmentFactory.java
index 968ddf3e5..131015c22 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEnvironmentFactory.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiEnvironmentFactory.java
@@ -20,12 +20,13 @@ import org.eclipse.ocl.pivot.evaluation.ModelManager;
import org.eclipse.ocl.pivot.resource.ProjectManager;
import org.eclipse.ocl.pivot.utilities.AbstractEnvironmentFactory;
import org.eclipse.qvtd.pivot.qvtbase.Transformation;
+import org.eclipse.qvtd.pivot.qvtbase.model.QVTbaseLibrary;
public class QVTiEnvironmentFactory extends AbstractEnvironmentFactory {
public QVTiEnvironmentFactory(@NonNull ProjectManager projectMap, @Nullable ResourceSet externalResourceSet) {
super(projectMap, externalResourceSet);
-// getStandardLibrary().setDefaultStandardLibraryURI(QVTdStdlib.STDLIB_URI);
+ getStandardLibrary().setDefaultStandardLibraryURI(QVTbaseLibrary.STDLIB_URI);
}
@Override
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiModelManager.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiModelManager.java
index ae6632845..444592e9d 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiModelManager.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiModelManager.java
@@ -27,14 +27,17 @@ import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
-import org.eclipse.ocl.pivot.Package;
import org.eclipse.ocl.pivot.PivotPackage;
import org.eclipse.ocl.pivot.Type;
import org.eclipse.ocl.pivot.evaluation.ModelManager;
+import org.eclipse.ocl.pivot.ids.IdResolver;
import org.eclipse.ocl.pivot.utilities.ClassUtil;
import org.eclipse.ocl.pivot.utilities.MetamodelManager;
import org.eclipse.ocl.pivot.utilities.ParserException;
+import org.eclipse.qvtd.pivot.qvtbase.Transformation;
import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
+import org.eclipse.qvtd.pivot.qvtbase.evaluation.TransformationInstance;
+import org.eclipse.qvtd.pivot.qvtbase.evaluation.TypedModelInstance;
/**
* QVTc Domain Manager is the class responsible for managing the QVTc virtual
@@ -128,7 +131,7 @@ public class QVTiModelManager implements ModelManager
// Find the typed model for the type
org.eclipse.ocl.pivot.Package p = type.getOwningPackage();
for (TypedModel d : modelResourceMap.keySet()) {
- for (Package up : d.getUsedPackage()) {
+ for (org.eclipse.ocl.pivot.Package up : d.getUsedPackage()) {
if (up.equals(p)) {
for (Object o : getElementsByType(d, type)) {
elements.add((EObject) o);
@@ -139,6 +142,10 @@ public class QVTiModelManager implements ModelManager
return elements;
}
+ public @NonNull MetamodelManager getMetamodelManager() {
+ return metamodelManager;
+ }
+
/**
* Gets the model (resource) for a given TypedModel.
*
@@ -318,4 +325,62 @@ public class QVTiModelManager implements ModelManager
public void setUnnavigableOpposite(@NonNull Integer cacheIndex, @NonNull Object targetObject, Object sourceObject) {
((Map<Object, Object>)unnavigableOpposites[cacheIndex]).put(sourceObject, targetObject);
}
+
+ public static class QVTiTransformationInstance implements TransformationInstance
+ {
+ protected final @NonNull QVTiModelManager modelManager;
+ protected final @NonNull Transformation transformation;
+
+ public QVTiTransformationInstance(@NonNull QVTiModelManager modelManager, @NonNull Transformation transformation) {
+ this.modelManager = modelManager;
+ this.transformation = transformation;
+ }
+ }
+
+ public static class QVTiTypedModelInstance implements TypedModelInstance
+ {
+ protected final @NonNull QVTiModelManager modelManager;
+ protected final @NonNull TypedModel typedModel;
+
+ public QVTiTypedModelInstance(@NonNull QVTiModelManager modelManager, @NonNull TypedModel typedModel) {
+ this.modelManager = modelManager;
+ this.typedModel = typedModel;
+ }
+
+ @Override
+ public @NonNull Set<Object> getAllObjects() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public @NonNull Set<Object> getObjectsOfKind(@NonNull org.eclipse.ocl.pivot.Class type) {
+ IdResolver idResolver = modelManager.getMetamodelManager().getEnvironmentFactory().getIdResolver();
+ Set<Object> results = new HashSet<Object>();
+ Set<?> instances = modelManager.get(type);
+ for (Object instance : instances) {
+ if (instance != null) {
+ results.add(idResolver.boxedValueOf(instance)); // FIXME Move to model manager
+ }
+ }
+ return results;
+ }
+
+ @Override
+ public @NonNull Set<Object> getObjectsOfType(@NonNull org.eclipse.ocl.pivot.Class type) {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public @NonNull Set<Object> getRootObjects() {
+ throw new UnsupportedOperationException();
+ }
+ }
+
+ public Object getTransformationInstance(@NonNull Transformation transformation) {
+ return new QVTiTransformationInstance(this, transformation);
+ }
+
+ public Object getTypedModelInstance(@NonNull TypedModel typedModel) {
+ return new QVTiTypedModelInstance(this, typedModel);
+ }
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiPivotEvaluator.java b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiPivotEvaluator.java
index 2b4f72db4..d86429afa 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiPivotEvaluator.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtimperative/src/org/eclipse/qvtd/pivot/qvtimperative/evaluation/QVTiPivotEvaluator.java
@@ -18,6 +18,8 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.xmi.XMLResource;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.ocl.pivot.PivotFactory;
+import org.eclipse.ocl.pivot.Variable;
import org.eclipse.ocl.pivot.evaluation.EvaluationEnvironment;
import org.eclipse.ocl.pivot.evaluation.EvaluationVisitor;
import org.eclipse.ocl.pivot.internal.manager.PivotMetamodelManager;
@@ -88,6 +90,26 @@ public class QVTiPivotEvaluator implements EvaluationMonitor
public Boolean execute() {
EvaluationEnvironment evalEnv = environmentFactory.createEvaluationEnvironment(transformation, modelManager);
EvaluationVisitor visitor = environmentFactory.createEvaluationVisitor(evalEnv);
+ Variable ownedContext = transformation.getOwnedContext();
+ if (ownedContext == null) { // FIXME fixing missing init
+ ownedContext = PivotFactory.eINSTANCE.createVariable();
+ ownedContext.setName("this");
+ ownedContext.setType(environmentFactory.getStandardLibrary().getLibraryType("Transformation"));
+ ownedContext.setIsRequired(true);
+ transformation.setOwnedContext(ownedContext);
+ }
+ evalEnv.add(ownedContext, modelManager.getTransformationInstance(transformation));
+ for (TypedModel typedModel : transformation.getModelParameter()) {
+ ownedContext = typedModel.getOwnedContext();
+ if (ownedContext == null) {
+ ownedContext = PivotFactory.eINSTANCE.createVariable();
+ ownedContext.setName("this");
+ ownedContext.setType(environmentFactory.getStandardLibrary().getLibraryType("Model"));
+ ownedContext.setIsRequired(true);
+ typedModel.setOwnedContext(ownedContext);
+ }
+ evalEnv.add(ownedContext, modelManager.getTypedModelInstance(typedModel));
+ }
return (Boolean) transformation.accept(visitor);
}
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtcorebase/src/org/eclipse/qvtd/xtext/qvtcorebase/cs2as/QVTcoreBaseCSLeft2RightVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtcorebase/src/org/eclipse/qvtd/xtext/qvtcorebase/cs2as/QVTcoreBaseCSLeft2RightVisitor.java
index 79d9c3fff..31ae59ae4 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtcorebase/src/org/eclipse/qvtd/xtext/qvtcorebase/cs2as/QVTcoreBaseCSLeft2RightVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtcorebase/src/org/eclipse/qvtd/xtext/qvtcorebase/cs2as/QVTcoreBaseCSLeft2RightVisitor.java
@@ -10,23 +10,32 @@
*******************************************************************************/
package org.eclipse.qvtd.xtext.qvtcorebase.cs2as;
+import java.util.List;
+
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
+import org.eclipse.ocl.pivot.Element;
import org.eclipse.ocl.pivot.NamedElement;
import org.eclipse.ocl.pivot.OCLExpression;
import org.eclipse.ocl.pivot.Operation;
import org.eclipse.ocl.pivot.OperationCallExp;
import org.eclipse.ocl.pivot.PivotPackage;
import org.eclipse.ocl.pivot.Type;
+import org.eclipse.ocl.pivot.Variable;
+import org.eclipse.ocl.pivot.utilities.FeatureFilter;
import org.eclipse.ocl.pivot.utilities.NameUtil;
import org.eclipse.ocl.pivot.utilities.PivotUtil;
import org.eclipse.ocl.xtext.base.cs2as.CS2ASConversion;
import org.eclipse.ocl.xtext.basecs.ElementCS;
+import org.eclipse.ocl.xtext.basecs.ModelElementCS;
import org.eclipse.ocl.xtext.essentialocl.cs2as.ImplicitSourceTypeIterator;
+import org.eclipse.ocl.xtext.essentialocl.cs2as.ImplicitSourceVariableIterator;
import org.eclipse.ocl.xtext.essentialoclcs.AbstractNameExpCS;
+import org.eclipse.ocl.xtext.essentialoclcs.NameExpCS;
import org.eclipse.ocl.xtext.essentialoclcs.RoundBracketedClauseCS;
import org.eclipse.qvtd.pivot.qvtbase.Function;
import org.eclipse.qvtd.pivot.qvtbase.Transformation;
+import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbaseUtil;
import org.eclipse.qvtd.pivot.qvtcorebase.AbstractMapping;
import org.eclipse.qvtd.xtext.qvtcorebasecs.AbstractMappingCS;
@@ -72,6 +81,27 @@ public class QVTcoreBaseCSLeft2RightVisitor extends AbstractQVTcoreBaseCSLeft2Ri
};
}
+ @Override
+ protected @NonNull ImplicitSourceVariableIterator createImplicitSourceVariableIterator(@NonNull ModelElementCS csExp) {
+ return new ImplicitSourceVariableIterator(csExp) {
+ @Override
+ protected boolean doNext(@NonNull ElementCS csParent, @NonNull ElementCS csChild) {
+ if (csParent instanceof AbstractMappingCS) {
+ AbstractMapping asContext = PivotUtil.getPivot(AbstractMapping.class, (AbstractMappingCS)csParent);
+ if (asContext != null) {
+ Variable asVariable = asContext.getTransformation().getOwnedContext();
+ if (asVariable != null) {
+ setNext(asVariable);
+ }
+ }
+ return DONE; // no more parents
+ }
+ return super.doNext(csParent, csChild);
+ }
+
+ };
+ }
+
private @Nullable Function getBestFunction(@NonNull Invocations invocations) {
for (NamedElement invocation : invocations) {
if (invocation instanceof Function) {
@@ -88,7 +118,14 @@ public class QVTcoreBaseCSLeft2RightVisitor extends AbstractQVTcoreBaseCSLeft2Ri
if (function != null) {
return new ResolvedInvocation(function);
}
- return null;
+ Iterable<? extends Operation> nonStaticOperations = metamodelManager.getAllOperations(asType, FeatureFilter.SELECT_NON_STATIC, name);
+ List<NamedElement> invocations = getInvocationsInternal(null, nonStaticOperations, iteratorCount, expressionCount);
+// if (asTypeValue != null) {
+// Iterable<? extends Operation> staticOperations = metamodelManager.getAllOperations(asTypeValue, FeatureFilter.SELECT_STATIC, name);
+// invocations = getInvocationsInternal(invocations, staticOperations, iteratorCount, expressionCount);
+// }
+ return invocations != null ? new UnresolvedInvocations(asType, invocations) : null;
+// return null;
}
return super.getInvocations(asType, asTypeValue, name, iteratorCount, expressionCount);
}
@@ -110,4 +147,17 @@ public class QVTcoreBaseCSLeft2RightVisitor extends AbstractQVTcoreBaseCSLeft2Ri
}
return super.resolveBestInvocation(sourceExp, csRoundBracketedClause, invocations);
}
+
+ @Override
+ protected Element resolveSimpleNameExp(@NonNull NameExpCS csNameExp, @NonNull Element element) {
+ if (element instanceof Transformation) {
+ Variable ownedContext = ((Transformation)element).getOwnedContext();
+ return resolveVariableExp(csNameExp, ownedContext);
+ }
+ else if (element instanceof TypedModel) {
+ Variable ownedContext = ((TypedModel)element).getOwnedContext();
+ return resolveVariableExp(csNameExp, ownedContext);
+ }
+ return super.resolveSimpleNameExp(csNameExp, element);
+ }
} \ No newline at end of file
diff --git a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java
index 9a1584864..bb87d15fb 100644
--- a/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java
+++ b/plugins/org.eclipse.qvtd.xtext.qvtimperative/src/org/eclipse/qvtd/xtext/qvtimperative/cs2as/QVTimperativeCSContainmentVisitor.java
@@ -19,6 +19,7 @@ import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.ocl.pivot.Import;
+import org.eclipse.ocl.pivot.PivotFactory;
import org.eclipse.ocl.pivot.PivotPackage;
import org.eclipse.ocl.pivot.Variable;
import org.eclipse.ocl.pivot.internal.utilities.PivotUtilInternal;
@@ -35,6 +36,7 @@ import org.eclipse.qvtd.pivot.qvtbase.Function;
import org.eclipse.qvtd.pivot.qvtbase.Predicate;
import org.eclipse.qvtd.pivot.qvtbase.QVTbasePackage;
import org.eclipse.qvtd.pivot.qvtbase.Transformation;
+import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
import org.eclipse.qvtd.pivot.qvtcorebase.Assignment;
import org.eclipse.qvtd.pivot.qvtcorebase.BottomPattern;
import org.eclipse.qvtd.pivot.qvtcorebase.CoreDomain;
@@ -58,6 +60,7 @@ import org.eclipse.qvtd.pivot.qvtimperative.QVTimperativePackage;
import org.eclipse.qvtd.pivot.qvtimperative.VariablePredicate;
import org.eclipse.qvtd.xtext.qvtcorebasecs.PredicateOrAssignmentCS;
import org.eclipse.qvtd.xtext.qvtcorebasecs.BottomPatternCS;
+import org.eclipse.qvtd.xtext.qvtcorebasecs.DirectionCS;
import org.eclipse.qvtd.xtext.qvtcorebasecs.DomainCS;
import org.eclipse.qvtd.xtext.qvtcorebasecs.GuardPatternCS;
import org.eclipse.qvtd.xtext.qvtcorebasecs.PredicateCS;
@@ -92,6 +95,21 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
}
@Override
+ public Continuation<?> visitDirectionCS(@NonNull DirectionCS csElement) {
+ Continuation<?> continuation = super.visitDirectionCS(csElement);
+ TypedModel asTypedModel = PivotUtil.getPivot(TypedModel.class, csElement);
+ if (asTypedModel != null) {
+ org.eclipse.ocl.pivot.Class libModel = standardLibrary.getLibraryType("Model");
+ Variable contextVariable = PivotFactory.eINSTANCE.createVariable();
+ contextVariable.setName(asTypedModel.getName());
+ contextVariable.setType(libModel);
+ contextVariable.setIsRequired(true);
+ asTypedModel.setOwnedContext(contextVariable);
+ }
+ return continuation;
+ }
+
+ @Override
public Continuation<?> visitMappingCS(@NonNull MappingCS csElement) {
@NonNull Mapping pivotElement = refreshNamedElement(Mapping.class, QVTimperativePackage.Literals.MAPPING, csElement);
DomainCS csMiddle = csElement.getOwnedMiddle();
@@ -267,7 +285,17 @@ public class QVTimperativeCSContainmentVisitor extends AbstractQVTimperativeCSCo
@Override
public Continuation<?> visitTransformationCS( @NonNull TransformationCS csElement) {
- // TODO Auto-generated method stub
- return super.visitTransformationCS(csElement);
+ Continuation<?> continuation = super.visitTransformationCS(csElement);
+ Transformation asTransformation = PivotUtil.getPivot(Transformation.class, csElement);
+ if (asTransformation != null) {
+ org.eclipse.ocl.pivot.Class libTransformation = standardLibrary.getLibraryType("Transformation");
+ asTransformation.getSuperClasses().add(libTransformation);
+ Variable contextVariable = PivotFactory.eINSTANCE.createVariable();
+ contextVariable.setName("this");
+ contextVariable.setType(libTransformation);
+ contextVariable.setIsRequired(true);
+ asTransformation.setOwnedContext(contextVariable);
+ }
+ return continuation;
}
}
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2Target.qvtias b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2Target.qvtias
index 54a39771a..4f6f69c8c 100644
--- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2Target.qvtias
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2Target.qvtias
@@ -9,8 +9,12 @@
<ownedImports importedNamespace="pivot:Model TargetLookup.ocl.oclas#/"/>
<ownedPackages xmi:id="P." name="">
<ownedClasses xsi:type="qvtb:Transformation" xmi:id="T..Source2Target_qvtp_qvtias" name="Source2Target_qvtp_qvtias">
- <modelParameter xmi:id="qT..Source2Target_qvtp_qvtias.leftCS" name="leftCS" usedPackage="SourceMM1.ecore.oclas#P.source"/>
- <modelParameter xmi:id="qT..Source2Target_qvtp_qvtias.rightAS" name="rightAS" usedPackage="TargetMM1.ecore.oclas#P.target"/>
+ <modelParameter xmi:id="qT..Source2Target_qvtp_qvtias.leftCS" name="leftCS" usedPackage="SourceMM1.ecore.oclas#P.source">
+ <ownedContext name="this" type="pivot:Class http://www.eclipse.org/qvt/2015/QVTbaseLibrary.oclas#T.qvtbaselibrary.Model"/>
+ </modelParameter>
+ <modelParameter xmi:id="qT..Source2Target_qvtp_qvtias.rightAS" name="rightAS" usedPackage="TargetMM1.ecore.oclas#P.target">
+ <ownedContext name="this" type="pivot:Class http://www.eclipse.org/qvt/2015/QVTbaseLibrary.oclas#T.qvtbaselibrary.Model"/>
+ </modelParameter>
<rule xsi:type="qvti:Mapping" xmi:id="m..Source2Target_qvtp_qvtias.cSRoot_2_TRoot" name="cSRoot_2_TRoot">
<domain xsi:type="qvtcb:CoreDomain" name="leftCS" isCheckable="true" isEnforceable="false" typedModel="#qT..Source2Target_qvtp_qvtias.leftCS">
<guardPattern>
@@ -49,7 +53,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.cX_2_A3.leftCS.guard.x"/>
</ownedSource>
@@ -58,7 +62,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.cX_2_A3.leftCS.guard.x"/>
</ownedSource>
@@ -89,14 +93,14 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.cX_2_A2.leftCS.guard.x"/>
</ownedSource>
</conditionExpression>
</predicate>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.cX_2_A2.leftCS.guard.x"/>
</conditionExpression>
@@ -124,7 +128,7 @@
</domain>
<guardPattern>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.cX_2_A1.leftCS.guard.x"/>
</conditionExpression>
@@ -299,7 +303,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA3_name.leftCS.guard.x"/>
</ownedSource>
@@ -308,7 +312,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA3_name.leftCS.guard.x"/>
</ownedSource>
@@ -346,7 +350,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA3_ownsC.leftCS.guard.x"/>
</ownedSource>
@@ -355,7 +359,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA3_ownsC.leftCS.guard.x"/>
</ownedSource>
@@ -413,14 +417,14 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA2_name.leftCS.guard.x"/>
</ownedSource>
</conditionExpression>
</predicate>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA2_name.leftCS.guard.x"/>
</conditionExpression>
@@ -457,14 +461,14 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA2_ownsC.leftCS.guard.x"/>
</ownedSource>
</conditionExpression>
</predicate>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA2_ownsC.leftCS.guard.x"/>
</conditionExpression>
@@ -519,7 +523,7 @@
</domain>
<guardPattern>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA1_name.leftCS.guard.x"/>
</conditionExpression>
@@ -554,7 +558,7 @@
</domain>
<guardPattern>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA1_ownsB.leftCS.guard.x"/>
</conditionExpression>
@@ -803,7 +807,7 @@
</guardPattern>
<bottomPattern>
<assignment xsi:type="qvtcb:PropertyAssignment" isDefault="false" targetProperty="TargetMM1.ecore.oclas#p.target.D.refsC">
- <value xsi:type="pivot:OperationCallExp" type="pivot:Class TargetMM1.ecore.oclas#T.target.C" referredOperation="TargetLookup.ocl.oclas#o.target.D.lookupC..source.Z">
+ <value xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:Class TargetMM1.ecore.oclas#T.target.C" referredOperation="TargetLookup.ocl.oclas#o.target.D.lookupC..source.Z">
<ownedSource xsi:type="pivot:OperationCallExp" type="pivot:Class TargetMM1.ecore.oclas#T.target.D" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.OclAny.oclAsType..TT">
<ownedSource xsi:type="pivot:PropertyCallExp" type="pivot:Class http://www.eclipse.org/emf/2002/Ecore.oclas#T.ecore.EObject"
referredProperty="SourceMM1.ecore.oclas#p.source.SElement.ast">
@@ -901,7 +905,7 @@
</guardPattern>
<bottomPattern>
<assignment xsi:type="qvtcb:PropertyAssignment" isDefault="false" targetProperty="TargetMM1.ecore.oclas#p.target.D.refsB">
- <value xsi:type="pivot:OperationCallExp" type="pivot:Class TargetMM1.ecore.oclas#T.target.B" referredOperation="TargetLookup.ocl.oclas#o.target.D.lookupB..source.Z">
+ <value xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:Class TargetMM1.ecore.oclas#T.target.B" referredOperation="TargetLookup.ocl.oclas#o.target.D.lookupB..source.Z">
<ownedSource xsi:type="pivot:OperationCallExp" type="pivot:Class TargetMM1.ecore.oclas#T.target.D" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.OclAny.oclAsType..TT">
<ownedSource xsi:type="pivot:PropertyCallExp" type="pivot:Class http://www.eclipse.org/emf/2002/Ecore.oclas#T.ecore.EObject"
referredProperty="SourceMM1.ecore.oclas#p.source.SElement.ast">
@@ -1227,6 +1231,7 @@
</mappingStatements>
</mappingStatement>
</rule>
+ <ownedContext name="this" type="pivot:Class http://www.eclipse.org/qvt/2015/QVTbaseLibrary.oclas#T.qvtbaselibrary.Transformation"/>
</ownedClasses>
</ownedPackages>
<ownedPackages xmi:id="P.$$" name="$$" URI="http://www.eclipse.org/ocl/2015/Orphanage" nsPrefix="orphanage">
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2Target.qvtp.qvtias b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2Target.qvtp.qvtias
index 28ee0412d..d04914cf6 100644
--- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2Target.qvtp.qvtias
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/Source2Target.qvtp.qvtias
@@ -49,7 +49,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.cX_2_A3.leftCS.guard.x"/>
</ownedSource>
@@ -58,7 +58,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.cX_2_A3.leftCS.guard.x"/>
</ownedSource>
@@ -89,14 +89,14 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.cX_2_A2.leftCS.guard.x"/>
</ownedSource>
</conditionExpression>
</predicate>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.cX_2_A2.leftCS.guard.x"/>
</conditionExpression>
@@ -124,7 +124,7 @@
</domain>
<guardPattern>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.cX_2_A1.leftCS.guard.x"/>
</conditionExpression>
@@ -299,7 +299,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA3_name.leftCS.guard.x"/>
</ownedSource>
@@ -308,7 +308,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA3_name.leftCS.guard.x"/>
</ownedSource>
@@ -346,7 +346,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA3_ownsC.leftCS.guard.x"/>
</ownedSource>
@@ -355,7 +355,7 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA3_ownsC.leftCS.guard.x"/>
</ownedSource>
@@ -413,14 +413,14 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA2_name.leftCS.guard.x"/>
</ownedSource>
</conditionExpression>
</predicate>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA2_name.leftCS.guard.x"/>
</conditionExpression>
@@ -457,14 +457,14 @@
<predicate>
<conditionExpression xsi:type="pivot:OperationCallExp" name="not" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.Boolean.not">
- <ownedSource xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <ownedSource xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA2_ownsC.leftCS.guard.x"/>
</ownedSource>
</conditionExpression>
</predicate>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA2">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA2_ownsC.leftCS.guard.x"/>
</conditionExpression>
@@ -519,7 +519,7 @@
</domain>
<guardPattern>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA1_name.leftCS.guard.x"/>
</conditionExpression>
@@ -554,7 +554,7 @@
</domain>
<guardPattern>
<predicate>
- <conditionExpression xsi:type="pivot:OperationCallExp" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
+ <conditionExpression xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:PrimitiveType http://www.eclipse.org/ocl/2015/Library.oclas#Boolean"
referredOperation="SourceDisambiguation.ocl.oclas#o.source.X.disambiguatesToA1">
<ownedSource xsi:type="pivot:VariableExp" type="pivot:Class SourceMM1.ecore.oclas#T.source.X" isImplicit="true" referredVariable="#qV..Source2Target_qvtp_qvtias.uA1_ownsB.leftCS.guard.x"/>
</conditionExpression>
@@ -803,7 +803,7 @@
</guardPattern>
<bottomPattern>
<assignment xsi:type="qvtcb:PropertyAssignment" targetProperty="TargetMM1.ecore.oclas#p.target.D.refsC">
- <value xsi:type="pivot:OperationCallExp" type="pivot:Class TargetMM1.ecore.oclas#T.target.C" referredOperation="TargetLookup.ocl.oclas#o.target.D.lookupC..source.Z">
+ <value xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:Class TargetMM1.ecore.oclas#T.target.C" referredOperation="TargetLookup.ocl.oclas#o.target.D.lookupC..source.Z">
<ownedSource xsi:type="pivot:OperationCallExp" type="pivot:Class TargetMM1.ecore.oclas#T.target.D" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.OclAny.oclAsType..TT">
<ownedSource xsi:type="pivot:PropertyCallExp" type="pivot:Class http://www.eclipse.org/emf/2002/Ecore.oclas#T.ecore.EObject"
referredProperty="SourceMM1.ecore.oclas#p.source.SElement.ast">
@@ -901,7 +901,7 @@
</guardPattern>
<bottomPattern>
<assignment xsi:type="qvtcb:PropertyAssignment" targetProperty="TargetMM1.ecore.oclas#p.target.D.refsB">
- <value xsi:type="pivot:OperationCallExp" type="pivot:Class TargetMM1.ecore.oclas#T.target.B" referredOperation="TargetLookup.ocl.oclas#o.target.D.lookupB..source.Z">
+ <value xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:Class TargetMM1.ecore.oclas#T.target.B" referredOperation="TargetLookup.ocl.oclas#o.target.D.lookupB..source.Z">
<ownedSource xsi:type="pivot:OperationCallExp" type="pivot:Class TargetMM1.ecore.oclas#T.target.D" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.OclAny.oclAsType..TT">
<ownedSource xsi:type="pivot:PropertyCallExp" type="pivot:Class http://www.eclipse.org/emf/2002/Ecore.oclas#T.ecore.EObject"
referredProperty="SourceMM1.ecore.oclas#p.source.SElement.ast">
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/TargetLookup.ocl b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/TargetLookup.ocl
index 434ca02ed..e51ecdfee 100644
--- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/TargetLookup.ocl
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example1/TargetLookup.ocl
@@ -46,7 +46,7 @@ def : _lookupNamespaces(env : env::Environment, path : source::PathElementCS, lo
let foundNS = env.namedElements->selectByKind(Namespace)->select(name = path.name)
in if foundNS->isEmpty() and not (env.parentEnv = null) and not local
then _lookupNamespaces(env.parentEnv, path, local)
- else foundNS
+ else foundNS->asSet()
endif
def : _lookupNamespace(path : source::PathElementCS, local : Boolean) : Namespace[?] =
@@ -66,7 +66,7 @@ def: _lookupBs(env : env::Environment, path : source::PathElementCS, local : Boo
let foundBs = env.namedElements->selectByKind(B)->select(name = path.name)
in if foundBs->isEmpty() and not (env.parentEnv = null) and not local
then _lookupBs(env.parentEnv, path, local)
- else foundBs
+ else foundBs->asSet()
endif
def : _lookupB(path : source::PathElementCS, local : Boolean) : B[?] =
@@ -87,7 +87,7 @@ def: _lookupCs(env : env::Environment, path : source::PathElementCS, local : Boo
let foundCs = env.namedElements->selectByKind(C)->select(name = path.name)
in if foundCs->isEmpty() and not (env.parentEnv = null) and not local
then _lookupBs(env.parentEnv, path, local)
- else foundCs
+ else foundCs->asSet()
endif
def : _lookupC(path : source::PathElementCS, local : Boolean) : C[?] =
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2as.qvtias b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2as.qvtias
index ff3ee0a48..af1f071f5 100644
--- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2as.qvtias
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2as.qvtias
@@ -116,7 +116,7 @@
<guardPattern/>
<bottomPattern>
<assignment xsi:type="qvtcb:PropertyAssignment" isDefault="false" targetProperty="Classes.ecore.oclas#p.classes.Class.superClass">
- <value xsi:type="pivot:OperationCallExp" type="pivot:Class Classes.ecore.oclas#T.classes.Class" referredOperation="ClassesNameResolution.ocl.oclas#o.classes.Class.lookupClass..classescs.ClassCS">
+ <value xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:Class Classes.ecore.oclas#T.classes.Class" referredOperation="ClassesNameResolution.ocl.oclas#o.classes.Class.lookupClass..classescs.ClassCS">
<ownedSource xsi:type="pivot:OperationCallExp" type="pivot:Class Classes.ecore.oclas#T.classes.Class" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.OclAny.oclAsType..TT">
<ownedSource xsi:type="pivot:PropertyCallExp" type="pivot:Class http://www.eclipse.org/emf/2002/Ecore.oclas#T.ecore.EObject"
referredProperty="ClassesCS.ecore.oclas#p.classescs.ElementCS.ast">
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2as.qvtp.qvtias b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2as.qvtp.qvtias
index 861afcd92..1394da12f 100644
--- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2as.qvtp.qvtias
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/src/org/eclipse/qvtd/cs2as/compiler/tests/models/example2/classescs2as.qvtp.qvtias
@@ -116,7 +116,7 @@
<guardPattern/>
<bottomPattern>
<assignment xsi:type="qvtcb:PropertyAssignment" targetProperty="Classes.ecore.oclas#p.classes.Class.superClass">
- <value xsi:type="pivot:OperationCallExp" type="pivot:Class Classes.ecore.oclas#T.classes.Class" referredOperation="ClassesNameResolution.ocl.oclas#o.classes.Class.lookupClass..classescs.ClassCS">
+ <value xsi:type="pivot:OperationCallExp" isRequired="false" type="pivot:Class Classes.ecore.oclas#T.classes.Class" referredOperation="ClassesNameResolution.ocl.oclas#o.classes.Class.lookupClass..classescs.ClassCS">
<ownedSource xsi:type="pivot:OperationCallExp" type="pivot:Class Classes.ecore.oclas#T.classes.Class" referredOperation="http://www.eclipse.org/ocl/2015/Library.oclas#o.ocl.OclAny.oclAsType..TT">
<ownedSource xsi:type="pivot:PropertyCallExp" type="pivot:Class http://www.eclipse.org/emf/2002/Ecore.oclas#T.ecore.EObject"
referredProperty="ClassesCS.ecore.oclas#p.classescs.ElementCS.ast">
diff --git a/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/cg/classescs2as_qvtp_qvtias.java b/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/cg/classescs2as_qvtp_qvtias.java
index 9288e8755..9b3a6e9df 100644
--- a/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/cg/classescs2as_qvtp_qvtias.java
+++ b/tests/org.eclipse.qvtd.cs2as.compiler.tests/tests-gen/cg/classescs2as_qvtp_qvtias.java
@@ -122,7 +122,7 @@ public class classescs2as_qvtp_qvtias extends CS2ASTransformationExecutor
}
/**
- * classes::Visitable::lookupPackage(pathSeq : OrderedSet(classescs::PathElementCS)) : classes::Package[1]
+ * classes::Visitable::lookupPackage(pathSeq : OrderedSet(classescs::PathElementCS)) : classes::Package[?]
*
*
* if pathSeq->size() = 1
@@ -133,12 +133,12 @@ public class classescs2as_qvtp_qvtias extends CS2ASTransformationExecutor
* ._lookupPackage(pathSeq->last())
* endif
*/
- public /*@NonNull*/ /*@NonInvalid*/ Package lookupPackage(final /*@NonNull*/ /*@NonInvalid*/ Visitable self_0, final /*@NonNull*/ /*@NonInvalid*/ List<PathElementCS> pathSeq) {
+ public /*@Nullable*/ /*@NonInvalid*/ Package lookupPackage(final /*@NonNull*/ /*@NonInvalid*/ Visitable self_0, final /*@NonNull*/ /*@NonInvalid*/ List<PathElementCS> pathSeq) {
final /*@NonNull*/ /*@NonInvalid*/ IdResolver idResolver = evaluator.getIdResolver();
final /*@NonNull*/ /*@NonInvalid*/ OrderedSetValue BOXED_pathSeq_3 = idResolver.createOrderedSetOfAll(ORD_CLSSid_PathElementCS, pathSeq);
final /*@NonNull*/ /*@Thrown*/ IntegerValue size = CollectionSizeOperation.INSTANCE.evaluate(BOXED_pathSeq_3);
final /*@Thrown*/ boolean eq = size.equals(INT_1);
- /*@NonNull*/ /*@Thrown*/ Package symbol_0;
+ /*@Nullable*/ /*@Thrown*/ Package symbol_0;
if (eq) {
final /*@Nullable*/ /*@Thrown*/ PathElementCS first = (PathElementCS)OrderedCollectionFirstOperation.INSTANCE.evaluate(BOXED_pathSeq_3);
LookupEnvironment _lookupEnv = new org.eclipse.qvtd.cs2as.compiler.tests.models.example2.java.LookupEnvironment(evaluator,first);
@@ -157,7 +157,7 @@ public class classescs2as_qvtp_qvtias extends CS2ASTransformationExecutor
final /*@NonNull*/ /*@Thrown*/ OrderedSetValue subOrderedSet = OrderedSetSubOrderedSetOperation.INSTANCE.evaluate(BOXED_pathSeq_3, INT_1, diff);
final List<PathElementCS> UNBOXED_subOrderedSet = subOrderedSet.asEcoreObjects(idResolver, PathElementCS.class);
assert UNBOXED_subOrderedSet != null;
- final /*@NonNull*/ /*@Thrown*/ Package lookupPackage = this.lookupPackage(self_0, UNBOXED_subOrderedSet);
+ final /*@Nullable*/ /*@Thrown*/ Package lookupPackage = this.lookupPackage(self_0, UNBOXED_subOrderedSet);
final /*@Nullable*/ /*@Thrown*/ PathElementCS last = (PathElementCS)OrderedCollectionLastOperation.INSTANCE.evaluate(BOXED_pathSeq_3);
LookupEnvironment _lookupEnv_0 = new org.eclipse.qvtd.cs2as.compiler.tests.models.example2.java.LookupEnvironment(evaluator,last);
ClassesLookupVisitor _lookupVisitor_0 = new org.eclipse.qvtd.cs2as.compiler.tests.models.example2.java.ClassesLookupVisitor(_lookupEnv_0);
@@ -354,7 +354,7 @@ public class classescs2as_qvtp_qvtias extends CS2ASTransformationExecutor
final /*@NonNull*/ /*@Thrown*/ OrderedSetValue BOXED_pathSeq_0_3 = idResolver.createOrderedSetOfAll(ORD_CLSSid_PathElementCS, pathSeq_0);
final /*@NonNull*/ /*@Thrown*/ IntegerValue size = CollectionSizeOperation.INSTANCE.evaluate(BOXED_pathSeq_0_3);
final /*@Thrown*/ boolean eq_0 = size.equals(INT_1);
- /*@NonNull*/ /*@Thrown*/ example2.classes.Class symbol_2;
+ /*@Nullable*/ /*@Thrown*/ example2.classes.Class symbol_2;
if (eq_0) {
final /*@Nullable*/ /*@Thrown*/ PathElementCS first = (PathElementCS)OrderedCollectionFirstOperation.INSTANCE.evaluate(BOXED_pathSeq_0_3);
LookupEnvironment _lookupEnv = new org.eclipse.qvtd.cs2as.compiler.tests.models.example2.java.LookupEnvironment(evaluator,first);
@@ -370,13 +370,13 @@ public class classescs2as_qvtp_qvtias extends CS2ASTransformationExecutor
}
else {
if (self_1 == null) {
- throwNull(classCS_1, "Null source for \'classes::Visitable::lookupPackage(OrderedSet(classescs::PathElementCS)) : classes::Package\'");
+ throwNull(classCS_1, "Null source for \'classes::Visitable::lookupPackage(OrderedSet(classescs::PathElementCS)) : classes::Package[?]\'");
}
final /*@NonNull*/ /*@Thrown*/ IntegerValue diff = (IntegerValue)NumericMinusOperation.INSTANCE.evaluate(size, INT_1);
final /*@NonNull*/ /*@Thrown*/ OrderedSetValue subOrderedSet = OrderedSetSubOrderedSetOperation.INSTANCE.evaluate(BOXED_pathSeq_0_3, INT_1, diff);
final List<PathElementCS> UNBOXED_subOrderedSet = subOrderedSet.asEcoreObjects(idResolver, PathElementCS.class);
assert UNBOXED_subOrderedSet != null;
- final /*@NonNull*/ /*@Thrown*/ Package lookupPackage = this.lookupPackage(self_1, UNBOXED_subOrderedSet);
+ final /*@Nullable*/ /*@Thrown*/ Package lookupPackage = this.lookupPackage(self_1, UNBOXED_subOrderedSet);
final /*@Nullable*/ /*@Thrown*/ PathElementCS last = (PathElementCS)OrderedCollectionLastOperation.INSTANCE.evaluate(BOXED_pathSeq_0_3);
LookupEnvironment _lookupEnv_0 = new org.eclipse.qvtd.cs2as.compiler.tests.models.example2.java.LookupEnvironment(evaluator,last);
ClassesLookupVisitor _lookupVisitor_0 = new org.eclipse.qvtd.cs2as.compiler.tests.models.example2.java.ClassesLookupVisitor(_lookupEnv_0);
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src-gen/cg/classescs2as_Bug459225.java b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src-gen/cg/classescs2as_Bug459225.java
index 3a90f6d5a..a6b0f9792 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src-gen/cg/classescs2as_Bug459225.java
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src-gen/cg/classescs2as_Bug459225.java
@@ -91,7 +91,7 @@ public class classescs2as_Bug459225 extends AbstractTransformationExecutor
}
/**
- * classescs::NamedElementCS::computeName() : String[1]
+ * classescs::NamedElementCS::computeName() : String[?]
*
*
* let container : OclElement[?] = self.oclContainer()
@@ -105,7 +105,7 @@ public class classescs2as_Bug459225 extends AbstractTransformationExecutor
* else self.name
* endif
*/
- public @NonNull /*@NonInvalid*/ String computeName(final @NonNull /*@NonInvalid*/ NamedElementCS self_0) {
+ public @Nullable /*@NonInvalid*/ String computeName(final @NonNull /*@NonInvalid*/ NamedElementCS self_0) {
@Nullable /*@Caught*/ Object CAUGHT_container;
try {
final @Nullable /*@Thrown*/ Object container = ClassifierOclContainerOperation.INSTANCE.evaluate(evaluator, self_0);
@@ -149,9 +149,9 @@ public class classescs2as_Bug459225 extends AbstractTransformationExecutor
}
final @Nullable /*@Thrown*/ NamedElementCS oclAsType = (NamedElementCS)OclAnyOclAsTypeOperation.INSTANCE.evaluate(evaluator, CAUGHT_container, TYP_classescs_c_c_NamedElementCS_1);
if (oclAsType == null) {
- throw new InvalidValueException("Null source for \'classescs::NamedElementCS::computeName() : String\'");
+ throw new InvalidValueException("Null source for \'classescs::NamedElementCS::computeName() : String[?]\'");
}
- final @NonNull /*@Thrown*/ String computeName = this.computeName(oclAsType);
+ final @Nullable /*@Thrown*/ String computeName = this.computeName(oclAsType);
final @NonNull /*@Thrown*/ String sum = StringConcatOperation.INSTANCE.evaluate(computeName, STR__c_c);
final @NonNull /*@Thrown*/ String sum_0 = StringConcatOperation.INSTANCE.evaluate(sum, name_0);
symbol_1 = sum_0;
@@ -159,9 +159,6 @@ public class classescs2as_Bug459225 extends AbstractTransformationExecutor
else {
symbol_1 = name_0;
}
- if (symbol_1 == null) {
- throw new InvalidValueException("Null body for \'classescs::NamedElementCS::computeName() : String\'");
- }
return symbol_1;
}
@@ -211,9 +208,9 @@ public class classescs2as_Bug459225 extends AbstractTransformationExecutor
if (not == null) {
throw new InvalidValueException("Null if condition");
}
- @NonNull /*@Thrown*/ String symbol_2;
+ @Nullable /*@Thrown*/ String symbol_2;
if (not) {
- final @NonNull /*@Thrown*/ String computeName = this.computeName(packageCS);
+ final @Nullable /*@Thrown*/ String computeName = this.computeName(packageCS);
symbol_2 = computeName;
}
else {
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/HSV2HLS/HSV2HLS.qvti b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/HSV2HLS/HSV2HLS.qvti
index f712700cd..22de9f844 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/HSV2HLS/HSV2HLS.qvti
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/HSV2HLS/HSV2HLS.qvti
@@ -20,6 +20,7 @@ query hsv2hls::rgb2hsv(color : HSV2HLS::RGB) : HSVTree::HSV;
map __root__ in hsv2hls {
for hsvRoot : HSVTree::HSVNode in HSVTree::HSVNode.allInstances() {
+-- for hsvRoot : HSVTree::HSVNode in hsv.objectsOfKind(HSVTree::HSVNode) {
call HSV2MiddleRoot {
hsvRoot := hsvRoot;
}
@@ -102,4 +103,4 @@ map Middle2HLSRecursion in hsv2hls { -- Mapping child nodes M to R
middleNode := middleChild;
}
}
-} \ No newline at end of file
+}
diff --git a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/QVTiSerializeTests.java b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/QVTiSerializeTests.java
index 6a5186671..5c47541dd 100644
--- a/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/QVTiSerializeTests.java
+++ b/tests/org.eclipse.qvtd.xtext.qvtimperative.tests/src/org/eclipse/qvtd/xtext/qvtimperative/tests/QVTiSerializeTests.java
@@ -26,6 +26,7 @@ import org.eclipse.ocl.pivot.utilities.ClassUtil;
import org.eclipse.ocl.pivot.utilities.OCL;
import org.eclipse.ocl.pivot.utilities.PivotConstants;
import org.eclipse.ocl.xtext.base.services.BaseLinkingService;
+import org.eclipse.qvtd.pivot.qvtbase.utilities.QVTbase;
import org.eclipse.qvtd.xtext.qvtbase.tests.LoadTestCase;
import org.eclipse.qvtd.xtext.qvtbase.tests.utilities.TestsXMLUtil;
import org.eclipse.qvtd.xtext.qvtimperative.QVTimperativeStandaloneSetup;
@@ -38,8 +39,8 @@ import org.eclipse.xtext.resource.XtextResource;
public class QVTiSerializeTests extends LoadTestCase
{
protected void doSerializeRoundTrip(@NonNull String stem) throws Exception {
- OCL ocl1 = OCL.newInstance(OCL.NO_PROJECTS);
- OCL ocl2 = OCL.newInstance(OCL.NO_PROJECTS);
+ OCL ocl1 = QVTbase.newInstance(OCL.NO_PROJECTS, null);
+ OCL ocl2 = QVTbase.newInstance(OCL.NO_PROJECTS, null);
Resource asResource1 = doLoad_Concrete(ocl1, stem + ".qvti", stem + ".qvtias");
URI inputURI = getProjectFileURI(stem + ".qvtias");
URI referenceURI = getProjectFileURI(stem + "ref.qvtias");
@@ -99,7 +100,7 @@ public class QVTiSerializeTests extends LoadTestCase
//
// Load QVTiAS
//
- OCL ocl = OCL.newInstance(OCL.NO_PROJECTS);
+ OCL ocl = QVTbase.newInstance(OCL.NO_PROJECTS);
try {
ASResource asResource = loadQVTiAS(ocl, inputURI);
assertNoResourceErrors("Normalisation failed", asResource);

Back to the top