8345065: Cleanup DomainCombiner, SubjectDomainCombiner, Subject, and PrivilegedAction specifications

Reviewed-by: weijun
This commit is contained in:
Sean Mullan 2024-12-04 12:44:23 +00:00
parent 4000e923e8
commit e13206d3a1
6 changed files with 19 additions and 27 deletions

View file

@ -46,8 +46,7 @@ public interface DomainCombiner {
* set of Permissions, for example).
*
* @param currentDomains the ProtectionDomains associated with the
* current execution thread, up to the most recent
* privileged {@code ProtectionDomain}.
* current execution thread.
* The ProtectionDomains are listed in order of execution,
* with the most recently executing {@code ProtectionDomain}
* residing at the beginning of the array. This parameter may
@ -55,8 +54,6 @@ public interface DomainCombiner {
* has no associated ProtectionDomains.
*
* @param assignedDomains an array of inherited ProtectionDomains.
* ProtectionDomains may be inherited from a parent thread,
* or from a privileged {@code AccessControlContext}.
* This parameter may be {@code null}
* if there are no inherited ProtectionDomains.
*

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,8 +27,8 @@ package java.security;
/**
* A computation to be performed with privileges enabled. The computation is
* performed by invoking {@code AccessController.doPrivileged} on the
* A computation to be performed by invoking
* {@code AccessController.doPrivileged} on the
* {@code PrivilegedAction} object. This interface is used only for
* computations that do not throw checked exceptions; computations that
* throw checked exceptions must use {@code PrivilegedExceptionAction}
@ -44,7 +44,7 @@ package java.security;
public interface PrivilegedAction<T> {
/**
* Performs the computation. This method will be called by
* {@code AccessController.doPrivileged} after enabling privileges.
* {@code AccessController.doPrivileged}.
*
* @return a class-dependent value that may represent the results of the
* computation. Each class that implements

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -63,7 +63,7 @@ public class PrivilegedActionException extends Exception {
}
/**
* Returns the exception thrown by the privileged computation that
* Returns the exception thrown by the computation that
* resulted in this {@code PrivilegedActionException}.
*
* @apiNote
@ -71,7 +71,7 @@ public class PrivilegedActionException extends Exception {
* The {@link Throwable#getCause()} method is now the preferred means of
* obtaining this information.
*
* @return the exception thrown by the privileged computation that
* @return the exception thrown by the computation that
* resulted in this {@code PrivilegedActionException}.
* @see PrivilegedExceptionAction
* @see AccessController#doPrivileged(PrivilegedExceptionAction)
@ -90,7 +90,7 @@ public class PrivilegedActionException extends Exception {
/**
* The exception thrown by the privileged computation that resulted
* The exception thrown by the computation that resulted
* in this {@code PrivilegedActionException}.
*
* @serialField exception Exception the thrown Exception

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2024, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -27,8 +27,8 @@ package java.security;
/**
* A computation to be performed with privileges enabled, that throws one or
* more checked exceptions. The computation is performed by invoking
* A computation to be performed that throws one or more checked exceptions.
* The computation is performed by invoking
* {@code AccessController.doPrivileged} on the
* {@code PrivilegedExceptionAction} object. This interface is
* used only for computations that throw checked exceptions;
@ -47,7 +47,7 @@ package java.security;
public interface PrivilegedExceptionAction<T> {
/**
* Performs the computation. This method will be called by
* {@code AccessController.doPrivileged} after enabling privileges.
* {@code AccessController.doPrivileged}.
*
* @return a class-dependent value that may represent the results of the
* computation. Each class that implements

View file

@ -453,7 +453,7 @@ public final class Subject implements java.io.Serializable {
}
/**
* Perform privileged work as a particular {@code Subject}.
* Perform work as a particular {@code Subject}.
*
* <p> This method launches {@code action} and binds {@code subject} to
* the period of its execution.
@ -513,7 +513,7 @@ public final class Subject implements java.io.Serializable {
}
/**
* Perform privileged work as a particular {@code Subject}.
* Perform work as a particular {@code Subject}.
*
* <p> This method launches {@code action} and binds {@code subject} to
* the period of its execution.

View file

@ -112,21 +112,16 @@ public class SubjectDomainCombiner implements java.security.DomainCombiner {
* In addition, caching of ProtectionDomains may be permitted.
*
* @param currentDomains the ProtectionDomains associated with the
* current execution Thread, up to the most recent
* privileged {@code ProtectionDomain}.
* current execution Thread.
* The ProtectionDomains are listed in order of execution,
* with the most recently executing {@code ProtectionDomain}
* residing at the beginning of the array. This parameter may
* be {@code null} if the current execution Thread
* has no associated ProtectionDomains.
*
* @param assignedDomains the ProtectionDomains inherited from the
* parent Thread, or the ProtectionDomains from the
* privileged {@code context}, if a call to
* {@code AccessController.doPrivileged(..., context)}
* had occurred This parameter may be {@code null}
* if there were no ProtectionDomains inherited from the
* parent Thread, or from the privileged {@code context}.
* @param assignedDomains the inherited ProtectionDomains.
* This parameter may be {@code null}
* if there were no inherited ProtectionDomains.
*
* @return a new array consisting of the updated ProtectionDomains,
* or {@code null}.