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

Reuse no-perms AccessControlContext object when performing isAuthorized check

XMLWordPrintable

      In AccessController.createWrapper():

                  ProtectionDomain nullPD = new ProtectionDomain(null, null);
                  return new AccessControlContext(new ProtectionDomain[] { nullPD });

      an extra ProtectionDomain object is created each time (if the isAuthorized check fails), which could cause some overhead. Instead nullPD should be declared as a static final and reused, and any extras will get removed when the ACC is optimized.

            mullan Sean Mullan
            mullan Sean Mullan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: