From 16bde2b60b7d2c415632e21e0bb734dabed5d58c Mon Sep 17 00:00:00 2001 From: Vincent Boulaye Date: Mon, 10 Jun 2024 20:53:14 +0200 Subject: [PATCH 1/2] ignore UnsupportedOperationException thrown by jdk>18 zhen trying to setup the SystemExitSecurityManager (fixes #1455) --- src/fitnesse/slim/instructions/SystemExitSecurityManager.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/fitnesse/slim/instructions/SystemExitSecurityManager.java b/src/fitnesse/slim/instructions/SystemExitSecurityManager.java index eeb1506d4..28ff96118 100644 --- a/src/fitnesse/slim/instructions/SystemExitSecurityManager.java +++ b/src/fitnesse/slim/instructions/SystemExitSecurityManager.java @@ -35,6 +35,10 @@ private static void tryUpdateSecurityManager(SecurityManager securityManager) { System.setSecurityManager(securityManager); } catch (SecurityException e) { System.err.println("Security manager could not be updated"); + } catch (UnsupportedOperationException e) { + System.err.println("Security manager could not be updated. If you are usin a JDK version >=18, you need to set " + + "-Djava.security.manager=allow to allow this. Or use -Dprevent.system.exit=false to disable this feature inside " + + "fitnesse. Exception was :" + e.getMessage()); } } From d845a987d5ae035ba04a9ca8489b60988e08e042 Mon Sep 17 00:00:00 2001 From: Vincent Boulaye Date: Sun, 16 Jun 2024 14:49:08 +0200 Subject: [PATCH 2/2] fix message and typos --- .../slim/instructions/SystemExitSecurityManager.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fitnesse/slim/instructions/SystemExitSecurityManager.java b/src/fitnesse/slim/instructions/SystemExitSecurityManager.java index 28ff96118..94871ee10 100644 --- a/src/fitnesse/slim/instructions/SystemExitSecurityManager.java +++ b/src/fitnesse/slim/instructions/SystemExitSecurityManager.java @@ -36,9 +36,9 @@ private static void tryUpdateSecurityManager(SecurityManager securityManager) { } catch (SecurityException e) { System.err.println("Security manager could not be updated"); } catch (UnsupportedOperationException e) { - System.err.println("Security manager could not be updated. If you are usin a JDK version >=18, you need to set " + - "-Djava.security.manager=allow to allow this. Or use -Dprevent.system.exit=false to disable this feature inside " + - "fitnesse. Exception was :" + e.getMessage()); + System.err.println("Security manager could not be updated. If you are using a JDK version >=18, you need to set " + + "-Djava.security.manager=allow to allow this. Or use -Dprevent.system.exit=false to disable the FitNesse feature" + + " blocking System.exit() calls and prevent this message."); } }