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
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()
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 )
0 commit comments