diff options
author | Dalibor Topic <robilad@kaffe.org> | 2005-02-20 21:18:30 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2005-02-20 21:18:30 +0000 |
commit | 7d651220a36ec97dfbff7e6bd23fe6147956f078 (patch) | |
tree | 60fdf53adbc4000a2ef51e30a5f32ac9d42b11bf /libjava/java/security/AllPermission.java | |
parent | 237eaf79a5cb53340d8451e3379d6c483ec4f1aa (diff) | |
download | gcc-7d651220a36ec97dfbff7e6bd23fe6147956f078.zip gcc-7d651220a36ec97dfbff7e6bd23fe6147956f078.tar.gz gcc-7d651220a36ec97dfbff7e6bd23fe6147956f078.tar.bz2 |
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
Diffstat (limited to 'libjava/java/security/AllPermission.java')
-rw-r--r-- | libjava/java/security/AllPermission.java | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/libjava/java/security/AllPermission.java b/libjava/java/security/AllPermission.java index 32d0b45..e7f3169 100644 --- a/libjava/java/security/AllPermission.java +++ b/libjava/java/security/AllPermission.java @@ -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(); } -} // 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 |