Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-11-06 15:26:12 +0000
committerEd Willink2016-11-06 15:26:12 +0000
commit53c50b024ea59bb0cf944b7c48fba0d64aec15fb (patch)
tree497b1885c6dc8aebb88e823a56a44a69bc646ab9
parentc518047ac717ef61b883f4c5fadc7d6b49d9ba5b (diff)
downloadorg.eclipse.qvtd-53c50b024ea59bb0cf944b7c48fba0d64aec15fb.tar.gz
org.eclipse.qvtd-53c50b024ea59bb0cf944b7c48fba0d64aec15fb.tar.xz
org.eclipse.qvtd-53c50b024ea59bb0cf944b7c48fba0d64aec15fb.zip
[506806] Preserve Node utility when partitioning
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractMappingRegion.java3
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicMappingRegion.java3
-rw-r--r--plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/PartitioningVisitor.java2
3 files changed, 5 insertions, 3 deletions
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractMappingRegion.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractMappingRegion.java
index 9987f1a48..cbe286dae 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractMappingRegion.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/AbstractMappingRegion.java
@@ -354,7 +354,6 @@ public abstract class AbstractMappingRegion extends AbstractRegion implements Ma
}
assert debugHeadNodes.equals(new HashSet<>(headNodes));
//
- computeUtilities(headNodes);
return headNodes;
}
@@ -438,7 +437,7 @@ public abstract class AbstractMappingRegion extends AbstractRegion implements Ma
return unconditionalNodes;
}
- private void computeUtilities(@NonNull Iterable<@NonNull Node> headNodes) { // FIXME remove assertions after 1-Jan-2017
+ protected void computeUtilities(@NonNull Iterable<@NonNull Node> headNodes) { // FIXME remove assertions after 1-Jan-2017
Set<@NonNull Node> stronglyMatchedNodes = computeStronglyMatchedNodes(headNodes);
Set<@NonNull Node> unconditionalNodes = computeUnconditionalNodes(headNodes);
Set<@NonNull Node> conditionalNodes = computeConditionalNodes(unconditionalNodes);
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicMappingRegion.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicMappingRegion.java
index 69e4d4dca..ffb604896 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicMappingRegion.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvtp2qvts/BasicMappingRegion.java
@@ -490,7 +490,8 @@ public class BasicMappingRegion extends AbstractMappingRegion
analyzeAssignmentValues();
analyzeComplexPredicates();
//
- getHeadNodes();
+ List<@NonNull Node> headNodes = getHeadNodes();
+ computeUtilities(headNodes);
}
/**
diff --git a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/PartitioningVisitor.java b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/PartitioningVisitor.java
index ea1bd48eb..c44ba9b8e 100644
--- a/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/PartitioningVisitor.java
+++ b/plugins/org.eclipse.qvtd.compiler/src/org/eclipse/qvtd/compiler/internal/qvts2qvts/partitioner/PartitioningVisitor.java
@@ -170,6 +170,7 @@ class PartitioningVisitor extends AbstractVisitor<@Nullable Visitable>
partialNode = node.createNode(nodeRole, partialRegion);
}
oldNode2partialNode.put(node, partialNode);
+ partialNode.setUtility(node.getUtility());
for (@NonNull TypedElement typedElement : node.getTypedElements()) {
partialNode.addTypedElement(typedElement);
}
@@ -184,6 +185,7 @@ class PartitioningVisitor extends AbstractVisitor<@Nullable Visitable>
};
Node partialNode = variableNode.createNode(nodeRole, partialRegion);
oldNode2partialNode.put(variableNode, partialNode);
+ partialNode.setUtility(variableNode.getUtility());
for (@NonNull TypedElement typedElement : variableNode.getTypedElements()) {
partialNode.addTypedElement(typedElement);
}

Back to the top