From 24de25b6a2ede46af7f0c0d1834d537b0b13164f Mon Sep 17 00:00:00 2001 From: Sean Mullan Date: Mon, 2 Dec 2024 17:17:10 -0500 Subject: [PATCH] Initial cleanup. --- .../share/classes/java/security/DomainCombiner.java | 5 +---- .../classes/java/security/PrivilegedAction.java | 12 ++++++++---- .../java/security/PrivilegedActionException.java | 8 ++++---- .../java/security/PrivilegedExceptionAction.java | 12 ++++++++---- .../share/classes/javax/security/auth/Subject.java | 4 ++-- .../javax/security/auth/SubjectDomainCombiner.java | 13 ++++--------- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/java.base/share/classes/java/security/DomainCombiner.java b/src/java.base/share/classes/java/security/DomainCombiner.java index 704c6315bb1a4..1594a48783f6f 100644 --- a/src/java.base/share/classes/java/security/DomainCombiner.java +++ b/src/java.base/share/classes/java/security/DomainCombiner.java @@ -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. * diff --git a/src/java.base/share/classes/java/security/PrivilegedAction.java b/src/java.base/share/classes/java/security/PrivilegedAction.java index 39db3492c0103..ea131e47d03ff 100644 --- a/src/java.base/share/classes/java/security/PrivilegedAction.java +++ b/src/java.base/share/classes/java/security/PrivilegedAction.java @@ -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,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 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) @@ -44,7 +48,7 @@ public interface PrivilegedAction { /** * 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 diff --git a/src/java.base/share/classes/java/security/PrivilegedActionException.java b/src/java.base/share/classes/java/security/PrivilegedActionException.java index 9c52d8739b850..1c1418f4267c7 100644 --- a/src/java.base/share/classes/java/security/PrivilegedActionException.java +++ b/src/java.base/share/classes/java/security/PrivilegedActionException.java @@ -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 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 @@ -71,7 +71,7 @@ public PrivilegedActionException(Exception 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 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 diff --git a/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java b/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java index 00863ddf4a1cc..2c66d6f20440e 100644 --- a/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java +++ b/src/java.base/share/classes/java/security/PrivilegedExceptionAction.java @@ -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 @@ /** - * 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; @@ -36,6 +36,10 @@ * checked exceptions should use {@code PrivilegedAction} instead. * @param 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) @@ -47,7 +51,7 @@ public interface PrivilegedExceptionAction { /** * 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 diff --git a/src/java.base/share/classes/javax/security/auth/Subject.java b/src/java.base/share/classes/javax/security/auth/Subject.java index 97ab672e1cc84..ceb860e653a53 100644 --- a/src/java.base/share/classes/javax/security/auth/Subject.java +++ b/src/java.base/share/classes/javax/security/auth/Subject.java @@ -453,7 +453,7 @@ public static T doAs(final Subject subject, } /** - * Perform privileged work as a particular {@code Subject}. + * Perform work as a particular {@code Subject}. * *

This method launches {@code action} and binds {@code subject} to * the period of its execution. @@ -513,7 +513,7 @@ public static T doAsPrivileged(final Subject subject, } /** - * Perform privileged work as a particular {@code Subject}. + * Perform work as a particular {@code Subject}. * *

This method launches {@code action} and binds {@code subject} to * the period of its execution. diff --git a/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java b/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java index bab2c5b9da9b3..643aea9e93c6c 100644 --- a/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java +++ b/src/java.base/share/classes/javax/security/auth/SubjectDomainCombiner.java @@ -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}.