Skip to content
Snippets Groups Projects
Commit f5a370e3 authored by René Schöne's avatar René Schöne
Browse files

Use new JastAdd option to generate flush methods without body.

parent bb69c30c
No related branches found
No related tags found
1 merge request!1All4one relast
...@@ -47,7 +47,7 @@ task jastadd(type: JavaExec) { ...@@ -47,7 +47,7 @@ task jastadd(type: JavaExec) {
"libs/jastadd2.jar", "libs/jastadd2.jar",
"--debug", "--debug",
"--cache=all", "--cache=all",
"--flush=full", "--flush=api",
"--rewrite=cnta", "--rewrite=cnta",
"--incremental=param,debug", "--incremental=param,debug",
"--package=de.tudresden.inf.st.ttc18live.jastadd.model", "--package=de.tudresden.inf.st.ttc18live.jastadd.model",
...@@ -85,4 +85,4 @@ jastadd.outputs.upToDateWhen {false} ...@@ -85,4 +85,4 @@ jastadd.outputs.upToDateWhen {false}
jar.enabled = false jar.enabled = false
distTar.enabled = false distTar.enabled = false
distZip.enabled=false // always disabled distZip.enabled=false // always disabled
packageSources.enabled = false packageSources.enabled=false // always disabled
No preview for this file type
...@@ -28,6 +28,12 @@ public abstract class AbstractLiveContestDriver { ...@@ -28,6 +28,12 @@ public abstract class AbstractLiveContestDriver {
private boolean traceEvents; private boolean traceEvents;
private Path pathOfEventFile; private Path pathOfEventFile;
AbstractLiveContestDriver() {
ChangeSet = System.getenv("ChangeSet");
ChangePath = System.getenv("ChangePath");
Query = System.getenv("Query").toUpperCase();
}
AbstractLiveContestDriver enableTracing(Path pathOfEventFile) { AbstractLiveContestDriver enableTracing(Path pathOfEventFile) {
this.pathOfEventFile = pathOfEventFile; this.pathOfEventFile = pathOfEventFile;
this.traceEvents = true; this.traceEvents = true;
...@@ -82,12 +88,9 @@ public abstract class AbstractLiveContestDriver { ...@@ -82,12 +88,9 @@ public abstract class AbstractLiveContestDriver {
private void Initialize() throws Exception { private void Initialize() throws Exception {
stopwatch = System.nanoTime(); stopwatch = System.nanoTime();
ChangePath = System.getenv("ChangePath");
RunIndex = System.getenv("RunIndex"); RunIndex = System.getenv("RunIndex");
Sequences = Integer.parseInt(System.getenv("Sequences")); Sequences = Integer.parseInt(System.getenv("Sequences"));
Tool = System.getenv("Tool"); Tool = System.getenv("Tool");
ChangeSet = System.getenv("ChangeSet");
Query = System.getenv("Query").toUpperCase();
InitializeSpecial(); InitializeSpecial();
......
...@@ -162,22 +162,22 @@ public class Main { ...@@ -162,22 +162,22 @@ public class Main {
modelChangeSet.getNumModelChange(), socialNetwork.isValid()); modelChangeSet.getNumModelChange(), socialNetwork.isValid());
// // flush to get ids correct after parsing // // flush to get ids correct after parsing
// socialNetwork.flushTreeCache(); socialNetwork.flushTreeCache();
if (splitApply) { if (splitApply) {
// copy code of modelChangeSet.apply // copy code of modelChangeSet.apply
for (ModelChange change : modelChangeSet.getModelChangeList()) { for (ModelChange change : modelChangeSet.getModelChangeList()) {
change.apply(); change.apply();
// flush to update for changes // flush to update for changes
// modelChangeSet.flushTreeCache(); modelChangeSet.flushTreeCache();
// socialNetwork.flushTreeCache(); socialNetwork.flushTreeCache();
// and validate // and validate
socialNetwork.isValid(); socialNetwork.isValid();
} }
} else { } else {
modelChangeSet.apply(); modelChangeSet.apply();
// flush to update for changes // flush to update for changes
// socialNetwork.flushTreeCache(); socialNetwork.flushTreeCache();
} }
logger.info("Validity after application of changes: {}", socialNetwork.isValid()); logger.info("Validity after application of changes: {}", socialNetwork.isValid());
......
...@@ -16,6 +16,11 @@ public abstract class Solution { ...@@ -16,6 +16,11 @@ public abstract class Solution {
socialNetwork = network; socialNetwork = network;
} }
void apply(ModelChangeSet changes) {
changes.apply();
socialNetwork.flushTreeCache();
}
public abstract String Initial(); public abstract String Initial();
public abstract String Update(ModelChangeSet changes); public abstract String Update(ModelChangeSet changes);
......
...@@ -13,7 +13,7 @@ public class SolutionQ1 extends Solution { ...@@ -13,7 +13,7 @@ public class SolutionQ1 extends Solution {
@Override @Override
public String Update(ModelChangeSet changes) { public String Update(ModelChangeSet changes) {
changes.apply(); apply(changes);
return this.getSocialNetwork().query1(); return this.getSocialNetwork().query1();
} }
......
...@@ -11,7 +11,7 @@ public class SolutionQ2 extends Solution { ...@@ -11,7 +11,7 @@ public class SolutionQ2 extends Solution {
@Override @Override
public String Update(ModelChangeSet changes) { public String Update(ModelChangeSet changes) {
changes.apply(); apply(changes);
return getSocialNetwork().query2(); return getSocialNetwork().query2();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment