Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/java.base/share/classes/java/io/FilePermission.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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 @@ -67,7 +67,7 @@
* <P>
* The actions string is converted to lowercase before processing.
*
* @apiNote
* @deprecated
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
*
Expand All @@ -83,6 +83,7 @@
* @serial exclude
*/

@Deprecated(since="25", forRemoval=true)
public final class FilePermission extends Permission implements Serializable {

/**
Expand Down Expand Up @@ -1115,6 +1116,7 @@ public FilePermissionCollection() {
* has been marked readonly
*/
@Override
@SuppressWarnings("removal")
public void add(Permission permission) {
if (! (permission instanceof FilePermission fp))
throw new IllegalArgumentException("invalid permission: "+
Expand Down Expand Up @@ -1152,6 +1154,7 @@ public void add(Permission permission) {
* the set, false if not.
*/
@Override
@SuppressWarnings("removal")
public boolean implies(Permission permission) {
if (! (permission instanceof FilePermission fperm))
return false;
Expand Down Expand Up @@ -1180,6 +1183,7 @@ public boolean implies(Permission permission) {
* @return an enumeration of all the FilePermission objects.
*/
@Override
@SuppressWarnings("removal")
public Enumeration<Permission> elements() {
return perms.elements();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1996, 2025, 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 @@ -186,6 +186,7 @@ public interface ObjectStreamConstants {
* @see java.io.ObjectInputStream#enableResolveObject(boolean)
* @since 1.2
*/
@SuppressWarnings("removal")
static final SerializablePermission SUBSTITUTION_PERMISSION =
new SerializablePermission("enableSubstitution");

Expand All @@ -196,6 +197,7 @@ public interface ObjectStreamConstants {
* @see java.io.ObjectInputStream#readObjectOverride()
* @since 1.2
*/
@SuppressWarnings("removal")
static final SerializablePermission SUBCLASS_IMPLEMENTATION_PERMISSION =
new SerializablePermission("enableSubclassImplementation");

Expand All @@ -205,6 +207,7 @@ public interface ObjectStreamConstants {
* @see java.io.ObjectInputFilter.Config#setSerialFilter(ObjectInputFilter)
* @since 9
*/
@SuppressWarnings("removal")
static final SerializablePermission SERIAL_FILTER_PERMISSION =
new SerializablePermission("serialFilter");

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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 @@ -36,7 +36,7 @@
* no actions list; you either have the named permission
* or you don't.
*
* @apiNote
* @deprecated
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
*
Expand All @@ -51,6 +51,7 @@

/* code was borrowed originally from java.lang.RuntimePermission. */

@Deprecated(since="25", forRemoval=true)
public final class SerializablePermission extends BasicPermission {

@java.io.Serial
Expand Down
5 changes: 3 additions & 2 deletions src/java.base/share/classes/java/lang/RuntimePermission.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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 @@ -38,7 +38,7 @@
* An asterisk may appear at the end of the name, following a ".",
* or by itself, to signify a wildcard match. For example: "loadLibrary.*"
* and "*" signify a wildcard match, while "*loadLibrary" and "a*b" do not.
* @apiNote
* @deprecated
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
*
Expand All @@ -53,6 +53,7 @@
* @since 1.2
*/

@Deprecated(since="25", forRemoval=true)
public final class RuntimePermission extends BasicPermission {

@java.io.Serial
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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 @@ -28,7 +28,7 @@
/**
* The Permission class for reflective operations.
*
* @apiNote
* @deprecated
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
*
Expand All @@ -38,6 +38,7 @@
*
* @since 1.2
*/
@Deprecated(since="25", forRemoval=true)
public final
class ReflectPermission extends java.security.BasicPermission {

Expand Down
5 changes: 3 additions & 2 deletions src/java.base/share/classes/java/nio/file/LinkPermission.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2007, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2007, 2025, 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 @@ -30,12 +30,13 @@
/**
* The {@code Permission} class for link creation operations.
*
* @apiNote
* @deprecated
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
*
* @since 1.7
*/
@Deprecated(since="25", forRemoval=true)
public final class LinkPermission extends BasicPermission {
@java.io.Serial
static final long serialVersionUID = -1441492453772213220L;
Expand Down
9 changes: 7 additions & 2 deletions src/java.base/share/classes/java/util/PropertyPermission.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2025, 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 @@ -54,7 +54,7 @@
* <P>
* The actions string is converted to lowercase before processing.
*
* @apiNote
* @deprecated
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
*
Expand All @@ -70,6 +70,7 @@
* @serial exclude
*/

@Deprecated(since="25", forRemoval=true)
public final class PropertyPermission extends BasicPermission {

/**
Expand Down Expand Up @@ -412,6 +413,7 @@ final class PropertyPermissionCollection extends PermissionCollection
* Key is property name; value is PropertyPermission.
* Not serialized; see serialization section at end of class.
*/
@SuppressWarnings("removal")
private transient ConcurrentHashMap<String, PropertyPermission> perms;

/**
Expand Down Expand Up @@ -443,6 +445,7 @@ public PropertyPermissionCollection() {
* object has been marked readonly
*/
@Override
@SuppressWarnings("removal")
public void add(Permission permission) {
if (! (permission instanceof PropertyPermission pp))
throw new IllegalArgumentException("invalid permission: "+
Expand Down Expand Up @@ -487,6 +490,7 @@ public void add(Permission permission) {
* the set, false if not.
*/
@Override
@SuppressWarnings("removal")
public boolean implies(Permission permission) {
if (! (permission instanceof PropertyPermission pp))
return false;
Expand Down Expand Up @@ -613,6 +617,7 @@ private void writeObject(ObjectOutputStream out) throws IOException {
* perms field. Reads in all_allowed.
*/
@java.io.Serial
@SuppressWarnings("removal")
private void readObject(ObjectInputStream in)
throws IOException, ClassNotFoundException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1629,12 +1629,6 @@ final boolean isApparentlyUnblocked() {
*/
private static volatile int poolIds;

/**
* Permission required for callers of methods that may start or
* kill threads. Lazily constructed.
*/
static volatile RuntimePermission modifyThreadPermission;

/**
* For VirtualThread intrinsics
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2025, 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 @@ -35,6 +35,7 @@ public interface JavaIOFilePermissionAccess {
* @return the new FilePermission plus the alt path (as npath2)
* or the input itself if no alt path is available.
*/
@SuppressWarnings("removal")
FilePermission newPermPlusAltPath(FilePermission input);

/**
Expand All @@ -44,5 +45,6 @@ public interface JavaIOFilePermissionAccess {
* @return the new FilePermission using the alt path (as npath)
* or null if no alt path is available
*/
@SuppressWarnings("removal")
FilePermission newPermUsingAltPath(FilePermission input);
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2002, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2002, 2025, 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 @@ -287,6 +287,7 @@ public static void setJavaIOFileDescriptorAccess(JavaIOFileDescriptorAccess jiof
javaIOFileDescriptorAccess = jiofda;
}

@SuppressWarnings("removal")
public static JavaIOFilePermissionAccess getJavaIOFilePermissionAccess() {
var access = javaIOFilePermissionAccess;
if (access == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public String getScheme() {
/**
* Need RuntimePermission "accessSystemModules" to create or get jrt:/
*/
@SuppressWarnings("removal")
private void checkPermission() {
@SuppressWarnings({ "removal", "suppression" })
SecurityManager sm = System.getSecurityManager();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1995, 2025, 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 @@ -204,6 +204,7 @@ public synchronized InputStream getInputStream()
/* since getOutputStream isn't supported, only read permission is
* relevant
*/
@SuppressWarnings("removal")
public Permission getPermission() throws IOException {
if (permission == null) {
String decodedPath = ParseUtil.decode(url.getPath());
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2016, 2025, 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 @@ -60,6 +60,7 @@ public class FilePermCompat {
}
}

@SuppressWarnings("removal")
public static Permission newPermPlusAltPath(Permission input) {
if (compat && input instanceof FilePermission) {
return SharedSecrets.getJavaIOFilePermissionAccess()
Expand All @@ -68,6 +69,7 @@ public static Permission newPermPlusAltPath(Permission input) {
return input;
}

@SuppressWarnings("removal")
public static Permission newPermUsingAltPath(Permission input) {
if (input instanceof FilePermission) {
return SharedSecrets.getJavaIOFilePermissionAccess()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ final class UNCFileURLConnection extends FileURLConnection {
}

@Override
@SuppressWarnings("removal")
public Permission getPermission() {
Permission perm = permission;
if (perm == null) {
Expand All @@ -49,4 +50,3 @@ public Permission getPermission() {
return perm;
}
}

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 2025, 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 @@ -31,7 +31,6 @@
import java.nio.file.DirectoryNotEmptyException;
import java.nio.file.FileAlreadyExistsException;
import java.nio.file.LinkOption;
import java.nio.file.LinkPermission;
import java.nio.file.StandardCopyOption;
import java.util.concurrent.ExecutionException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2000, 2024, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2000, 2025, 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 @@ -31,7 +31,7 @@
* This class is for logging permissions. Currently there is only one
* LoggingPermission named "control".
*
* @apiNote
* @deprecated
* This permission cannot be used for controlling access to resources
* as the Security Manager is no longer supported.
*
Expand All @@ -45,6 +45,7 @@
*
*/

@Deprecated(since="25", forRemoval=true)
public final class LoggingPermission extends java.security.BasicPermission {

private static final long serialVersionUID = 63564341580231582L;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ public Set<ModuleReference> findAll() {
* Defines the translet class and auxiliary classes.
* Returns a reference to the Class object that defines the main class
*/
@SuppressWarnings("removal")
private void defineTransletClasses()
throws TransformerConfigurationException {

Expand Down