Skip to content

Commit 6765f90

Browse files
wangweijseanjmullanLance Andersen
committed
8266459: Implement JEP 411: Deprecate the Security Manager for Removal
Co-authored-by: Sean Mullan <mullan@openjdk.org> Co-authored-by: Lance Andersen <lancea@openjdk.org> Co-authored-by: Weijun Wang <weijun@openjdk.org> Reviewed-by: erikj, darcy, chegar, naoto, joehw, alanb, mchung, kcr, prr, lancea
1 parent 19450b9 commit 6765f90

File tree

826 files changed

+2735
-758
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

826 files changed

+2735
-758
lines changed

make/RunTests.gmk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ define SetupRunJtregTestBody
767767
-vmoption:-XX:MaxRAMPercentage=$$($1_JTREG_MAX_RAM_PERCENTAGE) \
768768
-vmoption:-Djava.io.tmpdir="$$($1_TEST_TMP_DIR)"
769769

770-
$1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet
770+
$1_JTREG_BASIC_OPTIONS += -automatic -ignore:quiet -Djavatest.security.noSecurityManager=true
771771

772772
# Make it possible to specify the JIB_DATA_DIR for tests using the
773773
# JIB Artifact resolver

src/demo/share/jfc/J2Ddemo/java2d/Tools.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
*
3-
* Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
3+
* Copyright (c) 2007, 2021, Oracle and/or its affiliates. All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
66
* modification, are permitted provided that the following conditions
@@ -406,7 +406,7 @@ public void run() {
406406
if (pDialogState) {
407407
printJob.print(aset);
408408
}
409-
} catch (java.security.AccessControlException ace) {
409+
} catch (@SuppressWarnings("removal") java.security.AccessControlException ace) {
410410
String errmsg = "Applet access control exception; to allow "
411411
+ "access to printer, set\n"
412412
+ "permission for \"queuePrintJob\" in "

src/java.base/aix/classes/sun/nio/ch/DefaultSelectorProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
3232
* Creates this platform's default SelectorProvider
3333
*/
3434

35+
@SuppressWarnings("removal")
3536
public class DefaultSelectorProvider {
3637
private static final SelectorProviderImpl INSTANCE;
3738
static {

src/java.base/linux/classes/jdk/internal/platform/CgroupUtil.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
public final class CgroupUtil {
4141

42+
@SuppressWarnings("removal")
4243
public static Stream<String> readFilePrivileged(Path path) throws IOException {
4344
try {
4445
PrivilegedExceptionAction<Stream<String>> pea = () -> Files.lines(path);
@@ -64,7 +65,7 @@ static void unwrapIOExceptionAndRethrow(PrivilegedActionException pae) throws IO
6465
static String readStringValue(CgroupSubsystemController controller, String param) throws IOException {
6566
PrivilegedExceptionAction<BufferedReader> pea = () ->
6667
Files.newBufferedReader(Paths.get(controller.path(), param));
67-
try (BufferedReader bufferedReader =
68+
try (@SuppressWarnings("removal") BufferedReader bufferedReader =
6869
AccessController.doPrivileged(pea)) {
6970
String line = bufferedReader.readLine();
7071
return line;
@@ -76,6 +77,7 @@ static String readStringValue(CgroupSubsystemController controller, String param
7677
}
7778
}
7879

80+
@SuppressWarnings("removal")
7981
public static List<String> readAllLinesPrivileged(Path path) throws IOException {
8082
try {
8183
PrivilegedExceptionAction<List<String>> pea = () -> Files.readAllLines(path);

src/java.base/linux/classes/sun/nio/ch/DefaultSelectorProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2015, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
3232
* Creates this platform's default SelectorProvider
3333
*/
3434

35+
@SuppressWarnings("removal")
3536
public class DefaultSelectorProvider {
3637
private static final SelectorProviderImpl INSTANCE;
3738
static {

src/java.base/macosx/classes/apple/security/AppleProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -73,6 +73,7 @@ public Object newInstance(Object ctrParamObj)
7373
}
7474

7575

76+
@SuppressWarnings("removal")
7677
public AppleProvider() {
7778
/* We are the Apple provider */
7879
super("Apple", PROVIDER_VER, info);

src/java.base/macosx/classes/apple/security/KeychainStore.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ static class TrustedCertEntry {
110110
}
111111

112112
private static void permissionCheck() {
113+
@SuppressWarnings("removal")
113114
SecurityManager sec = System.getSecurityManager();
114115

115116
if (sec != null) {

src/java.base/macosx/classes/java/net/DefaultInterface.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2020, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -106,6 +106,7 @@ private static NetworkInterface chooseDefaultInterface() {
106106

107107
boolean ip4 = false, ip6 = false, isNonLinkLocal = false;
108108
PrivilegedAction<Enumeration<InetAddress>> pa = ni::getInetAddresses;
109+
@SuppressWarnings("removal")
109110
Enumeration<InetAddress> addrs = AccessController.doPrivileged(pa);
110111
while (addrs.hasMoreElements()) {
111112
InetAddress addr = addrs.nextElement();

src/java.base/macosx/classes/sun/nio/ch/DefaultSelectorProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2011, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -32,6 +32,7 @@
3232
* Creates this platform's default SelectorProvider
3333
*/
3434

35+
@SuppressWarnings("removal")
3536
public class DefaultSelectorProvider {
3637
private static final SelectorProviderImpl INSTANCE;
3738
static {

src/java.base/share/classes/com/sun/crypto/provider/DHKeyAgreement.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ private static class AllowKDF {
6666

6767
private static final boolean VALUE = getValue();
6868

69+
@SuppressWarnings("removal")
6970
private static boolean getValue() {
7071
return AccessController.doPrivileged(
7172
(PrivilegedAction<Boolean>)

0 commit comments

Comments
 (0)