Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2019-12-02 15:24:43 +0000
committerEd Willink2019-12-02 15:24:43 +0000
commitffe92b965ccca62c715ab73edd238e5b563b16c7 (patch)
tree1f1ff31d0f95b47773e49502d85650176a83cd2f
parent8e247c397c477a36bd3443eaefd40edd1dc1ce9a (diff)
downloadorg.eclipse.qvtd-ffe92b965ccca62c715ab73edd238e5b563b16c7.tar.gz
org.eclipse.qvtd-ffe92b965ccca62c715ab73edd238e5b563b16c7.tar.xz
org.eclipse.qvtd-ffe92b965ccca62c715ab73edd238e5b563b16c7.zip
all ok better loop conditionality
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtb2qvts/ExpressionSynthesizer.java9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtb2qvts/ExpressionSynthesizer.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtb2qvts/ExpressionSynthesizer.java
index 97d90cc9d..5ccd3c820 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtb2qvts/ExpressionSynthesizer.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtb2qvts/ExpressionSynthesizer.java
@@ -424,7 +424,7 @@ public abstract class ExpressionSynthesizer extends AbstractExtendingQVTbaseVisi
}
if (loopExp instanceof IterateExp) {
Variable accumulator = QVTbaseUtil.getOwnedResult((IterateExp)loopExp);
- Node iteratorNode = createIteratorNode(conditionalExpressionSynthesizer.getRequiredInitUtility(accumulator), accumulator, sourceNode);
+ Node iteratorNode = conditionalExpressionSynthesizer.createIteratorNode(conditionalExpressionSynthesizer.getRequiredInitUtility(accumulator), accumulator, sourceNode);
@SuppressWarnings("unused")
Type iteratorType = QVTbaseUtil.getType(accumulator);
conditionalExpressionSynthesizer.createIteratedEdge(conditionalExpressionSynthesizer.getRequiredInitUtility(iteratorNode), sourceNode, iteratorNode);
@@ -783,12 +783,12 @@ public abstract class ExpressionSynthesizer extends AbstractExtendingQVTbaseVisi
if (navigationEdge != null) {
Node target = navigationEdge.getEdgeTarget();
if (target != targetNode) {
- context.createEqualsEdge(getRequiredInitUtility(getRequiredInitUtility(targetNode)), targetNode, target);
+ context.createEqualsEdge(getRequiredInitUtility(targetNode), targetNode, target);
}
}
else {
// navigationEdge = createRealizedEdge(sourceNode, source2targetProperty, targetNode);
- navigationEdge = createNavigationOrRealizedEdge(getRequiredInitUtility(getRequiredInitUtility(targetNode)), sourceNode, source2targetProperty, targetNode, navigationAssignment);
+ navigationEdge = createNavigationOrRealizedEdge(getRequiredInitUtility(source2targetProperty), sourceNode, source2targetProperty, targetNode, navigationAssignment);
// Property target2sourceProperty = source2targetProperty.getOpposite(); // FIXME move to createEdge
// if (targetNode.isClassNode() && (target2sourceProperty != null) && !target2sourceProperty.isIsMany()) {
// createRealizedEdge(targetNode, target2sourceProperty, sourceNode);
@@ -867,11 +867,12 @@ public abstract class ExpressionSynthesizer extends AbstractExtendingQVTbaseVisi
protected @NonNull InitUtility getRequiredInitUtility(@NonNull InitUtility initUtility) {
boolean isConditional = this.resultUtility.isConditional();
- boolean isNullable = this.resultUtility.isNullable() && initUtility.isNullable();
+ boolean isNullable = initUtility.isNullable();
if (isConditional) {
return isNullable ? InitUtility.NULLABLE_CONDITIONAL : InitUtility.NON_NULL_CONDITIONAL;
}
else {
+ isNullable = isNullable && this.resultUtility.isNullable();
return isNullable ? InitUtility.NULLABLE_MATCHED : InitUtility.NON_NULL_MATCHED;
}
}

Back to the top