mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 14:54:52 +02:00
8284851: Update javax.crypto files to use proper javadoc for mentioned classes
Reviewed-by: weijun, valeriep
This commit is contained in:
parent
8cdead0c94
commit
f804f2ce8e
92 changed files with 2142 additions and 2010 deletions
|
@ -34,11 +34,11 @@ import java.util.Hashtable;
|
|||
import java.util.concurrent.ConcurrentHashMap;
|
||||
|
||||
/**
|
||||
* The BasicPermission class extends the Permission class, and
|
||||
* The {@code BasicPermission} class extends the {@code Permission} class, and
|
||||
* can be used as the base class for permissions that want to
|
||||
* follow the same naming convention as BasicPermission.
|
||||
* follow the same naming convention as {@code BasicPermission}.
|
||||
* <P>
|
||||
* The name for a BasicPermission is the name of the given permission
|
||||
* The name for a {@code BasicPermission} is the name of the given permission
|
||||
* (for example, "exit",
|
||||
* "setFactory", "print.queueJob", etc.). The naming
|
||||
* convention follows the hierarchical property naming convention.
|
||||
|
@ -47,12 +47,12 @@ import java.util.concurrent.ConcurrentHashMap;
|
|||
* For example, "*" and "java.*" signify a wildcard match, while "*java", "a*b",
|
||||
* and "java*" do not.
|
||||
* <P>
|
||||
* The action string (inherited from Permission) is unused.
|
||||
* Thus, BasicPermission is commonly used as the base class for
|
||||
* The action string (inherited from {@code Permission}) is unused.
|
||||
* Thus, {@code BasicPermission} is commonly used as the base class for
|
||||
* "named" permissions
|
||||
* (ones that contain a name but no actions list; you either have the
|
||||
* named permission or you don't.)
|
||||
* Subclasses may implement actions on top of BasicPermission,
|
||||
* Subclasses may implement actions on top of {@code BasicPermission},
|
||||
* if desired.
|
||||
*
|
||||
* @see java.security.Permission
|
||||
|
@ -82,7 +82,7 @@ public abstract class BasicPermission extends Permission
|
|||
private transient boolean exitVM;
|
||||
|
||||
/**
|
||||
* initialize a BasicPermission object. Common to all constructors.
|
||||
* initialize a {@code BasicPermission} object. Common to all constructors.
|
||||
*/
|
||||
private void init(String name) {
|
||||
if (name == null)
|
||||
|
@ -116,12 +116,12 @@ public abstract class BasicPermission extends Permission
|
|||
}
|
||||
|
||||
/**
|
||||
* Creates a new BasicPermission with the specified name.
|
||||
* Creates a new {@code BasicPermission} with the specified name.
|
||||
* Name is the symbolic name of the permission, such as
|
||||
* "setFactory",
|
||||
* "print.queueJob", or "topLevelWindow", etc.
|
||||
*
|
||||
* @param name the name of the BasicPermission.
|
||||
* @param name the name of the {@code BasicPermission}.
|
||||
*
|
||||
* @throws NullPointerException if {@code name} is {@code null}.
|
||||
* @throws IllegalArgumentException if {@code name} is empty.
|
||||
|
@ -133,11 +133,11 @@ public abstract class BasicPermission extends Permission
|
|||
|
||||
|
||||
/**
|
||||
* Creates a new BasicPermission object with the specified name.
|
||||
* The name is the symbolic name of the BasicPermission, and the
|
||||
* actions String is currently unused.
|
||||
* Creates a new {@code BasicPermission} object with the specified name.
|
||||
* The name is the symbolic name of the {@code BasicPermission}, and the
|
||||
* actions {@code String} is currently unused.
|
||||
*
|
||||
* @param name the name of the BasicPermission.
|
||||
* @param name the name of the {@code BasicPermission}.
|
||||
* @param actions ignored.
|
||||
*
|
||||
* @throws NullPointerException if {@code name} is {@code null}.
|
||||
|
@ -152,7 +152,7 @@ public abstract class BasicPermission extends Permission
|
|||
* Checks if the specified permission is "implied" by
|
||||
* this object.
|
||||
* <P>
|
||||
* More specifically, this method returns true if:
|
||||
* More specifically, this method returns {@code true} if:
|
||||
* <ul>
|
||||
* <li> {@code p}'s class is the same as this object's class, and
|
||||
* <li> {@code p}'s name equals or (in the case of wildcards)
|
||||
|
@ -162,8 +162,8 @@ public abstract class BasicPermission extends Permission
|
|||
*
|
||||
* @param p the permission to check against.
|
||||
*
|
||||
* @return true if the passed permission is equal to or
|
||||
* implied by this permission, false otherwise.
|
||||
* @return {@code true} if the passed permission is equal to or
|
||||
* implied by this permission, {@code false} otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean implies(Permission p) {
|
||||
|
@ -193,13 +193,14 @@ public abstract class BasicPermission extends Permission
|
|||
}
|
||||
|
||||
/**
|
||||
* Checks two BasicPermission objects for equality.
|
||||
* Checks two {@code BasicPermission} objects for equality.
|
||||
* Checks that {@code obj}'s class is the same as this object's class
|
||||
* and has the same name as this object.
|
||||
*
|
||||
* @param obj the object we are testing for equality with this object.
|
||||
* @return true if {@code obj}'s class is the same as this object's class
|
||||
* and has the same name as this BasicPermission object, false otherwise.
|
||||
* @return {@code true} if {@code obj}'s class is the same as this
|
||||
* object's class and has the same name as this {@code BasicPermission}
|
||||
* object, {@code false} otherwise.
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
|
@ -219,7 +220,7 @@ public abstract class BasicPermission extends Permission
|
|||
* Returns the hash code value for this object.
|
||||
* The hash code used is the hash code of the name, that is,
|
||||
* {@code getName().hashCode()}, where {@code getName} is
|
||||
* from the Permission superclass.
|
||||
* from the {@code Permission} superclass.
|
||||
*
|
||||
* @return a hash code value for this object.
|
||||
*/
|
||||
|
@ -231,7 +232,7 @@ public abstract class BasicPermission extends Permission
|
|||
/**
|
||||
* Returns the canonical string representation of the actions,
|
||||
* which currently is the empty string "", since there are no actions for
|
||||
* a BasicPermission.
|
||||
* a {@code BasicPermission}.
|
||||
*
|
||||
* @return the empty string "".
|
||||
*/
|
||||
|
@ -241,16 +242,16 @@ public abstract class BasicPermission extends Permission
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns a new PermissionCollection object for storing BasicPermission
|
||||
* objects.
|
||||
* Returns a new {@code PermissionCollection} object for storing
|
||||
* {@code BasicPermission} objects.
|
||||
*
|
||||
* <p>BasicPermission objects must be stored in a manner that allows them
|
||||
* to be inserted in any order, but that also enables the
|
||||
* PermissionCollection {@code implies} method
|
||||
* <p>{@code BasicPermission} objects must be stored in a manner
|
||||
* that allows them to be inserted in any order, but that also enables the
|
||||
* {@link PermissionCollection#implies} method
|
||||
* to be implemented in an efficient (and consistent) manner.
|
||||
*
|
||||
* @return a new PermissionCollection object suitable for
|
||||
* storing BasicPermissions.
|
||||
* @return a new {@code PermissionCollection} object suitable for
|
||||
* storing {@code BasicPermission} objects.
|
||||
*/
|
||||
@Override
|
||||
public PermissionCollection newPermissionCollection() {
|
||||
|
@ -258,8 +259,8 @@ public abstract class BasicPermission extends Permission
|
|||
}
|
||||
|
||||
/**
|
||||
* readObject is called to restore the state of the BasicPermission from
|
||||
* a stream.
|
||||
* {@code readObject} is called to restore the state of the
|
||||
* (@code BasicPermission} from a stream.
|
||||
*
|
||||
* @param s the {@code ObjectInputStream} from which data is read
|
||||
* @throws IOException if an I/O error occurs
|
||||
|
@ -275,12 +276,12 @@ public abstract class BasicPermission extends Permission
|
|||
}
|
||||
|
||||
/**
|
||||
* Returns the canonical name of this BasicPermission.
|
||||
* Returns the canonical name of this {@code BasicPermission}.
|
||||
* All internal invocations of getName should invoke this method, so
|
||||
* that the pre-JDK 1.6 "exitVM" and current "exitVM.*" permission are
|
||||
* equivalent in equals/hashCode methods.
|
||||
*
|
||||
* @return the canonical name of this BasicPermission.
|
||||
* @return the canonical name of this {@code BasicPermission}.
|
||||
*/
|
||||
final String getCanonicalName() {
|
||||
return exitVM ? "exitVM.*" : getName();
|
||||
|
@ -288,14 +289,14 @@ public abstract class BasicPermission extends Permission
|
|||
}
|
||||
|
||||
/**
|
||||
* A BasicPermissionCollection stores a collection
|
||||
* of BasicPermission permissions. BasicPermission objects
|
||||
* A {@code BasicPermissionCollection} stores a collection
|
||||
* of {@code BasicPermission} permissions. {@code BasicPermission} objects
|
||||
* must be stored in a manner that allows them to be inserted in any
|
||||
* order, but enable the implies function to evaluate the implies
|
||||
* method in an efficient (and consistent) manner.
|
||||
*
|
||||
* A BasicPermissionCollection handles comparing a permission like "a.b.c.d.e"
|
||||
* with a Permission such as "a.b.*", or "*".
|
||||
* A {@code BasicPermissionCollection} handles comparing a permission
|
||||
* like "a.b.c.d.e" with a {@code Permission} such as "a.b.*", or "*".
|
||||
*
|
||||
* @see java.security.Permission
|
||||
* @see java.security.Permissions
|
||||
|
@ -322,15 +323,15 @@ final class BasicPermissionCollection
|
|||
private transient ConcurrentHashMap<String, Permission> perms;
|
||||
|
||||
/**
|
||||
* This is set to {@code true} if this BasicPermissionCollection
|
||||
* contains a BasicPermission with '*' as its permission name.
|
||||
* This is set to {@code true} if this (@code BasicPermissionCollection}
|
||||
* contains a {code BasicPermission} with '*' as its permission name.
|
||||
*
|
||||
* @see #serialPersistentFields
|
||||
*/
|
||||
private boolean all_allowed;
|
||||
|
||||
/**
|
||||
* The class to which all BasicPermissions in this
|
||||
* The class to which all {@code BasicPermission} objects in this
|
||||
* BasicPermissionCollection belong.
|
||||
*
|
||||
* @see #serialPersistentFields
|
||||
|
@ -348,19 +349,19 @@ final class BasicPermissionCollection
|
|||
}
|
||||
|
||||
/**
|
||||
* Adds a permission to the BasicPermissions. The key for the hash is
|
||||
* permission.path.
|
||||
* Adds a permission to the {@code BasicPermission} object.
|
||||
* The key for the hash is permission.path.
|
||||
*
|
||||
* @param permission the Permission object to add.
|
||||
* @param permission the {@code Permission} object to add.
|
||||
*
|
||||
* @throws IllegalArgumentException if the permission is not a
|
||||
* BasicPermission, or if
|
||||
* {@code BasicPermission}, or if
|
||||
* the permission is not of the
|
||||
* same Class as the other
|
||||
* same class as the other
|
||||
* permissions in this collection.
|
||||
*
|
||||
* @throws SecurityException if this BasicPermissionCollection object
|
||||
* has been marked readonly
|
||||
* @throws SecurityException if this {@code BasicPermissionCollection}
|
||||
* object has been marked readonly
|
||||
*/
|
||||
@Override
|
||||
public void add(Permission permission) {
|
||||
|
@ -370,7 +371,7 @@ final class BasicPermissionCollection
|
|||
if (isReadOnly())
|
||||
throw new SecurityException("attempt to add a Permission to a readonly PermissionCollection");
|
||||
|
||||
// make sure we only add new BasicPermissions of the same class
|
||||
// make sure we only add new BasicPermission objects of the same class
|
||||
// Also check null for compatibility with deserialized form from
|
||||
// previous versions.
|
||||
if (permClass == null) {
|
||||
|
@ -398,8 +399,8 @@ final class BasicPermissionCollection
|
|||
*
|
||||
* @param permission the Permission object to compare
|
||||
*
|
||||
* @return true if "permission" is a proper subset of a permission in
|
||||
* the set, false if not.
|
||||
* @return {@code true} if "permission" is a proper subset of a
|
||||
* permission in the set, {@code false} if not.
|
||||
*/
|
||||
@Override
|
||||
public boolean implies(Permission permission) {
|
||||
|
@ -470,16 +471,19 @@ final class BasicPermissionCollection
|
|||
// private Hashtable permissions;
|
||||
/**
|
||||
* @serialField permissions java.util.Hashtable
|
||||
* The BasicPermissions in this BasicPermissionCollection.
|
||||
* All BasicPermissions in the collection must belong to the same class.
|
||||
* The Hashtable is indexed by the BasicPermission name; the value
|
||||
* of the Hashtable entry is the permission.
|
||||
* The {@code BasicPermission} objects in this
|
||||
* {@code BasicPermissionCollection}.
|
||||
* All {@code BasicPermission} objects in the collection must belong
|
||||
* to the same class.
|
||||
* The Hashtable is indexed by the {@code BasicPermission} name;
|
||||
* the value of the Hashtable entry is the permission.
|
||||
* @serialField all_allowed boolean
|
||||
* This is set to {@code true} if this BasicPermissionCollection
|
||||
* contains a BasicPermission with '*' as its permission name.
|
||||
* This is set to {@code true} if this {@code BasicPermissionCollection}
|
||||
* contains a {@code BasicPermission} object
|
||||
* with '*' as its permission name.
|
||||
* @serialField permClass java.lang.Class
|
||||
* The class to which all BasicPermissions in this
|
||||
* BasicPermissionCollection belongs.
|
||||
* The class to which all {@code BasicPermission} objectss in this
|
||||
* {@code BasicPermissionCollection} belongs.
|
||||
*/
|
||||
@java.io.Serial
|
||||
private static final ObjectStreamField[] serialPersistentFields = {
|
||||
|
@ -520,7 +524,7 @@ final class BasicPermissionCollection
|
|||
|
||||
/**
|
||||
* readObject is called to restore the state of the
|
||||
* BasicPermissionCollection from a stream.
|
||||
* {@code BasicPermissionCollection} from a stream.
|
||||
*
|
||||
* @param in the {@code ObjectInputStream} from which data is read
|
||||
* @throws IOException if an I/O error occurs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue