...
In this example, the two-argument form is preferable because the openFile() method does not know whether the caller should be granted the read, write or both permissions. Prefer In the special case where all the callers are known (for example, when all are private methods of a private class), the single argument method AccessController.checkPermission(permission) method when the permissions of the caller are known beforehand offers improved simplicity and performance. The two argument form should be used for all cases where there may be unknown callers. The performActionOnFile() method need not be declared private provided permissions are restricted by accepting a context argument.
...