In my code I do:
System.setSecurityManager(createNoExitSecurityManager
());
On exit I get the following exception:
java.lang.NullPointerException
at
junit.extensions.jfcunit.JFCTestCase$JFCSecurityManage
r.checkExit(JFCTestCase.java:730)
at java.lang.Runtime.exit(Runtime.java:88)
at java.lang.System.exit(System.java:715)
The reason is that m_delegate in checkExit is null:
public void checkExit(final int status) {
725 1 if (m_assertExit) {
726 1 m_exited = true;
727 1 setContinue(false);
728 1 throw new ExitException
(status);
729 } else {
730 0 m_delegate.checkExit
(status);
731 }
732 }
The reason is that getSecurityManager() can return
null:
423 1 protected final SecurityManager
createNoExitSecurityManager() {
424 1 return new JFCSecurityManager
(System.getSecurityManager());
425 }
Workaround: Create and set an own securityManager.
Logged In: NO
The Workaround does not work!