The Loom project has been under work for several years now. A preview version has been made available in the JDK 19, so we now have a precise idea of what it will bring to the Java platform. We can see the patterns we will be able to use, and the performances it will bring. Our good old Threads, created more than 25 years ago, will see a new kind of lightweight threads. Creating a thread will be easier and much cheaper, allowing the creation of millions of them in a single JVM. These virtual threads can be block at almost no cost. These new virtual threads bring with them new notions that will be covered in this talk. You will see structured concurrency, reactive and asynchronous programming. You will learn about ExtentLocal, a new way of dealing with ThreadLocal variables, about StructuredExecutor, and about synchronization. A lot of code is shown in this presentation that will show you how Loom can change the way you write your code, the performance gains you may expect, both in your application and for the Java Virtual Machine itself.
The releases of the JDK 17 to 19 bring interesting features in the Java language: sealed types, pattern matching for switch (as a preview feature). Along with the introduction of records, the implementation of pattern matching in the Java language begins to take shape. The JDK 19 brings even more with Record pattern matching (as a preview feature), that further simplifies your code. In this presentation we show you how records are working, how you can use them to make your code much more readable, and how you can leverage sealed types and switch expressions to improve the modularity of your application. You will see pattern matching in action on real examples, how it will change the way you write Java code, and what you can expect on this topic in the future. It is mostly a live coding presentation, with some slides when the code shown cannot be executed.
The Java Collections Framework is the most widely used API – probably in your application too. You use it all the time, but do you really know your way around it? You can be surprised even by common classes like ArrayList and HashMap, let alone by the handling of null values or immutability in lesser-known classes. In this interactive session, we’ll look at some obvious code and its less-than-obvious effect. It’s up to you to guess the outcome! But everything will be explained, and you’ll end up knowing how to avoid pitfalls, both well-known and obscure, in using the Collections Framework.