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

Defer instantiation of Permission objects unless SecurityManager is used

XMLWordPrintable

    • generic
    • generic

      Permission check is only needed when there is a security manager.
      We can delay instantiating the Permission object for performing permission check until there is a security manager.

      The following are few examples.

      src/share/classes/java/util/logging/LogManager.java
      src/share/classes/java/util/prefs/Preferences.java
      src/solaris/classes/sun/net/www/protocol/jar/JarFileFactory.java
      src/windows/classes/sun/net/www/protocol/jar/JarFileFactory.java
      When a ProtectionDomain is being created, the permission collection will be set up even though no permission check will need to be performed if no security manager is installed.

      Initializing the permission collection can be deferred until permission check is needed.

            mchung Mandy Chung (Inactive)
            mchung Mandy Chung (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: