Skip to content

Commit ef9ff3e

Browse files
committed
:key.ui:run w/ -ea
1 parent 0922260 commit ef9ff3e

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

key.ui/build.gradle

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,9 @@ run {
7575
//systemProperties["KeyDebugFlag"] = "on"
7676
//args "--experimental"
7777

78+
// enable assertion
79+
jvmArgs += "-ea"
80+
7881
// this can be used to solve a problem where the OS hangs during debugging of popup menus
7982
// (see https://docs.oracle.com/javase/10/troubleshoot/awt.htm#JSTGD425)
8083
jvmArgs += "-Dsun.awt.disablegrab=true"

key.ui/src/main/java/de/uka/ilkd/key/core/Main.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,15 @@ public static void main(final String[] args) {
239239
public Integer call() throws Exception {
240240
Debug.ENABLE_DEBUG = debug;
241241

242+
try {
243+
// weigl: You can set assertion status via the system class loader,
244+
// but can not get its current status. Here a workaround.
245+
assert false;
246+
LOGGER.info("Assertion evaluation is disabled.");
247+
} catch (AssertionError e) {
248+
LOGGER.info("Assertion evaluation is enabled.");
249+
}
250+
242251
if (tacletDir != null) {
243252
System.setProperty(RuleSourceFactory.STD_TACLET_DIR_PROP_KEY,
244253
tacletDir.toAbsolutePath().toString());
@@ -301,11 +310,7 @@ public Integer call() throws Exception {
301310
LOGGER.info("Running in debug mode");
302311
}
303312

304-
if (Debug.ENABLE_ASSERTION) {
305-
LOGGER.info("Using assertions");
306-
} else {
307-
LOGGER.info("Not using assertions");
308-
}
313+
LOGGER.info("Debug.ENABLE_ASSERTION = {}", Debug.ENABLE_ASSERTION);
309314

310315
if (riflFileName != null) {
311316
LOGGER.info("Loading RIFL specification from {}", riflFileName);
@@ -351,11 +356,6 @@ public Integer call() throws Exception {
351356

352357
AbstractMediatorUserInterfaceControl ui = createUserInterface(inputFiles);
353358

354-
System.out.println(inputFiles.isEmpty());
355-
System.out.println(examplesFolder);
356-
System.out.println(ui);
357-
System.out.println(showExampleChooserIfExamplesDirIsDefined);
358-
359359
if (inputFiles.isEmpty()) {
360360
if (examplesFolder != null
361361
&& showExampleChooserIfExamplesDirIsDefined

0 commit comments

Comments
 (0)