Previously when a SecurityManager wasn't enabled Permission::checkGuard
didn't throw a SecurityException. The new behaviour is to throw a
SecurityException when SecurityManager is not enabled. I understand
that OpenJDK wishes to expedite the removal of these methods from
existing code, however this method has not been deprecated and the new
behaviour breaks backward compatibility. Code that runs on Java 8 or 11
containing these methods cannot run unmodified on Java 26.
Isn't it preferable to perform a no op similar to
AccessController.doPrivileged, to allow old code to run unmodified?
--
Regards,
Peter
- [External] : Permission::checkGuard always throws Security... Peter Firmstone
-