Details
-
Bug
-
Resolution: Fixed
-
P2
-
9
Description
Description :-
enableSuddenTermination() - Not throws SecurityException if a security manager exists and it will not allow the caller to invoke System.exit
True with some other API's as well in Desktop API list like disableSuddenTermination(), setQuitHandler().
Exception Trace :-
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.lwawt.macosx.CDesktopPeer.enableSuddenTermination(java.desktop@9-ea/CDesktopPeer.java:124)
at java.awt.Desktop.enableSuddenTermination(java.desktop@9-ea/Desktop.java:913)
at DesktopTest.main(DesktopTest.java:10)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:533)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "canProcessApplicationEvents")
at java.security.AccessControlContext.checkPermission(java.base@9-ea/AccessControlContext.java:468)
at java.security.AccessController.checkPermission(java.base@9-ea/AccessController.java:894)
at java.lang.SecurityManager.checkPermission(java.base@9-ea/SecurityManager.java:541)
at com.apple.eawt.Application.checkSecurity(java.desktop@9-ea/Application.java:77)
at com.apple.eawt.Application.<clinit>(java.desktop@9-ea/Application.java:65)
enableSuddenTermination() - Not throws SecurityException if a security manager exists and it will not allow the caller to invoke System.exit
True with some other API's as well in Desktop API list like disableSuddenTermination(), setQuitHandler().
Exception Trace :-
Exception in thread "main" java.lang.ExceptionInInitializerError
at sun.lwawt.macosx.CDesktopPeer.enableSuddenTermination(java.desktop@9-ea/CDesktopPeer.java:124)
at java.awt.Desktop.enableSuddenTermination(java.desktop@9-ea/Desktop.java:913)
at DesktopTest.main(DesktopTest.java:10)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(java.base@9-ea/Native Method)
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(java.base@9-ea/NativeMethodAccessorImpl.java:62)
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(java.base@9-ea/DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(java.base@9-ea/Method.java:533)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "canProcessApplicationEvents")
at java.security.AccessControlContext.checkPermission(java.base@9-ea/AccessControlContext.java:468)
at java.security.AccessController.checkPermission(java.base@9-ea/AccessController.java:894)
at java.lang.SecurityManager.checkPermission(java.base@9-ea/SecurityManager.java:541)
at com.apple.eawt.Application.checkSecurity(java.desktop@9-ea/Application.java:77)
at com.apple.eawt.Application.<clinit>(java.desktop@9-ea/Application.java:65)