RFR: 8266459: Implement JEP 411: Deprecate the Security Manager for Removal [v3]
Weijun Wang
weijun at openjdk.java.net
Wed May 19 18:41:44 UTC 2021
On Wed, 19 May 2021 18:26:25 GMT, Phil Race <prr at openjdk.org> wrote:
>> Weijun Wang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> fixing awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java
>
> src/java.desktop/share/classes/java/awt/Component.java line 217:
>
>> 215: * @author Sami Shaio
>> 216: */
>> 217: @SuppressWarnings("removal")
>
> Why is this placed on the *entire class* ??
> This class is 10535 lines long and mentions AccessControl something like 8 places it uses AccessController or AcessControlContext.
This happens when a deprecated method is called inside a static block. The annotation can only be added to a declaration and here it must be the whole class. The call in this file is
s = java.security.AccessController.doPrivileged(
new GetPropertyAction("awt.image.redrawrate"));
> src/java.desktop/share/classes/java/awt/Container.java line 97:
>
>> 95: * @since 1.0
>> 96: */
>> 97: @SuppressWarnings("removal")
>
> Same issue as with Component. a > 5,000 line file that uses AccessController in just 4 places.
>
> Where else are you adding this to entire classes instead of the specific site ?
Similar as the one above, it's because of
static {
// Don't lazy-read because every app uses invalidate()
isJavaAwtSmartInvalidate = AccessController.doPrivileged(
new GetBooleanAction("java.awt.smartInvalidate"));
}
> test/jdk/java/awt/datatransfer/DataFlavor/DataFlavorRemoteTest.java line 59:
>
>> 57: ProcessCommunicator
>> 58: .executeChildProcess(Consumer.class, new String[0]);
>> 59: if (!"Hello".equals(processResults.getStdOut())) {
>
> Who or what prompted this change ?
The child process is started with `-Djava.security.manager=allow` (after the other PR) and a warning will be printed to stderr. Therefore I move the message to stdout.
-------------
PR: https://git.openjdk.java.net/jdk/pull/4073
More information about the security-dev
mailing list