
Pattern Matching, Under the Microscope
Project Amber has introduced pattern matching into the Java language, improving both safety and expressiveness of our programs. With JEP 507 set to lift restrictions on primitive types in instanceof and switch, pattern matching is positioned as the foundation of safe cast conversions across all Java types. But what does this mean for the language, its safety guarantees, and how we test runtime conditions? This session takes an in-depth look at the fundamental concepts of exhaustiveness, unconditionality, applicability, remainder, and examine the distinction between exact and inexact conversions as introduced by JEP 507. With practical code comparisons and visual explanations, we will see how these patterns drive safer code and enable innovative language features on the horizon.
