-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
1.2.1
-
sparc
-
solaris_2.6
Name: ksC84122 Date: 03/12/99
The javadoc does not specify behavior of
java.security.AccessControlContext.checkPermission(null).
checkPermission() tries to check if null permission is
implied by context which does not make sense.
It should throw NullPointerException.
A test example which demonstrates this problem.
===== test44.java ========
import java.security.*;
public class test44 {
public static void main (String argv[]) {
SecurityManager sec = new SecurityManager();
ProtectionDomain pd[] = new ProtectionDomain[1];
AccessControlContext acc = new AccessControlContext(pd);
try {
acc.checkPermission(null);
System.out.println("Failed: NullPointerException expected");
return;
} catch (NullPointerException npe) { //OKAY
}
System.out.println("Passed.");
return;
}
}
========= Sample run (JDK1.2.1) ==========
#>java test44
Failed: NullPointerException expected
======================================================================
- duplicates
-
JDK-4232768 java.security.AccessControlContext.checkPermission(null) incorrect
-
- Closed
-