src/share/classes/java/security/BasicPermission.java
Print this page
@@ -66,11 +66,11 @@
* @author Marianne Mueller
* @author Roland Schemers
*/
public abstract class BasicPermission extends Permission
-implements java.io.Serializable
+ implements java.io.Serializable
{
private static final long serialVersionUID = 6279438298436773498L;
// does this permission have a wildcard at the end?
@@ -82,14 +82,12 @@
// is this permission the old-style exitVM permission (pre JDK 1.6)?
private transient boolean exitVM;
/**
* initialize a BasicPermission object. Common to all constructors.
- *
*/
- private void init(String name)
- {
+ private void init(String name) {
if (name == null)
throw new NullPointerException("name can't be null");
int len = name.length();
@@ -127,13 +125,11 @@
* @param name the name of the BasicPermission.
*
* @throws NullPointerException if <code>name</code> is <code>null</code>.
* @throws IllegalArgumentException if <code>name</code> is empty.
*/
-
- public BasicPermission(String name)
- {
+ public BasicPermission(String name) {
super(name);
init(name);
}
@@ -146,12 +142,11 @@
* @param actions ignored.
*
* @throws NullPointerException if <code>name</code> is <code>null</code>.
* @throws IllegalArgumentException if <code>name</code> is empty.
*/
- public BasicPermission(String name, String actions)
- {
+ public BasicPermission(String name, String actions) {
super(name);
init(name);
}
/**
@@ -236,12 +231,11 @@
* which currently is the empty string "", since there are no actions for
* a BasicPermission.
*
* @return the empty string "".
*/
- public String getActions()
- {
+ public String getActions() {
return "";
}
/**
* Returns a new PermissionCollection object for storing BasicPermission
@@ -294,21 +288,20 @@
* A BasicPermissionCollection handles comparing a permission like "a.b.c.d.e"
* with a Permission such as "a.b.*", or "*".
*
* @see java.security.Permission
* @see java.security.Permissions
- * @see java.security.PermissionsImpl
*
*
* @author Roland Schemers
*
* @serial include
*/
final class BasicPermissionCollection
-extends PermissionCollection
-implements java.io.Serializable
+ extends PermissionCollection
+ implements java.io.Serializable
{
private static final long serialVersionUID = 739301742472979399L;
/**
@@ -358,13 +351,11 @@
* permissions in this collection.
*
* @exception SecurityException - if this BasicPermissionCollection object
* has been marked readonly
*/
-
- public void add(Permission permission)
- {
+ public void add(Permission permission) {
if (! (permission instanceof BasicPermission))
throw new IllegalArgumentException("invalid permission: "+
permission);
if (isReadOnly())
throw new SecurityException("attempt to add a Permission to a readonly PermissionCollection");
@@ -396,18 +387,16 @@
/**
* Check and see if this set of permissions implies the permissions
* expressed in "permission".
*
- * @param p the Permission object to compare
+ * @param permission the Permission object to compare
*
* @return true if "permission" is a proper subset of a permission in
* the set, false if not.
*/
-
- public boolean implies(Permission permission)
- {
+ public boolean implies(Permission permission) {
if (! (permission instanceof BasicPermission))
return false;
BasicPermission bp = (BasicPermission) permission;
@@ -466,11 +455,10 @@
* Returns an enumeration of all the BasicPermission objects in the
* container.
*
* @return an enumeration of all the BasicPermission objects.
*/
-
public Enumeration<Permission> elements() {
// Convert Iterator of Map values into an Enumeration
synchronized (this) {
return Collections.enumeration(perms.values());
}