The Art of Java Type Patterns


Salle : Paris 241

Horaire : Friday 11:45 12:30

Résumé de la présentation :

The goal of project Amber within OpenJDK is to explore the inclusion of smaller, productivity-oriented Java language features. One part of this that has delivered new functionality in recent versions is pattern matching.

Pattern matching is where application logic combines testing if an expression has a specific type or structure and then extracting components of its state for processing.

In JDK 14, JEP 305 introduced pattern matching for instanceof, as a preview feature and was made a full feature in JDK 16. This simplifies the use of this operator by eliminating the need for an explicit cast and assignment. In JDK 17, JEP 406 added pattern matching for switch. It is now possible to include patterns in switch case labels.

In this session, we’ll look at the details of these two new language features, as well as a more general look at pattern matching. We’ll also explore future features in this area, such as record patterns and array patterns, which may be included in JDK 19.

By the end of the session, you’ll be all ready to make use of these powerful new features.


Track : Java, JVM

Niveau de la présentation : Intermediate

Mots clés: Java OpenJDK JDK

Room Paris 241

Simon Ritter Simon Ritter

Simon Ritter is the Deputy CTO of Azul Systems. Simon joined Sun Microsystems in 1996 and started working with Java technology from JDK 1.0; he has spent time working in both Java development and consultancy. Having moved to Oracle as part of the Sun acquisition, he managed the Java Evangelism team for the core Java platform. At Azul, he continues to help people understand Java as well as Azul’s JVM technologies and products. Simon has twice been awarded Java Rockstar status at JavaOne and is a Java Champion. He represents Azul on the Java SE Expert Group, JCP Executive Committee, and OpenJDK Vulnerability Group.