Skip to content

Commit

Permalink
8345502: Remove doIntersectionPrivilege methods
Browse files Browse the repository at this point in the history
Reviewed-by: weijun
  • Loading branch information
seanjmullan committed Dec 4, 2024
1 parent faa109e commit de3a218
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 93 deletions.
2 changes: 1 addition & 1 deletion src/java.base/share/classes/java/security/Policy.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* supported. Installing a system-wide {@code Policy} object is no longer
* supported. The {@linkplain #setPolicy setPolicy} method has been
* changed to always throw {@code UnsupportedOperationException}. The
* {@linkplain getPolicy getPolicy} method has been changed to always
* {@linkplain #getPolicy getPolicy} method has been changed to always
* return a {@code Policy} object that grants no permissions. There is no
* replacement for the Security Manager or this class.
*/
Expand Down
36 changes: 0 additions & 36 deletions src/java.base/share/classes/java/security/ProtectionDomain.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@

package java.security;

import jdk.internal.access.JavaSecurityAccess;
import jdk.internal.access.SharedSecrets;

/**
* The {@code ProtectionDomain} class encapsulates the characteristics of a
* domain, which encloses a set of classes whose instances are granted a set
Expand All @@ -51,39 +48,6 @@

public class ProtectionDomain {

private static class JavaSecurityAccessImpl implements JavaSecurityAccess {

private JavaSecurityAccessImpl() {
}

@SuppressWarnings("removal")
@Override
public <T> T doIntersectionPrivilege(
PrivilegedAction<T> action,
final AccessControlContext stack,
final AccessControlContext context) {
if (action == null) {
throw new NullPointerException();
}

return AccessController.doPrivileged(action);
}

@SuppressWarnings("removal")
@Override
public <T> T doIntersectionPrivilege(
PrivilegedAction<T> action,
AccessControlContext context) {
return doIntersectionPrivilege(action,
AccessController.getContext(), context);
}
}

static {
// Set up JavaSecurityAccess in SharedSecrets
SharedSecrets.setJavaSecurityAccess(new JavaSecurityAccessImpl());
}

/* CodeSource */
private final CodeSource codesource ;

Expand Down

This file was deleted.

17 changes: 0 additions & 17 deletions src/java.base/share/classes/jdk/internal/access/SharedSecrets.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,7 @@
import java.io.FileDescriptor;
import java.io.FilePermission;
import java.io.ObjectInputStream;
import java.io.PrintStream;
import java.io.PrintWriter;
import java.io.RandomAccessFile;
import java.security.ProtectionDomain;
import java.security.Signature;
import javax.security.auth.x500.X500Principal;

Expand Down Expand Up @@ -89,7 +86,6 @@ public class SharedSecrets {
private static JavaUtilJarAccess javaUtilJarAccess;
private static JavaUtilZipFileAccess javaUtilZipFileAccess;
private static JavaUtilResourceBundleAccess javaUtilResourceBundleAccess;
private static JavaSecurityAccess javaSecurityAccess;
private static JavaSecurityPropertiesAccess javaSecurityPropertiesAccess;
private static JavaSecuritySignatureAccess javaSecuritySignatureAccess;
private static JavaSecuritySpecAccess javaSecuritySpecAccess;
Expand Down Expand Up @@ -313,19 +309,6 @@ public static JavaIOFileDescriptorAccess getJavaIOFileDescriptorAccess() {
return access;
}

public static void setJavaSecurityAccess(JavaSecurityAccess jsa) {
javaSecurityAccess = jsa;
}

public static JavaSecurityAccess getJavaSecurityAccess() {
var access = javaSecurityAccess;
if (access == null) {
ensureClassInitialized(ProtectionDomain.class);
access = javaSecurityAccess;
}
return access;
}

public static void setJavaSecurityPropertiesAccess(JavaSecurityPropertiesAccess jspa) {
javaSecurityPropertiesAccess = jspa;
}
Expand Down

1 comment on commit de3a218

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.