-
Enhancement
-
Resolution: Won't Fix
-
P3
-
None
-
None
There are quite a few places in the JDK that call SecurityManager.checkPermission, catch the SecurityException, and then do something other than propagating the SecurityException, ex:
try {
sm.checkPermission(...);
return true;
} catch (SecurityException e) {}
return false;
}
For cases like this, to avoid the overhead of throwing and catching the exception, it would be better to have a different checkPermission method that returns a boolean, ex:
public boolean isGranted(Permission perm)
try {
sm.checkPermission(...);
return true;
} catch (SecurityException e) {}
return false;
}
For cases like this, to avoid the overhead of throwing and catching the exception, it would be better to have a different checkPermission method that returns a boolean, ex:
public boolean isGranted(Permission perm)