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

Eliminate dependency to GetPropertyAction and other sun.security.action convenient classes

XMLWordPrintable

    • b06

      sun.security.action has a few convenient class that JDK classes use and the callsite looks like this:

         AccessController.doPrivileged(new GetPropertyAction(propertyName));

      This leads to many jdk modules depending on these module-private API in the base module.

      With lambda, these usages can be replaced with:

         AccessController.doPrivileged(
             (PrivilegedAction<String>) () -> System.getProperty(propertyName));

      The use of these convenient classes is not absolutely necessary and in fact the action is made more explicit in the callsite which has the benefit. I propose to eliminate the cross-module dependency to sun.security.action to reduce the number of the base module-private APIs being used by other jdk modules.

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

              Created:
              Updated:
              Resolved: