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

Implement a security permission to prevent exiting FX application with javafx.application.Platform.exit()

XMLWordPrintable

      A DESCRIPTION OF THE REQUEST :
      javafx.application.Platform.exit() exits FX application and JVM even if permission exitVM is not granted by SecurityManager.



      JUSTIFICATION :
      It is possible to prevent exiting JVM with SecurityManager with permission exitVM.
      However, this permission does not prevent exiting JVM with javafx.application.Platform.exit().

      This is inconsistent and unexpected behavior.

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Two options:

      1) If exitVM is not granted to a class, FX application should throw an exception when an instance of this class calls javafx.application.Platform.exit(). FX application should not terminate.

      2) Implement a new target for javafx.util.FXPermission to prevent exiting FX application by calling javafx.application.Platform.exit().
      ACTUAL -
      When an instance of a class from an external library calls javafx.application.Platform.exit(), FX application and JVM exit even if exitVM is not granted to this instance by SecurityManager.

            Unassigned Unassigned
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: