JDK-8276805 : java/awt/print/PrinterJob/CheckPrivilege.java fails due to disabled SecurityManager
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 17,18
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2021-11-08
  • Updated: 2021-11-19
  • Resolved: 2021-11-10
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 17 JDK 18
17.0.2Fixed 18 b23Fixed
Related Reports
Relates :  
Relates :  
Description
$ CONF=linux-x86_64-server-fastdebug make test TEST=java/awt/print/PrinterJob/CheckPrivilege.java

STDERR:
Failed to install SecurityManager
java.lang.UnsupportedOperationException: The Security Manager is deprecated and will be removed in a future release
	at java.base/java.lang.System.setSecurityManager(System.java:411)
	at CheckPrivilege.main(CheckPrivilege.java:81)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:833)
java.lang.RuntimeException: Failed to install SecurityManager
	at CheckPrivilege.main(CheckPrivilege.java:87)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:127)
	at java.base/java.lang.Thread.run(Thread.java:833)

Comments
Fix Request (17u) Improves testing after SM deprecation. Applies cleanly.
18-11-2021

I think this addition was just missed by JDK-8267184.
18-11-2021

Changeset: fd0a25e6 Author: Aleksey Shipilev <shade@openjdk.org> Date: 2021-11-10 07:59:01 +0000 URL: https://git.openjdk.java.net/jdk/commit/fd0a25e62b2c8abc3a419c2e80abbcf11c9e882f
10-11-2021