/[classpath]/classpath/java/security/Permissions.java
ViewVC logotype

Diff of /classpath/java/security/Permissions.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7.2.3 by gnu_andrew, Fri Feb 4 09:44:44 2005 UTC revision 1.7.2.4 by gnu_andrew, Sat Feb 19 10:50:39 2005 UTC
# Line 1  Line 1 
1  /* Permissions.java -- a collection of permission collections  /* Permissions.java -- a collection of permission collections
2     Copyright (C) 1998, 2001, 2002, 2004  Free Software Foundation, Inc.     Copyright (C) 1998, 2001, 2002, 2004, 2005  Free Software Foundation, Inc.
3    
4  This file is part of GNU Classpath.  This file is part of GNU Classpath.
5    
# Line 53  import java.util.NoSuchElementException; Line 53  import java.util.NoSuchElementException;
53   * collection type which stores its permissions in a hash table will be   * collection type which stores its permissions in a hash table will be
54   * used.   * used.
55   *   *
56   * @author Aaron M. Renn <arenn@urbanophile.com>   * @author Aaron M. Renn (arenn@urbanophile.com)
57   * @author Eric Blake <ebb9@email.byu.edu>   * @author Eric Blake (ebb9@email.byu.edu)
58   * @since 1.1   * @since 1.1
59   */   */
60  public final class Permissions extends PermissionCollection  public final class Permissions extends PermissionCollection
# Line 193  public final class Permissions extends P Line 193  public final class Permissions extends P
193     * Implements the permission collection for all permissions without one of     * Implements the permission collection for all permissions without one of
194     * their own, and obeys serialization of JDK.     * their own, and obeys serialization of JDK.
195     *     *
196     * @author Eric Blake <ebb9@email.byu.edu>     * @author Eric Blake (ebb9@email.byu.edu)
197     */     */
198    private static final class PermissionsHash extends PermissionCollection    private static final class PermissionsHash extends PermissionCollection
199    {    {
# Line 227  public final class Permissions extends P Line 227  public final class Permissions extends P
227       * @param perm the permission to check       * @param perm the permission to check
228       * @return true if it is implied       * @return true if it is implied
229       */       */
230        // FIXME: Should this method be synchronized?
231      public boolean implies(Permission perm)      public boolean implies(Permission perm)
232      {      {
233        return perms.get(perm) != null;        Enumeration elements = elements();
234          
235          while (elements.hasMoreElements())
236            {
237              Permission p = (Permission)elements.nextElement();
238              if (p.implies(perm))
239                return true;
240            }
241          return false;
242      }      }
243    
244      /**      /**

Legend:
Removed from v.1.7.2.3  
changed lines
  Added in v.1.7.2.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26