Skip to content

Commit f804f2c

Browse files
mcpowersValerie Peng
authored andcommitted
8284851: Update javax.crypto files to use proper javadoc for mentioned classes
Reviewed-by: weijun, valeriep
1 parent 8cdead0 commit f804f2c

File tree

92 files changed

+2143
-2011
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

92 files changed

+2143
-2011
lines changed

src/java.base/share/classes/java/security/AccessControlContext.java

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -34,28 +34,28 @@
3434

3535

3636
/**
37-
* An AccessControlContext is used to make system resource access decisions
38-
* based on the context it encapsulates.
37+
* An {@code AccessControlContext} is used to make system resource access
38+
* decisions based on the context it encapsulates.
3939
*
4040
* <p>More specifically, it encapsulates a context and
4141
* has a single method, {@code checkPermission},
4242
* that is equivalent to the {@code checkPermission} method
43-
* in the AccessController class, with one difference: The AccessControlContext
44-
* {@code checkPermission} method makes access decisions based on the
43+
* in the {@code AccessController} class, with one difference:
44+
* The {@code checkPermission} method makes access decisions based on the
4545
* context it encapsulates,
4646
* rather than that of the current execution thread.
4747
*
48-
* <p>Thus, the purpose of AccessControlContext is for those situations where
49-
* a security check that should be made within a given context
48+
* <p>Thus, the purpose of {@code AccessControlContext} is for those
49+
* situations where a security check that should be made within a given context
5050
* actually needs to be done from within a
5151
* <i>different</i> context (for example, from within a worker thread).
5252
*
53-
* <p> An AccessControlContext is created by calling the
53+
* <p> An {@code AccessControlContext} is created by calling the
5454
* {@code AccessController.getContext} method.
5555
* The {@code getContext} method takes a "snapshot"
5656
* of the current calling context, and places
57-
* it in an AccessControlContext object, which it returns. A sample call is
58-
* the following:
57+
* it in an {@code AccessControlContext} object, which it returns.
58+
* A sample call is the following:
5959
*
6060
* <pre>
6161
* AccessControlContext acc = AccessController.getContext()
@@ -64,7 +64,7 @@
6464
* <p>
6565
* Code within a different context can subsequently call the
6666
* {@code checkPermission} method on the
67-
* previously-saved AccessControlContext object. A sample call is the
67+
* previously-saved {@code AccessControlContext} object. A sample call is the
6868
* following:
6969
*
7070
* <pre>
@@ -125,13 +125,14 @@ static Debug getDebug()
125125
}
126126

127127
/**
128-
* Create an AccessControlContext with the given array of ProtectionDomains.
129-
* Context must not be null. Duplicate domains will be removed from the
130-
* context.
128+
* Create an {@code AccessControlContext} with the given array of
129+
* {@code ProtectionDomain} objects.
130+
* Context must not be {@code null}. Duplicate domains will be removed
131+
* from the context.
131132
*
132-
* @param context the ProtectionDomains associated with this context.
133-
* The non-duplicate domains are copied from the array. Subsequent
134-
* changes to the array will not affect this AccessControlContext.
133+
* @param context the {@code ProtectionDomain} objects associated with this
134+
* context. The non-duplicate domains are copied from the array. Subsequent
135+
* changes to the array will not affect this {@code AccessControlContext}.
135136
* @throws NullPointerException if {@code context} is {@code null}
136137
*/
137138
public AccessControlContext(ProtectionDomain[] context)
@@ -185,9 +186,9 @@ public AccessControlContext(AccessControlContext acc,
185186
}
186187

