-
Bug
-
Resolution: Fixed
-
P4
-
1.4.0
-
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).
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).
- relates to
-
JDK-4495188 static and policy permissions should not be checked separately
-
- Resolved
-