RE.java, [...]: Made 'inner' classes real public static inner classes...
2005-02-20 Dalibor Topic <robilad@kaffe.org> * libraries/javalib/gnu/regexp/RE.java, libraries/javalib/java/io/ObjectInputStream.java, libraries/javalib/java/security/AllPermission.java, libraries/javalib/java/security/BasicPermission.java, libraries/javalib/java/security/Permissions.java, libraries/javalib/java/text/MessageFormat.java: Made 'inner' classes real public static inner classes, and made them final where possible, or removed them where unused. From-SVN: r95310
This commit is contained in:
parent
237eaf79a5
commit
7d651220a3
7 changed files with 371 additions and 358 deletions
|
@ -1,5 +1,5 @@
|
|||
/* AllPermission.java -- Permission to do anything
|
||||
Copyright (C) 1998, 2001, 2002, 2004 Free Software Foundation, Inc.
|
||||
Copyright (C) 1998, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
|
||||
|
||||
This file is part of GNU Classpath.
|
||||
|
||||
|
@ -135,64 +135,64 @@ public final class AllPermission extends Permission
|
|||
{
|
||||
return new AllPermissionCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements AllPermission.newPermissionCollection, and obeys serialization
|
||||
* of JDK.
|
||||
*
|
||||
* @author Eric Blake (ebb9@email.byu.edu)
|
||||
*/
|
||||
private static final class AllPermissionCollection extends PermissionCollection
|
||||
{
|
||||
/**
|
||||
* Compatible with JDK 1.1+.
|
||||
*/
|
||||
private static final long serialVersionUID = -4023755556366636806L;
|
||||
|
||||
/**
|
||||
* Whether an AllPermission has been added to the collection.
|
||||
*
|
||||
* @serial if all permission is in the collection yet
|
||||
*/
|
||||
private boolean all_allowed;
|
||||
|
||||
/**
|
||||
* Add an AllPermission.
|
||||
*
|
||||
* @param perm the permission to add
|
||||
* @throws IllegalArgumentException if perm is not an AllPermission
|
||||
* @throws SecurityException if the collection is read-only
|
||||
*/
|
||||
public void add(Permission perm)
|
||||
{
|
||||
if (isReadOnly())
|
||||
throw new SecurityException();
|
||||
if (! (perm instanceof AllPermission))
|
||||
throw new IllegalArgumentException();
|
||||
all_allowed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this collection implies a permission.
|
||||
*
|
||||
* @param perm the permission to check
|
||||
* @return true if this collection contains an AllPermission
|
||||
*/
|
||||
public boolean implies(Permission perm)
|
||||
{
|
||||
return all_allowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an enumeration of the elements in the collection.
|
||||
*
|
||||
* @return the elements in the collection
|
||||
*/
|
||||
public Enumeration elements()
|
||||
{
|
||||
return all_allowed
|
||||
? Collections.enumeration(Collections.singleton(new AllPermission()))
|
||||
: EmptyEnumeration.getInstance();
|
||||
}
|
||||
} // class AllPermissionCollection
|
||||
} // class AllPermission
|
||||
|
||||
/**
|
||||
* Implements AllPermission.newPermissionCollection, and obeys serialization
|
||||
* of JDK.
|
||||
*
|
||||
* @author Eric Blake <ebb9@email.byu.edu>
|
||||
*/
|
||||
final class AllPermissionCollection extends PermissionCollection
|
||||
{
|
||||
/**
|
||||
* Compatible with JDK 1.1+.
|
||||
*/
|
||||
private static final long serialVersionUID = -4023755556366636806L;
|
||||
|
||||
/**
|
||||
* Whether an AllPermission has been added to the collection.
|
||||
*
|
||||
* @serial if all permission is in the collection yet
|
||||
*/
|
||||
private boolean all_allowed;
|
||||
|
||||
/**
|
||||
* Add an AllPermission.
|
||||
*
|
||||
* @param perm the permission to add
|
||||
* @throws IllegalArgumentException if perm is not an AllPermission
|
||||
* @throws SecurityException if the collection is read-only
|
||||
*/
|
||||
public void add(Permission perm)
|
||||
{
|
||||
if (isReadOnly())
|
||||
throw new SecurityException();
|
||||
if (! (perm instanceof AllPermission))
|
||||
throw new IllegalArgumentException();
|
||||
all_allowed = true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if this collection implies a permission.
|
||||
*
|
||||
* @param perm the permission to check
|
||||
* @return true if this collection contains an AllPermission
|
||||
*/
|
||||
public boolean implies(Permission perm)
|
||||
{
|
||||
return all_allowed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an enumeration of the elements in the collection.
|
||||
*
|
||||
* @return the elements in the collection
|
||||
*/
|
||||
public Enumeration elements()
|
||||
{
|
||||
return all_allowed
|
||||
? Collections.enumeration(Collections.singleton(new AllPermission()))
|
||||
: EmptyEnumeration.getInstance();
|
||||
}
|
||||
} // class AllPermissionCollection
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue