Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-05-14 12:48:18 -0400
committerEd Willink2016-05-18 09:17:50 -0400
commit0805e9b910b1e782a05e0f88e076b76287ab1617 (patch)
tree337dc73a808a5e2d24561ec52256afe48606d13c
parent053c45e422859429383022e84fc86d3e210629ba (diff)
downloadorg.eclipse.qvtd-0805e9b910b1e782a05e0f88e076b76287ab1617.tar.gz
org.eclipse.qvtd-0805e9b910b1e782a05e0f88e076b76287ab1617.tar.xz
org.eclipse.qvtd-0805e9b910b1e782a05e0f88e076b76287ab1617.zip
[unrelated] Make CGMiddlePropertyCallExp consistent with
CGOppositePropertyCallExp
-rw-r--r--plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java2
-rw-r--r--plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java20
2 files changed, 12 insertions, 10 deletions
diff --git a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java
index 0b7c257d3..8c11b8dec 100644
--- a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java
+++ b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/analyzer/QVTiAS2CGVisitor.java
@@ -486,7 +486,7 @@ public class QVTiAS2CGVisitor extends AS2CGVisitor implements QVTimperativeVisit
// cgExecutorPropertyCallExp.setExecutorProperty(cgExecutorProperty);
// cgPropertyCallExp = cgExecutorPropertyCallExp;
// cgPropertyCallExp.getDependsOn().add(cgExecutorProperty);
- cgPropertyCallExp.setReferredProperty(asOppositeProperty);
+ cgPropertyCallExp.setReferredProperty(asProperty);
setAst(cgPropertyCallExp, asOppositePropertyCallExp);
cgPropertyCallExp.setRequired(asProperty.isIsRequired());
cgPropertyCallExp.setSource(cgSource);
diff --git a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java
index 305d58938..23e9d1e6c 100644
--- a/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java
+++ b/plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java
@@ -98,6 +98,7 @@ import org.eclipse.qvtd.pivot.qvtbase.TypedModel;
import org.eclipse.qvtd.pivot.qvtcorebase.Area;
import org.eclipse.qvtd.pivot.qvtcorebase.Assignment;
import org.eclipse.qvtd.pivot.qvtcorebase.BottomPattern;
+import org.eclipse.qvtd.pivot.qvtcorebase.NavigationAssignment;
import org.eclipse.qvtd.pivot.qvtcorebase.PropertyAssignment;
import org.eclipse.qvtd.pivot.qvtcorebase.RealizedVariable;
import org.eclipse.qvtd.pivot.qvtcorebase.analysis.DomainUsage;
@@ -339,10 +340,10 @@ public class QVTiCG2JavaVisitor extends CG2JavaVisitor<@NonNull QVTiCodeGenerato
CGValuedElement cgInit = getExpression(cgPropertyAssignment.getInitValue());
EPackage ePackage = ClassUtil.nonNullModel(eStructuralFeature.getEContainingClass().getEPackage());
boolean isHazardous = false;
- Element asPropertyAssignment = cgPropertyAssignment.getAst();
- Mapping asMapping = QVTimperativeUtil.getContainingMapping(asPropertyAssignment);
- if ((asMapping != null) && (asPropertyAssignment instanceof PropertyAssignment)) {
- isHazardous = transformationAnalysis.isHazardousWrite(asMapping, (PropertyAssignment)asPropertyAssignment);
+ Element asNavigationAssignment = cgPropertyAssignment.getAst();
+ Mapping asMapping = QVTimperativeUtil.getContainingMapping(asNavigationAssignment);
+ if ((asMapping != null) && (asNavigationAssignment instanceof NavigationAssignment)) {
+ isHazardous = transformationAnalysis.isHazardousWrite(asMapping, (NavigationAssignment)asNavigationAssignment);
}
if (isHazardous || isIncremental) {
js.append("objectManager.assigned(");
@@ -366,10 +367,10 @@ public class QVTiCG2JavaVisitor extends CG2JavaVisitor<@NonNull QVTiCodeGenerato
CGValuedElement cgInit = getExpression(cgPropertyAssignment.getInitValue());
EPackage ePackage = ClassUtil.nonNullModel(eStructuralFeature.getEContainingClass().getEPackage());
boolean isHazardous = false;
- Element asPropertyAssignment = cgPropertyAssignment.getAst();
- Mapping asMapping = QVTimperativeUtil.getContainingMapping(asPropertyAssignment);
- if ((asMapping != null) && (asPropertyAssignment instanceof PropertyAssignment)) {
- isHazardous = transformationAnalysis.isHazardousWrite(asMapping, (PropertyAssignment)asPropertyAssignment);
+ Element asNavigationAssignment = cgPropertyAssignment.getAst();
+ Mapping asMapping = QVTimperativeUtil.getContainingMapping(asNavigationAssignment);
+ if ((asMapping != null) && (asNavigationAssignment instanceof NavigationAssignment)) {
+ isHazardous = transformationAnalysis.isHazardousWrite(asMapping, (NavigationAssignment)asNavigationAssignment);
}
if (isHazardous || isIncremental) {
js.append("objectManager.assigned(");
@@ -1691,7 +1692,8 @@ public class QVTiCG2JavaVisitor extends CG2JavaVisitor<@NonNull QVTiCodeGenerato
@Override
public @NonNull Boolean visitCGMiddlePropertyCallExp(@NonNull CGMiddlePropertyCallExp cgPropertyCallExp) {
- Property asProperty = cgPropertyCallExp.getReferredProperty();
+ Property asOppositeProperty = ClassUtil.nonNullModel(cgPropertyCallExp.getReferredProperty());
+ Property asProperty = ClassUtil.nonNullModel(asOppositeProperty.getOpposite());
assert !asProperty.isIsImplicit();
CGValuedElement source = getExpression(cgPropertyCallExp.getSource());
//

Back to the top