diff options
| author | Dalibor Topic <robilad@yahoo.com> | 2005-02-03 19:20:04 +0000 |
|---|---|---|
| committer | Dalibor Topic <robilad@yahoo.com> | 2005-02-03 19:20:04 +0000 |
| commit | 06f685dab27ccf70c817ce01a455bb9b0fc18a73 (patch) | |
| tree | 8c85b3022d2a3bdb8079049374c46be1acd07481 /java/security/AllPermission.java | |
| parent | 239c58d5b47a896ea85459f8ab13f4f2208e1086 (diff) | |
| download | classpath-06f685dab27ccf70c817ce01a455bb9b0fc18a73.tar.gz | |
Small inner classes cleanup
2005-02-03 Dalibor Topic <robilad@kaffe.org>
* libraries/javalib/gnu/regexp/RE.java,
libraries/javalib/java/io/ObjectInputStream.java,
libraries/javalib/java/io/ObjectStreamClass.java,
libraries/javalib/java/lang/SecurityManager.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,
libraries/javalib/java/util/AbstractList.java:
Made 'inner' classes real public static inner classes,
and made them final where possible, or removed them
where unused.
Diffstat (limited to 'java/security/AllPermission.java')
| -rw-r--r-- | java/security/AllPermission.java | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/java/security/AllPermission.java b/java/security/AllPermission.java index 32d0b45f5..efe052112 100644 --- a/java/security/AllPermission.java +++ b/java/security/AllPermission.java @@ -135,64 +135,64 @@ public final class AllPermission extends Permission { return new 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. + * Implements AllPermission.newPermissionCollection, and obeys serialization + * of JDK. * - * @return the elements in the collection + * @author Eric Blake <ebb9@email.byu.edu> */ - public Enumeration elements() + private static final class AllPermissionCollection extends PermissionCollection { - return all_allowed - ? Collections.enumeration(Collections.singleton(new AllPermission())) - : EmptyEnumeration.getInstance(); - } -} // class AllPermissionCollection + /** + * 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 |
