AccessController.java (checkPermission): Now throws AccessControlException.

* java/security/AccessController.java (checkPermission): Now
	throws AccessControlException.
	* java/security/AllPermission.java: Class now final.
	* java/security/Permission.java (getName): Now final.
	(name): Now private.
	(equals): New abstract method.
	* java/security/PermissionCollection.java (linesep): Now private.
	* java/security/Permissions.java: Class now final.
	* java/security/Security.java (Security): New private
	constructor.
	* java/security/UnresolvedPermission.java: Import
	java.security.cert.Certificate.  Class now final.
	* java/security/acl/Group.java: Now extends Principal.
	(isMember): Added Principal argument.
	* java/security/spec/X509EncodedKeySpec.java (getFormat): Now
	final.
	* java/security/spec/PKCS8EncodedKeySpec.java (getFormat): Now
	final.

From-SVN: r46246
This commit is contained in:
Tom Tromey 2001-10-13 23:21:07 +00:00 committed by Tom Tromey
parent 4f96ff63b3
commit 41bd2b1cc2
11 changed files with 59 additions and 20 deletions

View file

@ -1,3 +1,24 @@
2001-10-13 Tom Tromey <tromey@redhat.com>
* java/security/AccessController.java (checkPermission): Now
throws AccessControlException.
* java/security/AllPermission.java: Class now final.
* java/security/Permission.java (getName): Now final.
(name): Now private.
(equals): New abstract method.
* java/security/PermissionCollection.java (linesep): Now private.
* java/security/Permissions.java: Class now final.
* java/security/Security.java (Security): New private
constructor.
* java/security/UnresolvedPermission.java: Import
java.security.cert.Certificate. Class now final.
* java/security/acl/Group.java: Now extends Principal.
(isMember): Added Principal argument.
* java/security/spec/X509EncodedKeySpec.java (getFormat): Now
final.
* java/security/spec/PKCS8EncodedKeySpec.java (getFormat): Now
final.
2001-10-12 Tom Tromey <tromey@redhat.com> 2001-10-12 Tom Tromey <tromey@redhat.com>
* Makefile.in: Rebuilt. * Makefile.in: Rebuilt.

View file

@ -65,6 +65,7 @@ public final class AccessController
* allow the given permission. * allow the given permission.
*/ */
public static void checkPermission(Permission perm) public static void checkPermission(Permission perm)
throws AccessControlException
{ {
getContext().checkPermission(perm); getContext().checkPermission(perm);
} }

View file

@ -1,5 +1,5 @@
/* AllPermission.java -- Permission to do anything /* AllPermission.java -- Permission to do anything
Copyright (C) 1998 Free Software Foundation, Inc. Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
@ -35,7 +35,7 @@ package java.security;
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
*/ */
public class AllPermission extends Permission public final class AllPermission extends Permission
{ {
/** /**
* This method initializes a new instance of <code>AllPermission</code>. It * This method initializes a new instance of <code>AllPermission</code>. It

View file

@ -1,5 +1,5 @@
/* Permission.java -- The superclass for all permission objects /* Permission.java -- The superclass for all permission objects
Copyright (C) 1998 Free Software Foundation, Inc. Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
@ -59,7 +59,7 @@ public abstract class Permission implements Guard, Serializable
/** /**
* This is the name assigned to this permission object. * This is the name assigned to this permission object.
*/ */
protected String name; // Taken from the serializable form information private String name; // Taken from the serializable form information
/** /**
* This method initializes a new instance of <code>Permission</code> to * This method initializes a new instance of <code>Permission</code> to
@ -75,7 +75,7 @@ public abstract class Permission implements Guard, Serializable
* *
* @return The name of this <code>Permission</code> * @return The name of this <code>Permission</code>
*/ */
public String getName() public final String getName()
{ {
return (name); return (name);
} }
@ -106,6 +106,11 @@ public abstract class Permission implements Guard, Serializable
sm.checkPermission(this); sm.checkPermission(this);
} }
/**
* Check to see if this object equals OBJ.
*/
public abstract boolean equals (Object obj);
/** /**
* This method tests whether this <code>Permission</code> implies that the * This method tests whether this <code>Permission</code> implies that the
* specified <code>Permission</code> is also granted. * specified <code>Permission</code> is also granted.

View file

@ -1,5 +1,5 @@
/* PermissionCollection.java -- A collection of permission objects /* PermissionCollection.java -- A collection of permission objects
Copyright (C) 1998 Free Software Foundation, Inc. Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
@ -60,10 +60,11 @@ import java.util.Enumeration;
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
*/ */
public abstract class PermissionCollection extends Object implements public abstract class PermissionCollection
Serializable extends Object
implements Serializable
{ {
public static final String linesep = null; private static final String linesep = null;
static static
{ {

View file

@ -1,5 +1,5 @@
/* Permissions.java -- A collection of permission collections /* Permissions.java -- A collection of permission collections
Copyright (C) 1998 Free Software Foundation, Inc. Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
@ -45,7 +45,9 @@ import java.util.NoSuchElementException;
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
*/ */
public class Permissions extends PermissionCollection implements Serializable public final class Permissions
extends PermissionCollection
implements Serializable
{ {
/** /**
* Holds instances of <code>AllPermission</code>. * Holds instances of <code>AllPermission</code>.

View file

@ -52,6 +52,11 @@ public final class Security extends Object
loadProviders(); loadProviders();
} }
// This class can't be instantiated.
private Security ()
{
}
private static void loadProviders() private static void loadProviders()
{ {
String separator = System.getProperty("file.separator"); String separator = System.getProperty("file.separator");

View file

@ -1,5 +1,5 @@
/* UnresolvedPermission.java -- Placeholder for unresolved permissions. /* UnresolvedPermission.java -- Placeholder for unresolved permissions.
Copyright (C) 1998 Free Software Foundation, Inc. Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
@ -27,6 +27,8 @@ executable file might be covered by the GNU General Public License. */
package java.security; package java.security;
import java.io.Serializable; import java.io.Serializable;
// All uses of Certificate in this file refer to this class.
import java.security.cert.Certificate;
/** /**
* This class is used to hold instances of all permissions that cannot * This class is used to hold instances of all permissions that cannot
@ -44,7 +46,9 @@ import java.io.Serializable;
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
*/ */
public class UnresolvedPermission extends Permission implements Serializable public final class UnresolvedPermission
extends Permission
implements Serializable
{ {
/** /**

View file

@ -1,5 +1,5 @@
/* Group.java -- Represents a group of Principals /* Group.java -- Represents a group of Principals
Copyright (C) 1998 Free Software Foundation, Inc. Copyright (C) 1998, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
@ -39,7 +39,7 @@ import java.util.Enumeration;
* *
* @author Aaron M. Renn (arenn@urbanophile.com) * @author Aaron M. Renn (arenn@urbanophile.com)
*/ */
public interface Group public interface Group extends Principal
{ {
/** /**
* This method adds a new <code>Principal</code> to this group. * This method adds a new <code>Principal</code> to this group.
@ -67,7 +67,7 @@ public interface Group
* *
* @return <code>true</code> if the user is member, <code>false</code> otherwise * @return <code>true</code> if the user is member, <code>false</code> otherwise
*/ */
public abstract boolean isMember(); public abstract boolean isMember(Principal member);
/** /**
* This method returns a list of all members of the group as an * This method returns a list of all members of the group as an

View file

@ -1,5 +1,5 @@
/* PKCS8EncodedKeySpec.java --- PKCS8 Encoded Key Specificaton class /* PKCS8EncodedKeySpec.java --- PKCS8 Encoded Key Specificaton class
Copyright (C) 1999 Free Software Foundation, Inc. Copyright (C) 1999, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
@ -62,7 +62,7 @@ public class PKCS8EncodedKeySpec extends EncodedKeySpec
@return a string representing the name @return a string representing the name
*/ */
public String getFormat() public final String getFormat()
{ {
return "PKCS#8"; return "PKCS#8";
} }

View file

@ -1,5 +1,5 @@
/* X509EncodedKeySpec.java --- X.509 Encoded Key Specificaton class /* X509EncodedKeySpec.java --- X.509 Encoded Key Specificaton class
Copyright (C) 1999 Free Software Foundation, Inc. Copyright (C) 1999, 2001 Free Software Foundation, Inc.
This file is part of GNU Classpath. This file is part of GNU Classpath.
@ -63,7 +63,7 @@ public class X509EncodedKeySpec extends EncodedKeySpec
@return a string representing the name @return a string representing the name
*/ */
public String getFormat() public final String getFormat()
{ {
return "X.509"; return "X.509";
} }