change in PolicyFile.getPermissions(ProtectionDomain) behavior when passed null

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P4
    • 1.4.0
    • Affects Version/s: 1.4.0
    • Component/s: security-libs
    • None
    • beta3
    • generic
    • generic

      The recent fix for 4495188 ("static and policy permissions should not be
      checked separately") assumes that the ProtectionDomain passed to
      PolicyFile.getPermissions(ProtectionDomain) is non-null; if null is
      passed as the ProtectionDomain, a NullPointerException is thrown.
      Prior to build B80 (in which the fix for 4495188 was integrated),
      PolicyFile.getPermissions(ProtectionDomain) tolerated a null argument--the
      following code completes normally with B79, but fails with B80:

        import java.security.*;

        public class Foo {
            public static void main(String[] args) {
                System.out.println(
                    Policy.getPolicy().getPermissions((ProtectionDomain) null));
            }
        }

      Since the documentation for Policy.getPermissions(ProtectionDomain) does not
      currently specify what should occur if a value of null is passed in, it's
      unclear which behavior is correct. The javadoc for getPermissions() should be
      modified to specify this case, and the implementation of
      PolicyFile.getPermissions() updated accordingly (if necessary).

            Assignee:
            Ramachandran Marti (Inactive)
            Reporter:
            Michael Warres (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: