Browse Source

imported patch PrismLog-ignoreClose.patch

tud-infrastructure-2018-10-12
Joachim Klein 7 years ago
parent
commit
af017cde19
  1. 5
      prism/src/prism/PrismFileLog.java
  2. 21
      prism/src/prism/PrismLog.java

5
prism/src/prism/PrismFileLog.java

@ -146,8 +146,9 @@ public class PrismFileLog extends PrismLog
return;
}
if (stdout) {
// we never close stdout
if (stdout || ignoreClose) {
// we never close stdout, and we ignore the call to close()
// if the ignoreClose flag is set
return;
}

21
prism/src/prism/PrismLog.java

@ -51,6 +51,11 @@ public abstract class PrismLog implements Closeable, AutoCloseable
*/
protected int numberOfWarnings = 0;
/**
* Flag: Ignore calls to close.
*/
protected boolean ignoreClose = false;
/**
* Sets the counter of warnings printed to 0.
*/
@ -86,6 +91,22 @@ public abstract class PrismLog implements Closeable, AutoCloseable
this.verbosityLevel = verbosityLevel;
}
/**
* Set the flag "ignore calls to close()" to the given value.
*/
public void setIgnoreClose(boolean value)
{
ignoreClose = value;
}
/**
* Set the flag for "ignore calls to close()".
*/
public boolean getIgnoreClose()
{
return ignoreClose;
}
public abstract boolean ready();
public abstract long getFilePointer();

Loading…
Cancel
Save