aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarton Bur2014-07-11 03:24:40 (EDT)
committerZoltan Ujhelyi2014-07-11 08:46:52 (EDT)
commita97a0aa6d742db806963b79b227180c6b0255329 (patch)
tree01fa8a9cf46f463b2c6113e5c8ecc1bf64302b40
parenta9b7f6b8532d50b40e77dcd4c4041f392d614ec7 (diff)
downloadorg.eclipse.incquery-a97a0aa6d742db806963b79b227180c6b0255329.zip
org.eclipse.incquery-a97a0aa6d742db806963b79b227180c6b0255329.tar.gz
org.eclipse.incquery-a97a0aa6d742db806963b79b227180c6b0255329.tar.bz2
[431204] Upon flat body copying variable renaming minor fix.refs/changes/89/29789/3
Change-Id: I035109f7d967e07669a3e4ebf106583957a4bec1 Signed-off-by: Marton Bur <marton.bur@gmail.com>
-rw-r--r--plugins/org.eclipse.incquery.runtime.matchers/src/org/eclipse/incquery/runtime/matchers/psystem/rewriters/PQueryFlattener.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/org.eclipse.incquery.runtime.matchers/src/org/eclipse/incquery/runtime/matchers/psystem/rewriters/PQueryFlattener.java b/plugins/org.eclipse.incquery.runtime.matchers/src/org/eclipse/incquery/runtime/matchers/psystem/rewriters/PQueryFlattener.java
index cc5ffad..336faac 100644
--- a/plugins/org.eclipse.incquery.runtime.matchers/src/org/eclipse/incquery/runtime/matchers/psystem/rewriters/PQueryFlattener.java
+++ b/plugins/org.eclipse.incquery.runtime.matchers/src/org/eclipse/incquery/runtime/matchers/psystem/rewriters/PQueryFlattener.java
@@ -157,8 +157,8 @@ public class PQueryFlattener extends PDisjunctionRewriter {
private Set<PBody> prepareFlatPBody(PBody pBody) {
Set<PBody> bodySet = Sets.newHashSet();
- // Copy here with hierarchical variable renaming
- FlattenerCopier flattenerCopier = copyBody(pBody, new HierarchicalName());
+ // the copying of the body here is necessary for only one containing PDisjunction can be assigned to a PBody
+ FlattenerCopier flattenerCopier = copyBody(pBody);
bodySet.add(flattenerCopier.getCopiedBody());
return bodySet;
}
@@ -200,6 +200,16 @@ public class PQueryFlattener extends PDisjunctionRewriter {
}
/**
+ * Helper function to copy a PBody object as-is. Creates a new copier.
+ *
+ * @param pBody
+ * @return
+ */
+ private FlattenerCopier copyBody(PBody pBody) {
+ return copyBody(pBody, new SameName());
+ }
+
+ /**
* Helper function to copy a PBody object. Creates a new copier.
*
* @param pBody