-
Bug
-
Resolution: Fixed
-
P3
-
1.2.2
-
beta
-
sparc
-
solaris_2.6
-
Verified
Name: ksC84122 Date: 04/26/99
JDK 1.2.2 java.security.AccessController.checkPermission(null) throws
NullPointerException while
java.security.AccessControlContext.checkPermission(null)
does not throw NullPointerException.
This is an inconsistency.
java.security.AccessControlContext.checkPermission(null)
should also throw NullPointerException.
A test example which demonstrates this problem.
===== test43.java ========
import java.security.ProtectionDomain;
import java.security.AccessControlContext;
import java.security.AccessController;
public class test43 {
public static void main (String argv[]) {
SecurityManager sec = new SecurityManager();
ProtectionDomain pd[] = new ProtectionDomain[1];
try {
(new AccessControlContext(pd)).checkPermission(null);
System.out.println("CASE1: NullPointerException not thrown");
} catch (NullPointerException npe) {
System.out.println("CASE1: NullPointerException thrown");
}
try {
AccessController.checkPermission(null);
System.out.println("CASE2: NullPointerException not thrown");
return;
} catch (NullPointerException npe) { //OKAY
System.out.println("CASE2: NullPointerException thrown");
}
return;
}
}
========= Sample run (JDK1.2.2) ==========
#>java test43
CASE1: NullPointerException not thrown
CASE2: NullPointerException thrown
======================================================================
- duplicates
-
JDK-4219816 java.security.AccessControlContext.checkPermission(null) behavior not specified
-
- Closed
-