java13-SecurityManager.patch 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. From 276806d9984331c754fb636ab11f05e78b3fc8c7 Mon Sep 17 00:00:00 2001
  2. From: Martin Schelldorfer <schelldorfer@gmail.com>
  3. Date: Fri, 20 Sep 2019 14:51:29 +0200
  4. Subject: [PATCH] #437 Application cannot be started with JDK 13 -
  5. AWTSecurityManager was removed
  6. ---
  7. .../jnlp/runtime/JNLPSecurityManager.java | 30 +------------------
  8. 1 file changed, 1 insertion(+), 29 deletions(-)
  9. diff --git a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
  10. index 367b2b25..be418103 100644
  11. --- a/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
  12. +++ b/netx/net/sourceforge/jnlp/runtime/JNLPSecurityManager.java
  13. @@ -29,7 +29,6 @@
  14. import net.sourceforge.jnlp.util.logging.OutputController;
  15. import net.sourceforge.jnlp.util.WeakList;
  16. import net.sourceforge.swing.SwingUtils;
  17. -import sun.awt.AWTSecurityManager;
  18. import sun.awt.AppContext;
  19. /**
  20. @@ -47,7 +46,7 @@
  21. * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
  22. * @version $Revision: 1.17 $
  23. */
  24. -class JNLPSecurityManager extends AWTSecurityManager {
  25. +class JNLPSecurityManager extends SecurityManager {
  26. // todo: some apps like JDiskReport can close the VM even when
  27. // an exit class is set - fix!
  28. @@ -424,33 +423,6 @@
  29. }
  30. /**
  31. - * This returns the appropriate {@link AppContext}. Hooks in AppContext
  32. - * check if the current {@link SecurityManager} is an instance of
  33. - * AWTSecurityManager and if so, call this method to give it a chance to
  34. - * return the appropriate appContext based on the application that is
  35. - * running.
  36. - * <p>
  37. - * This can be called from any thread (possibly a swing thread) to find out
  38. - * the AppContext for the thread (which may correspond to a particular
  39. - * applet).
  40. - * </p>
  41. - */
  42. - @Override
  43. - public AppContext getAppContext() {
  44. - ApplicationInstance app = getApplication();
  45. - if (app == null) {
  46. - /*
  47. - * if we cannot find an application based on the code on the stack,
  48. - * then assume it is the main application
  49. - */
  50. - return mainAppContext;
  51. - } else {
  52. - return app.getAppContext();
  53. - }
  54. -
  55. - }
  56. -
  57. - /**
  58. * Tests if a client can get access to the AWT event queue. This version allows
  59. * complete access to the EventQueue for its own AppContext-specific EventQueue.
  60. *