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
|
@ -188,67 +188,67 @@ public final class Permissions extends PermissionCollection
|
|||
}
|
||||
};
|
||||
}
|
||||
} // class Permissions
|
||||
|
||||
/**
|
||||
* Implements the permission collection for all permissions without one of
|
||||
* their own, and obeys serialization of JDK.
|
||||
*
|
||||
* @author Eric Blake <ebb9@email.byu.edu>
|
||||
*/
|
||||
class PermissionsHash extends PermissionCollection
|
||||
{
|
||||
/**
|
||||
* Compatible with JDK 1.1+.
|
||||
*/
|
||||
private static final long serialVersionUID = -8491988220802933440L;
|
||||
|
||||
/**
|
||||
* Hashtable where we store permissions.
|
||||
*
|
||||
* @serial the stored permissions, both as key and value
|
||||
*/
|
||||
private final Hashtable perms = new Hashtable();
|
||||
|
||||
/**
|
||||
* Add a permission. We don't need to check for read-only, as this
|
||||
* collection is never exposed outside of Permissions, which has already
|
||||
* done that check.
|
||||
*
|
||||
* @param perm the permission to add
|
||||
*/
|
||||
public void add(Permission perm)
|
||||
{
|
||||
perms.put(perm, perm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if perm is in the collection.
|
||||
*
|
||||
* @param perm the permission to check
|
||||
* @return true if it is implied
|
||||
*/
|
||||
// FIXME: Should this method be synchronized?
|
||||
public boolean implies(Permission perm)
|
||||
{
|
||||
Enumeration elements = elements();
|
||||
|
||||
while (elements.hasMoreElements())
|
||||
{
|
||||
Permission p = (Permission)elements.nextElement();
|
||||
if (p.implies(perm))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the elements.
|
||||
*
|
||||
* @return the elements
|
||||
*/
|
||||
public Enumeration elements()
|
||||
{
|
||||
return perms.elements();
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements the permission collection for all permissions without one of
|
||||
* their own, and obeys serialization of JDK.
|
||||
*
|
||||
* @author Eric Blake (ebb9@email.byu.edu)
|
||||
*/
|
||||
private static final class PermissionsHash extends PermissionCollection
|
||||
{
|
||||
/**
|
||||
* Compatible with JDK 1.1+.
|
||||
*/
|
||||
private static final long serialVersionUID = -8491988220802933440L;
|
||||
|
||||
/**
|
||||
* Hashtable where we store permissions.
|
||||
*
|
||||
* @serial the stored permissions, both as key and value
|
||||
*/
|
||||
private final Hashtable perms = new Hashtable();
|
||||
|
||||
/**
|
||||
* Add a permission. We don't need to check for read-only, as this
|
||||
* collection is never exposed outside of Permissions, which has already
|
||||
* done that check.
|
||||
*
|
||||
* @param perm the permission to add
|
||||
*/
|
||||
public void add(Permission perm)
|
||||
{
|
||||
perms.put(perm, perm);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if perm is in the collection.
|
||||
*
|
||||
* @param perm the permission to check
|
||||
* @return true if it is implied
|
||||
*/
|
||||
// FIXME: Should this method be synchronized?
|
||||
public boolean implies(Permission perm)
|
||||
{
|
||||
Enumeration elements = elements();
|
||||
|
||||
while (elements.hasMoreElements())
|
||||
{
|
||||
Permission p = (Permission)elements.nextElement();
|
||||
if (p.implies(perm))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the elements.
|
||||
*
|
||||
* @return the elements
|
||||
*/
|
||||
public Enumeration elements()
|
||||
{
|
||||
return perms.elements();
|
||||
}
|
||||
} // class PermissionsHash
|
||||
} // class Permissions
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue