A roundup of recent JDK proposals from Projects Amber and Valhalla as of early March 2021. Amber is advancing pattern matching for switch expressions (including guard patterns and null handling), array/record deconstruction patterns, and primitive type patterns. Valhalla is proposing primitive classes — a new kind of type that combines the performance of primitives (flat/dense memory, no GC) with the abstraction of objects (fields, methods, interfaces) — along with a plan to migrate existing wrapper classes like Integer to reference-favoring primitive classes and treat primitive keywords as aliases for primitive value types, potentially allowing calls like 42.toString().
Table of contents
▚ Intro▚ Pattern Matching for switch▚ Array Patterns▚ Record Patterns▚ Primitive Type Patterns▚ Primitive Objects▚ Unifying Basic Primitives with Objects▚ OutroSort: