Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [qvtd-dev] Project synchronization

Hi Horacio

On 20/01/2013 10:36, Ed Willink wrote:
The problem is that I have evolved the mutation 'API' to support code generated execution:
That is: Type.createInstance(), Property.initValue() have changed.

For these particular methods I should have provided delegating methods and deprecation. Will rectify for M5.
I developed the delegations but then realized that actually you started using the M2 API after M4, so they are unnecessary.

Attached patch fixes the build problems, adapts to the API changes and provides a launch config so that there are three green tests for
your code built against OCL M4 and QVTd M4.

    Regards

        Ed
### Eclipse Workspace Patch 1.0
#P uk.ac.york.qvtd.library
diff --git build.properties build.properties
index 34d2e4d..596573f 100644
--- build.properties
+++ build.properties
@@ -2,3 +2,4 @@
 output.. = bin/
 bin.includes = META-INF/,\
                .
+additional.bundles = org.eclipse.jdt.annotation
#P uk.ac.york.qvtd.pivot.qvtcore
diff --git src/org/eclipse/qvtd/pivot/qvtcore/evaluation/QVTcoreEvaluationVisitorImpl.java src/org/eclipse/qvtd/pivot/qvtcore/evaluation/QVTcoreEvaluationVisitorImpl.java
index 25877c3..10a5bda 100644
--- src/org/eclipse/qvtd/pivot/qvtcore/evaluation/QVTcoreEvaluationVisitorImpl.java
+++ src/org/eclipse/qvtd/pivot/qvtcore/evaluation/QVTcoreEvaluationVisitorImpl.java
@@ -20,8 +20,6 @@
 import org.eclipse.jdt.annotation.NonNull;
 import org.eclipse.jdt.annotation.Nullable;
 import org.eclipse.ocl.examples.domain.evaluation.DomainModelManager;
-import org.eclipse.ocl.examples.domain.values.ObjectValue;
-import org.eclipse.ocl.examples.domain.values.util.ValuesUtil;
 import org.eclipse.ocl.examples.pivot.Environment;
 import org.eclipse.ocl.examples.pivot.EnvironmentFactory;
 import org.eclipse.ocl.examples.pivot.OCLExpression;
@@ -541,9 +539,9 @@
                 Object slotBinding = getEvaluationEnvironment().getValueOf(slotVar);
                 // TODO what happens if the target property is not a simple attribute?
                 if (slotBinding != null) {
-                    ObjectValue ov = ValuesUtil.createObjectValue(slotBinding);
+//                    ObjectValue ov = ValuesUtil.createObjectValue(slotBinding);
                     Property p = propertyAssignment.getTargetProperty();
-                    p.initValue(metaModelManager, ov, value);
+                    p.initValue(slotBinding, value);
                 }
             } else {
                 throw new UnsupportedOperationException("Unsupported " + propertyAssignment.eClass().getName()
@@ -569,7 +567,7 @@
                 Object slotBinding = getEvaluationEnvironment().getValueOf(slotVar);
                 if(slotBinding != null) {
                     Object value = propertyAssignment.getValue().accept(this);
-                    ObjectValue ov = ValuesUtil.createObjectValue(slotBinding);
+//                    ObjectValue ov = ValuesUtil.createObjectValue(slotBinding);
                     Property p = propertyAssignment.getTargetProperty();
                     //if (p.getOpposite() != null && p.getOpposite().isComposite()) {
                     //    p = p.getOpposite();
@@ -580,7 +578,7 @@
                     //        childs.add(slotBinding);
                     //    }
                     //} else {
-                        p.initValue(metaModelManager, ov, value);
+                        p.initValue(slotBinding, value);
                     //}
                 } else {
                     throw new IllegalArgumentException("Unsupported " + propertyAssignment.eClass().getName()
@@ -613,7 +611,7 @@
         Area area = ((BottomPattern)realizedVariable.eContainer()).getArea();
         if (area instanceof Mapping && isLtoMMapping((Mapping)area)) {
             // Create an element in the middle  model that has a kind equal to the variable type
-            EObject element = (EObject) realizedVariable.getType().createInstance(metaModelManager).asEcoreObject();
+            EObject element = (EObject) realizedVariable.getType().createInstance();
             // Add the EObject to the middle resource
             //Resource mModel = ((QVTcDomainManager)modelManager).getMiddleModel();
             //mModel.getContents().add(element);
@@ -633,7 +631,7 @@
          */
         else if (area instanceof CoreDomain && isMtoRMapping((Mapping) ((CoreDomain)area).getRule())) {
             // Create an element in the R model that has a kind equal to the variable type
-            EObject element = (EObject) realizedVariable.getType().createInstance(metaModelManager).asEcoreObject();
+            EObject element = (EObject) realizedVariable.getType().createInstance();
             // Add the EObject to the R resource
             TypedModel tm = ((CoreDomain)area).getTypedModel();
             //Resource rModel = ((QVTcDomainManager)modelManager).getTypeModelResource(tm);
#P uk.ac.york.qvtd.tests.hhr
diff --git .launches/QVTcore Evaluation Tests.launch .launches/QVTcore Evaluation Tests.launch
new file mode 100644
index 0000000..78ff623
--- /dev/null
+++ .launches/QVTcore Evaluation Tests.launch
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.junit.launchconfig">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/uk.ac.york.qvtd.tests.hhr/src/qvti/TestQVTi.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="qvti.TestQVTi"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="uk.ac.york.qvtd.tests.hhr"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/>
+</launchConfiguration>
diff --git build.properties build.properties
index 4c9a878..3db1caa 100644
--- build.properties
+++ build.properties
@@ -3,4 +3,4 @@
 bin.includes = META-INF/,\
                .,\
                model/
-
+additional.bundles = org.eclipse.jdt.annotation

Back to the top