Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8163309

SecurityException from Applet calling Thread.setPriority(int)

    XMLWordPrintable

    Details

    • Introduced In Build:
      b120

      Description

      As of JDK 9 b120 the "Animator" demo applet throws an exception as follows :-
      jdk9b120/bin/appletviewer example1.html
      java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "modifyThread")
      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 sun.applet.AppletSecurity.checkAccess(java.desktop@9-ea/AppletSecurity.java:231)
      at java.lang.Thread.checkAccess(java.base@9-ea/Thread.java:1488)
      at java.lang.Thread.setPriority(java.base@9-ea/Thread.java:1185)
      at Animator.init(Animator.java:299)
      at sun.applet.AppletPanel.run(java.desktop@9-ea/AppletPanel.java:423)
      at java.lang.Thread.run(java.base@9-ea/Thread.java:843)
      ---

      I am not sure of why, since I can't pinpoint what changed, but
      can see that in AppletSecurity.java the call to
      "currentAppletClassLoader()" returns null now .. which is
      then interpreted as meaning the Thread (which is the applet's
      own main thread), is not in its thread group ... and that
      seems wrong .. and presumably inconsistent with all history
      since 1995 since the applet has always made this call.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              dtitov Daniil Titov (Inactive)
              Reporter:
              prr Philip Race
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: