Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEd Willink2016-11-02 16:56:51 +0000
committerEd Willink2016-11-02 16:56:51 +0000
commit25c67f635cc3fc3e44947c0c020ca2a48f8ab6c1 (patch)
tree836b51722eac2fdb557d478df57a12b2a901ef86 /plugins
parent2ec2f396df79d2966dc211fa8c07ca8a3a427315 (diff)
downloadorg.eclipse.qvtd-25c67f635cc3fc3e44947c0c020ca2a48f8ab6c1.tar.gz
org.eclipse.qvtd-25c67f635cc3fc3e44947c0c020ca2a48f8ab6c1.tar.xz
org.eclipse.qvtd-25c67f635cc3fc3e44947c0c020ca2a48f8ab6c1.zip
[506849] Ensure cached functions are backward referenced
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.qvtd.codegen/src/org/eclipse/qvtd/codegen/qvti/java/QVTiCG2JavaVisitor.java19
1 files changed, 17 insertions, 2 deletions
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 789cfca2f..2fe6c68f9 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
@@ -28,6 +28,7 @@ import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.ocl.examples.codegen.analyzer.NameManager;
import org.eclipse.ocl.examples.codegen.cgmodel.CGAccumulator;
+import org.eclipse.ocl.examples.codegen.cgmodel.CGCachedOperation;
import org.eclipse.ocl.examples.codegen.cgmodel.CGClass;
import org.eclipse.ocl.examples.codegen.cgmodel.CGCollectionExp;
import org.eclipse.ocl.examples.codegen.cgmodel.CGEcorePropertyCallExp;
@@ -2320,8 +2321,22 @@ public class QVTiCG2JavaVisitor extends CG2JavaVisitor<@NonNull QVTiCodeGenerato
}
doRun(cgTransformation);
for (@NonNull CGOperation cgOperation : ClassUtil.nullFree(cgOperations)) {
- js.append("\n");
- cgOperation.accept(this);
+ if (!(cgOperation instanceof CGCachedOperation)) {
+ js.append("\n");
+ cgOperation.accept(this);
+ }
+ }
+ for (@NonNull CGOperation cgOperation : ClassUtil.nullFree(cgOperations)) {
+ if ((cgOperation instanceof CGCachedOperation) && (((CGCachedOperation)cgOperation).getFinalOperations().size() <= 0)) {
+ js.append("\n");
+ cgOperation.accept(this);
+ }
+ }
+ for (@NonNull CGOperation cgOperation : ClassUtil.nullFree(cgOperations)) {
+ if ((cgOperation instanceof CGCachedOperation) && (((CGCachedOperation)cgOperation).getFinalOperations().size() > 0)) {
+ js.append("\n");
+ cgOperation.accept(this);
+ }
}
for (@NonNull CGMapping cgMapping : ClassUtil.nullFree(cgTransformation.getMappings())) {
js.append("\n");

Back to the top