Skip to content

Commit

Permalink
Initial cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
seanjmullan committed Dec 2, 2024
1 parent d6a5f1b commit 24de25b
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,14 @@ 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
* be {@code null} if the current execution thread
* 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.
*
Expand Down
12 changes: 8 additions & 4 deletions src/java.base/share/classes/java/security/PrivilegedAction.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -27,14 +27,18 @@


/**
* 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}
* instead.
* @param <T> the type of the result of running the computation
*
* @apiNote
* This action cannot be performed with privileges enabled as the
* Security Manager is no longer supported.
*
* @since 1.2
* @see AccessController
* @see AccessController#doPrivileged(PrivilegedAction)
Expand All @@ -44,7 +48,7 @@
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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -63,15 +63,15 @@ public PrivilegedActionException(Exception exception) {
}

/**
* Returns the exception thrown by the privileged computation that
* Returns the exception thrown by the computation that
* resulted in this {@code PrivilegedActionException}.
*
* @apiNote
* This method predates the general-purpose exception chaining facility.
* 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)
Expand All @@ -90,7 +90,7 @@ public String toString() {


/**
* 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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -27,15 +27,19 @@


/**
* 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;
* computations that do not throw
* checked exceptions should use {@code PrivilegedAction} instead.
* @param <T> the type of the result of running the computation
*
* @apiNote
* This action cannot be performed with privileges enabled as the
* Security Manager is no longer supported.
*
* @since 1.2
* @see AccessController
* @see AccessController#doPrivileged(PrivilegedExceptionAction)
Expand All @@ -47,7 +51,7 @@
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
Expand Down
4 changes: 2 additions & 2 deletions src/java.base/share/classes/javax/security/auth/Subject.java
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ public static <T> T doAs(final Subject subject,
}

/**
* 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.
Expand Down Expand Up @@ -513,7 +513,7 @@ public static <T> T doAsPrivileged(final Subject subject,
}

/**
* 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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,21 +112,16 @@ public Subject getSubject() {
* 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}.
Expand Down

0 comments on commit 24de25b

Please sign in to comment.