-
Enhancement
-
Resolution: Fixed
-
P5
-
1.3.0
-
beta
-
generic
-
generic
Name: skT45625 Date: 07/06/2000
java version "1.3.0"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.0-C)
Java HotSpot(TM) Client VM (build 1.3.0-C, mixed mode)
In the method resolve() of class java.security.UnresolvedPermission the code
assumes the actual permission being created contains a constructor with 2
paramters eg MyPermission(String name, String action). If the constructor does
not exist,a NOSuchMethodException will be thrown, however this exception will be
caught in the following catch block and is "swallowed by the code"
try {
Class pc = p.getClass();
Constructor c = pc.getConstructor(PARAMS);
return (Permission) c.newInstance(new Object[] { name, actions });
} catch (Exception e) {
return null;
}
I realise the semantics of UnresolvedPermission is to simply invalidate the
permission if it cannot be resolved which is why the catch block exists, however
not knowing why the code fails is a problem (and VERY frustrating). Perhaps the
exception could be logged via sun.security.util.Debug
Also nowhere in any of the permission documentation (At least that I have seen)
does it state that a permission should have a constructor that takes 2 parameter
s public MyPermission (String name, String action){...}
(Review ID: 106902)
======================================================================
- duplicates
-
JDK-4426146 Two-parameter constructor of java.security.BasicPermission
-
- Closed
-