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