setLogOutputLevel(LogLevel.DEBUG);
}
+ /**
+ * Return whether to use additional safety code checks.
+ */
+ public static boolean useSafetyChecks() {
+ // Currently default to false unless openrocket.debug.safetycheck is defined
+ String s = System.getProperty("openrocket.debug.safetycheck");
+ if (s != null && !(s.equalsIgnoreCase("false") || s.equalsIgnoreCase("off"))) {
+ return true;
+ }
+ return false;
+ }
/**
* Retrieve the logger to be used in logging. By default this returns
* @author Sampo Niskanen <sampo.niskanen@iki.fi>
*/
public class Invalidator implements Invalidatable {
- private static final boolean USE_CHECKS = Prefs.useSafetyChecks();
+ private static final boolean USE_CHECKS = Application.useSafetyChecks();
private static final LogHelper log = Application.getLogger();
* @author Sampo Niskanen <sampo.niskanen@iki.fi>
*/
public abstract class SafetyMutex {
+ private static final boolean USE_CHECKS = Application.useSafetyChecks();
private static final LogHelper log = Application.getLogger();
* @return a new instance of a safety mutex
*/
public static SafetyMutex newInstance() {
- if (Prefs.useSafetyChecks()) {
+ if (USE_CHECKS) {
return new ConcreteSafetyMutex();
} else {
return new BogusSafetyMutex();