Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2022-01-03 18:33:26 +0000
committerEd Willink2022-01-03 18:38:25 +0000
commitd1968b7ecdd876f19b1dd47e6f00a89a3baddf48 (patch)
tree28ad0afe96036c61d1deadc7bdf1abfe63fa1471
parent9524763798defa9137c3a9e820b9fce567f5a173 (diff)
downloadorg.eclipse.qvtd-d1968b7ecdd876f19b1dd47e6f00a89a3baddf48.tar.gz
org.eclipse.qvtd-d1968b7ecdd876f19b1dd47e6f00a89a3baddf48.tar.xz
org.eclipse.qvtd-d1968b7ecdd876f19b1dd47e6f00a89a3baddf48.zip
[578030] Fix import / this domain references
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/QVTs2QVTi.java23
-rw-r--r--plugins/org.eclipse.qvtd.pivot.qvtrelation/src/org/eclipse/qvtd/pivot/qvtrelation/utilities/QVTrelationUtil.java11
2 files changed, 22 insertions, 12 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/QVTs2QVTi.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/QVTs2QVTi.java
index 528d518dc..cdefb76e0 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/QVTs2QVTi.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvti/QVTs2QVTi.java
@@ -31,6 +31,7 @@ import org.eclipse.ocl.pivot.OppositePropertyCallExp;
import org.eclipse.ocl.pivot.Package;
import org.eclipse.ocl.pivot.Property;
import org.eclipse.ocl.pivot.PropertyCallExp;
+import org.eclipse.ocl.pivot.internal.manager.Orphanage;
import org.eclipse.ocl.pivot.utilities.ClassUtil;
import org.eclipse.ocl.pivot.utilities.NameUtil;
import org.eclipse.ocl.pivot.utilities.PivotUtil;
@@ -208,16 +209,18 @@ public class QVTs2QVTi extends QVTimperativeHelper
Collections.sort(sortedImportedNamespaces, NameUtil.NAMEABLE_COMPARATOR);
List<Import> ownedImports = model.getOwnedImports();
for (@NonNull Namespace importedNamespace : sortedImportedNamespaces) {
- SymbolNameBuilder s = new SymbolNameBuilder();
- s.appendString("mm_");
- // for (@NonNull String partialName : partialNames) {
- // s.appendString("_");
- // s.appendName(partialName);
- // }
- s.appendName(importedNamespace.getName());
- s.appendName("MM");
- String name = model.reserveSymbolName(s, importedNamespace);
- ownedImports.add(createImport(name, importedNamespace)); // FIXME BUG 530025 bad aliases
+ if (!(importedNamespace instanceof org.eclipse.ocl.pivot.Package) || !Orphanage.isTypeOrphanage((org.eclipse.ocl.pivot.Package)importedNamespace)) {
+ SymbolNameBuilder s = new SymbolNameBuilder();
+ s.appendString("mm_");
+ // for (@NonNull String partialName : partialNames) {
+ // s.appendString("_");
+ // s.appendName(partialName);
+ // }
+ s.appendName(importedNamespace.getName());
+ s.appendName("MM");
+ String name = model.reserveSymbolName(s, importedNamespace);
+ ownedImports.add(createImport(name, importedNamespace)); // FIXME BUG 530025 bad aliases
+ }
}
}
diff --git a/plugins/org.eclipse.qvtd.pivot.qvtrelation/src/org/eclipse/qvtd/pivot/qvtrelation/utilities/QVTrelationUtil.java b/plugins/org.eclipse.qvtd.pivot.qvtrelation/src/org/eclipse/qvtd/pivot/qvtrelation/utilities/QVTrelationUtil.java
index 4e3acd93b..b439dbded 100644
--- a/plugins/org.eclipse.qvtd.pivot.qvtrelation/src/org/eclipse/qvtd/pivot/qvtrelation/utilities/QVTrelationUtil.java
+++ b/plugins/org.eclipse.qvtd.pivot.qvtrelation/src/org/eclipse/qvtd/pivot/qvtrelation/utilities/QVTrelationUtil.java
@@ -440,7 +440,7 @@ public class QVTrelationUtil extends QVTtemplateUtil
}
/**
- * Rewrite asResource to replace ensure that each RelationalTransformation has a $trace$ TypedModel and each
+ * Rewrite asResource to ensure that each RelationalTransformation has $primitove&, $this$, $trace$ TypedModel and each
* Relation has a $trace$ SharedVariable..
*/
public static boolean rewriteMissingTraceArtefacts(@NonNull EnvironmentFactory environmentFactory, @NonNull Resource asResource) {
@@ -465,6 +465,13 @@ public class QVTrelationUtil extends QVTtemplateUtil
}
modelParameters.add(0, helper.createPrimitiveTypedModel());
}
+ TypedModel thisTypedModel = QVTbaseUtil.basicGetThisTypedModel(modelParameters);
+ if (thisTypedModel == null) {
+ if (helper == null) {
+ helper = new QVTrelationHelper(environmentFactory);
+ }
+ modelParameters.add(1, helper.createThisTypedModel());
+ }
}
if (eObject instanceof Relation) {
VariableDeclaration traceClassVariable = null;
@@ -488,6 +495,6 @@ public class QVTrelationUtil extends QVTtemplateUtil
}
}
}
- return helper != null;
+ return false; //helper != null;
}
} \ No newline at end of file

Back to the top