Commit fc2e5895 authored by Daniel Le Berre's avatar Daniel Le Berre

Encapsulated silent field in AbstractLauncher.

parent 42d1e639
Pipeline #84 passed with stage
in 11 minutes and 28 seconds
......@@ -101,7 +101,7 @@ public abstract class AbstractLauncher implements Serializable, ILogAble {
protected IProblem problem;
public boolean silent = false;
private boolean silent = false;
protected boolean prime = System.getProperty("prime") != null;
......@@ -221,7 +221,7 @@ public abstract class AbstractLauncher implements Serializable, ILogAble {
String proofFile = problemname + ".rupproof";
this.solver.setSearchListener(
new RupSearchListener<ISolverService>(proofFile));
if (!this.silent) {
if (!this.isSilent()) {
System.out.println(this.solver.getLogPrefix()
+ "Generating unsat proof in file " + proofFile);
}
......@@ -244,7 +244,7 @@ public abstract class AbstractLauncher implements Serializable, ILogAble {
usage();
return;
}
if (!this.silent) {
if (!this.isSilent()) {
this.solver.setVerbose(true);
}
configureLauncher();
......@@ -308,7 +308,7 @@ public abstract class AbstractLauncher implements Serializable, ILogAble {
* a textual information
*/
public void log(String message) {
if (this.silent)
if (this.isSilent())
return;
if (this.logBuffer != null) {
this.logBuffer.append(COMMENT_PREFIX).append(message).append('\n');
......@@ -436,4 +436,8 @@ public abstract class AbstractLauncher implements Serializable, ILogAble {
this.out.print(logBuffer.toString());
logBuffer = null;
}
public boolean isSilent() {
return silent;
}
}
......@@ -90,7 +90,7 @@ public class CSPLauncher extends AbstractLauncher {
@Override
protected IProblem readProblem(String problemname)
throws ParseFormatException, IOException, ContradictionException {
this.silent = true;
this.setSilent(true);
IProblem problem = super.readProblem(problemname);
if(this.shouldOnlyDisplayEncoding) {
displayEncoding();
......
......@@ -397,7 +397,7 @@ public class Lanceur extends AbstractLauncher implements ILogAble {
usage();
return;
}
if (!this.silent) {
if (!this.isSilent()) {
this.solver.setVerbose(true);
}
String instanceName = getInstanceName(args);
......
......@@ -312,7 +312,7 @@ public class Launcher extends AbstractLauncher implements ILogAble {
usage();
System.exit(0);
}
if (!this.silent) {
if (!this.isSilent()) {
this.solver.setVerbose(true);
}
String instanceName = getInstanceName(args);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment