Java's JEP 406 introduces pattern matching for switch statements and expressions as a preview feature targeting Java 17. It allows type patterns in case labels (similar to instanceof), supports guarded patterns using boolean expressions with &&, handles null cases, and enables combining multiple cases. Separately, JEP 411 proposes deprecating the Security Manager for eventual removal. In Java 17, most Security Manager APIs get deprecated-for-removal annotations, the default value of java.security.manager changes from 'allow' to 'disallow', and a runtime warning is added. The only known project directly broken is Eclipse Equinox (and by extension NetBeans), both with straightforward fixes. The rationale for removal is that the Security Manager has theoretical and practical shortcomings, sees little real-world adoption for security purposes, and imposes ongoing maintenance costs on Java's evolution. Non-security use cases (like intercepting System.exit) are acknowledged but considered out-of-scope, with a future JEP potentially addressing them with a purpose-built API.

10m read timeFrom nipafx.dev
Post cover image
Table of contents
▚ Intro▚ Pattern Matching And Switches▚ Security Manager Deprecation▚ Outro

Sort: