src/share/classes/java/security/BasicPermission.java
Print this page
*** 66,76 ****
* @author Marianne Mueller
* @author Roland Schemers
*/
public abstract class BasicPermission extends Permission
! implements java.io.Serializable
{
private static final long serialVersionUID = 6279438298436773498L;
// does this permission have a wildcard at the end?
--- 66,76 ----
* @author Marianne Mueller
* @author Roland Schemers
*/
public abstract class BasicPermission extends Permission
! implements java.io.Serializable
{
private static final long serialVersionUID = 6279438298436773498L;
// does this permission have a wildcard at the end?
*** 82,95 ****
// 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)
! {
if (name == null)
throw new NullPointerException("name can't be null");
int len = name.length();
--- 82,93 ----
// 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) {
if (name == null)
throw new NullPointerException("name can't be null");
int len = name.length();
*** 127,139 ****
* @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)
! {
super(name);
init(name);
}
--- 125,135 ----
* @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) {
super(name);
init(name);
}
*** 146,157 ****
* @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)
! {
super(name);
init(name);
}
/**
--- 142,152 ----
* @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) {
super(name);
init(name);
}
/**
*** 236,247 ****
* which currently is the empty string "", since there are no actions for
* a BasicPermission.
*
* @return the empty string "".
*/
! public String getActions()
! {
return "";
}
/**
* Returns a new PermissionCollection object for storing BasicPermission
--- 231,241 ----
* which currently is the empty string "", since there are no actions for
* a BasicPermission.
*
* @return the empty string "".
*/
! public String getActions() {
return "";
}
/**
* Returns a new PermissionCollection object for storing BasicPermission
*** 294,314 ****
* 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
{
private static final long serialVersionUID = 739301742472979399L;
/**
--- 288,307 ----
* 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
*
*
* @author Roland Schemers
*
* @serial include
*/
final class BasicPermissionCollection
! extends PermissionCollection
! implements java.io.Serializable
{
private static final long serialVersionUID = 739301742472979399L;
/**
*** 358,370 ****
* permissions in this collection.
*
* @exception SecurityException - if this BasicPermissionCollection object
* has been marked readonly
*/
!
! 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");
--- 351,361 ----
* permissions in this collection.
*
* @exception SecurityException - if this BasicPermissionCollection object
* has been marked readonly
*/
! 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,413 ****
/**
* Check and see if this set of permissions implies the permissions
* expressed in "permission".
*
! * @param p 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)
! {
if (! (permission instanceof BasicPermission))
return false;
BasicPermission bp = (BasicPermission) permission;
--- 387,402 ----
/**
* Check and see if this set of permissions implies the permissions
* expressed in "permission".
*
! * @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) {
if (! (permission instanceof BasicPermission))
return false;
BasicPermission bp = (BasicPermission) permission;
*** 466,476 ****
* 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());
}
--- 455,464 ----