187188
/**
188-
* package private to allow calls from ProtectionDomain without performing
189-
* the security check for {@linkplain SecurityConstants#CREATE_ACC_PERMISSION}
190-
* permission
189+
* package private to allow calls from (@code ProtectionDomain} without
190+
* performing the security check for
191+
* {@linkplain SecurityConstants#CREATE_ACC_PERMISSION} permission
191192
*/
192193
AccessControlContext(AccessControlContext acc,
193194
@SuppressWarnings("removal") DomainCombiner combiner,
@@ -215,7 +216,7 @@ public AccessControlContext(AccessControlContext acc,
215216
}
216217

217218
/**
218-
* package private for AccessController
219+
* package private for {@code AccessController}
219220
*
220221
* This "argument wrapper" context will be passed as the actual context
221222
* parameter on an internal doPrivileged() call used in the implementation.
@@ -292,7 +293,7 @@ public AccessControlContext(AccessControlContext acc,
292293

293294

294295
/**
295-
* package private constructor for AccessController.getContext()
296+
* package private constructor for {@code AccessController.getContext()}
296297
*/
297298

298299
AccessControlContext(ProtectionDomain[] context,
@@ -304,7 +305,7 @@ public AccessControlContext(AccessControlContext acc,
304305
}
305306

306307
/**
307-
* Constructor for JavaSecurityAccess.doIntersectionPrivilege()
308+
* Constructor for {@code JavaSecurityAccess.doIntersectionPrivilege()}
308309
*/
309310
AccessControlContext(ProtectionDomain[] context,
310311
AccessControlContext privilegedContext)
@@ -322,7 +323,7 @@ ProtectionDomain[] getContext() {
322323
}
323324

324325
/**
325-
* Returns true if this context is privileged.
326+
* Returns {@code true} if this context is privileged.
326327
*/
327328
boolean isPrivileged()
328329
{
@@ -370,7 +371,7 @@ public DomainCombiner getDomainCombiner() {
370371
}
371372

372373
/**
373-
* package private for AccessController
374+
* package private for {@code AccessController}
374375
*/
375376
@SuppressWarnings("removal")
376377
DomainCombiner getCombiner() {
@@ -385,20 +386,22 @@ boolean isAuthorized() {
385386
* Determines whether the access request indicated by the
386387
* specified permission should be allowed or denied, based on
387388
* the security policy currently in effect, and the context in
388-
* this object. The request is allowed only if every ProtectionDomain
389-
* in the context implies the permission. Otherwise the request is
390-
* denied.
389+
* this object. The request is allowed only if every
390+
* {@code ProtectionDomain} in the context implies the permission.
391+
* Otherwise the request is denied.
391392
*
392393
* <p>
393394
* This method quietly returns if the access request
394-
* is permitted, or throws a suitable AccessControlException otherwise.
395+
* is permitted, or throws a suitable {@code AccessControlException}
396+
* otherwise.
395397
*
396398
* @param perm the requested permission.
397399
*
398400
* @throws AccessControlException if the specified permission
399401
* is not permitted, based on the current security policy and the
400402
* context encapsulated by this object.
401-
* @throws NullPointerException if the permission to check for is null.
403+
* @throws NullPointerException if the permission to check for is
404+
* {@code null}.
402405
*/
403406
@SuppressWarnings("removal")
404407
public void checkPermission(Permission perm)
@@ -751,14 +754,15 @@ private void calculateFields(AccessControlContext assigned,
751754

752755

753756
/**
754-
* Checks two AccessControlContext objects for equality.
757+
* Checks two {@code AccessControlContext} objects for equality.
755758
* Checks that {@code obj} is
756-
* an AccessControlContext and has the same set of ProtectionDomains
757-
* as this context.
759+
* an {@code AccessControlContext} and has the same set of
760+
* {@code ProtectionDomain} objects as this context.
758761
*
759762
* @param obj the object we are testing for equality with this object.
760-
* @return true if {@code obj} is an AccessControlContext, and has the
761-
* same set of ProtectionDomains as this context, false otherwise.
763+
* @return {@code true} if {@code obj} is an {@code AccessControlContext},
764+
* and has the same set of {@code ProtectionDomain} objects as this context,
765+
* {@code false} otherwise.
762766
*/
763767
public boolean equals(Object obj) {
764768
if (obj == this)

src/java.base/share/classes/java/security/AccessControlException.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1997, 2021, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1997, 2022, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,12 +26,12 @@
2626
package java.security;
2727

2828
/**
29-
* <p> This exception is thrown by the AccessController to indicate
29+
* <p> This exception is thrown by the {@code AccessController} to indicate
3030
* that a requested access (to a critical system resource such as the
3131
* file system or the network) is denied.
3232
*
3333
* <p> The reason to deny access can vary. For example, the requested
34-
* permission might be of an incorrect type, contain an invalid
34+
* permission might be of an incorrect type, contain an invalid
3535
* value, or request access that is not allowed according to the
3636
* security policy. Such information should be given whenever
3737
* possible at the time the exception is thrown.
@@ -81,8 +81,8 @@ public AccessControlException(String s, Permission p) {
8181
}
8282

8383
/**
84-
* Gets the Permission object associated with this exception, or
85-
* null if there was no corresponding Permission object.
84+
* Gets the {@code Permission} object associated with this exception, or
85+
* {@code null} if there was no corresponding {@code Permission} object.
8686
*
8787
* @return the Permission object.
8888
*/

0 commit comments

Comments
 (0)