Commit 41bd2b1c by Tom Tromey Committed by Tom Tromey

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
parent 4f96ff63
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>
* Makefile.in: Rebuilt.
......
......@@ -65,6 +65,7 @@ public final class AccessController
* allow the given permission.
*/
public static void checkPermission(Permission perm)
throws AccessControlException
{
getContext().checkPermission(perm);
}
......
/* 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.
......@@ -35,7 +35,7 @@ package java.security;
*
* @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
......
/* 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.
......@@ -59,7 +59,7 @@ public abstract class Permission implements Guard, Serializable
/**
* 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
......@@ -75,7 +75,7 @@ public abstract class Permission implements Guard, Serializable
*
* @return The name of this <code>Permission</code>
*/
public String getName()
public final String getName()
{
return (name);
}
......@@ -107,6 +107,11 @@ public abstract class Permission implements Guard, Serializable
}
/**
* 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
* specified <code>Permission</code> is also granted.
*
......
/* 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.
......@@ -60,10 +60,11 @@ import java.util.Enumeration;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public abstract class PermissionCollection extends Object implements
Serializable
public abstract class PermissionCollection
extends Object
implements Serializable
{
public static final String linesep = null;
private static final String linesep = null;
static
{
......
/* 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.
......@@ -45,7 +45,9 @@ import java.util.NoSuchElementException;
*
* @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>.
......
......@@ -52,6 +52,11 @@ public final class Security extends Object
loadProviders();
}
// This class can't be instantiated.
private Security ()
{
}
private static void loadProviders()
{
String separator = System.getProperty("file.separator");
......
/* 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.
......@@ -27,6 +27,8 @@ executable file might be covered by the GNU General Public License. */
package java.security;
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
......@@ -44,7 +46,9 @@ import java.io.Serializable;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
public class UnresolvedPermission extends Permission implements Serializable
public final class UnresolvedPermission
extends Permission
implements Serializable
{
/**
......
/* 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.
......@@ -39,7 +39,7 @@ import java.util.Enumeration;
*
* @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.
......@@ -67,7 +67,7 @@ public interface Group
*
* @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
......
/* 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.
......@@ -62,7 +62,7 @@ public class PKCS8EncodedKeySpec extends EncodedKeySpec
@return a string representing the name
*/
public String getFormat()
public final String getFormat()
{
return "PKCS#8";
}
......
/* 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.
......@@ -63,7 +63,7 @@ public class X509EncodedKeySpec extends EncodedKeySpec
@return a string representing the name
*/
public String getFormat()
public final String getFormat()
{
return "X.509";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment