Hi all! 👋 👋 👋👋
We are Tinkoff Java developers: Andrey, Arseny, Konstantin And Konstantin — our team has grown by a whole Kostya. We now collect 25% more interesting news, articles, tutorials and other materials from the world of Java development and share it with the entire community.
The main news of the past month: Java 22 was released. In this issue, we collected a lot of materials on this topic: JEP reviews, videos and articles on the changes. There will be reviews about new releases and the Ktor roadmap. There was a place for tutorials visited by Testcontainers, ExecutorService, Spring and Java NIO. By the way, on March 24, Spring 1.0 turned 20 years old – there is also interesting material on this topic. Happy reading 🙂
Java 22 released
New in Java 22:
JEP 423: Region Pinning for G1. Adds memory region pinning for G1, allowing garbage collection in regions with objects used by JNI.
JEP 454: Foreign Function & Memory API. Finishes work on External Functions and Memory APIimproving productivity and user experience for developers.
JEP 456: Unnamed Variables & Patterns. Allows you to replace variables and patterns you don’t intend to use with underscores. This not only reduces the complexity of the code, but also improves its readability.
JEP 458: Launch Multi-File Source-Code Programs. Runs programs with multiple source code files, allows Java Launcher to compile and run multiple source code files – an improvement over JEP 330 for running programs with a single source code file.
JEPs available in preview mode:
JEP 447: Statements before super(…). Allows you to add statements before calling super in constructors. This gives developers the ability to add validation or other variable processing before calling the parent constructor.
JEP 457: Class-File API. Provides a standard API for class files. It’s unlikely that most developers will interact with the class file APIs directly, but can improve the upgrade process between JDK versions.
JEP 461: Stream Gatherers. Stream Gatherer is a tool for developers to define custom intermediate operations for the Stream API. In fact, a direct analogue of collectors for terminal operations. Several gazers come out of the box: fold, mapConcurrent, scan, windowFixed, windowSliding.
JEP 463: Implicitly Declared Classes and Instance Main Methods. Second preview of JEP 445, unnamed classes and main instance methods. JEP contains changes to the rules for implicit declaration of classes in source files and the procedure for choosing the main method to call.
JEP 459 String Templates, 462 Structured Concurrency And 464 Scoped Values are in the second iteration of preview and contain minor or no API changes.
And also a RECORD, because no JEP has ever been in the incubator stage for so long:
JEP 460 Vector API – vector API, the only function of the incubator with the seventh iteration of the incubator status. The Vector API will continue to be an incubator pending the release of project Valhalla features.
Additional materials:
A short overview of features in 2 minutes:
A more complete overview of the changes:
Recording of a stream on the official channel dedicated to the release:
Java 22 and IntelliJ IDEA — a review of features with a focus on their support in IntelliJ IDEA 2024.1.
Java 22 Is Here, And It’s Ready To Rock – another overview of all the features of Java 22. The material itself is well structured, all features are grouped by belonging to the JDK project or a specific aspect of Java. A big plus is that for all features there are examples of use and a list of changes relative to Java 21.
JDK 22 security improvements. Contains security improvements grouped into categories: crypto, TLS, and so on. A new security category has been added for the Java -XshowSettings parameter. The AsymmetricKey interface provides a default implementation and makes it easy to extract parameters from keys. New root CA certificates have been added to the Cacerts keystore. Additional system properties to control the maximum length of client and server certificate chains have been added to the JDK. And you will find much more in this article.
Main news
Advice for Java users on macOS 14. Those running Apple Silicon systems should skip macOS 14.4 and update to macOS 14.4.1. Apple released macOS 14.4.1, fixing the issue of Java process ending unexpectedly. The issue affects all versions of Java, from Java 8 to JDK 22 builds. For early access, macOS on Apple Silicon processors includes a feature for managing dynamically generated code. In macOS 14.4, when accessing a protected memory area, the SIGKILL signal is sent instead of the SIGBUS or SIGSEGV signal. The Java Virtual Machine generates code dynamically and uses a secure memory access signaling mechanism. In macOS 14.4, instead of processing the signal, programs exit. Oracle recommends that Java users on ARM-based Apple devices skip macOS 14.4 and upgrade to macOS 14.4.1.
AtomicJar is now part of Docker! AtomicJar develops Testcontainers and becomes part of the Docker company. The companies have been collaborating for a long time, in particular, examples of Testcontainers can be found in the official Docker documentation. Now Testcontainers, Testcontainers Desktop and Testcontainers Cloud themselves will become a full-fledged part of the Docker ecosystem.
The Ktor Roadmap for 2024. JetBrains has published a roadmap for the development of the Ktor framework in 2024. Interesting things: support for OpenTelemetry, gRPC, managed transactions, as well as official guidelines for using DI libraries.
Jmix 2.2 version has been released. Haulmont has released a new version of Jmix, a platform for rapid development of B2B web applications in Java. The main innovation: Jmix Studio is free for small projects.
Spring Modulith 1.2 M3 released. The release of Spring Modulith 1.2 M3 brought support for open modules, and also added the ability to use package configuration level annotations for Kotlin.
Gradle 8.7 Released came out and brought with it support for Java 22.
Interesting videos
Performance oriented Spring Data JPA & Hibernate by Maciej Walkowiak. The performance issue of our favorite JPA & Hibernate is touched upon. There was also N+1, and they also talked about connection management, transactions, optimization and analysis tools, and more.
Joker 2023. The JPoint 2024 conference will be held in a few weeks, but in the meantime JUG.RU published recordings of reports from Jocker 2023. This is what we are watching 🙂
Useful articles
MethodHandle primer. There is an overview of the API located in the java.lang.invoke package. The most commonly used features of reflection and code generation are discussed. The article provides a good entry point into understanding reflection in order to further dive into the topic on your own.
Setting up ExecutorService in practice. Learn in detail about what ExecutorServices are in Java, why they are needed, how to configure them, and what pitfalls await you when using them. We advise all novice developers to read it, but there are also interesting points for old-timers.
What’s new with Testcontainers in Spring Boot 3.2.0. Spring Boot 3.2.0 added several new convenient integrations with Test Containers. First, ServiceConnection can now work with Oracle Database Free, OpenTelemetry Collector, Apache ActiveMQ Classic and Apache Pulsar containers. Secondly, we added a special property spring.testcontainers.beans.startup, which allows you to specify how to start containers: sequentially or in parallel. So if your tests run on multiple containers that are independent of each other, you can get a nice boost in test execution speed.
Building Spring Boot’s ServiceConnection for Testcontainers WireMock. The tutorial explains in detail how you can write tests using the WireMock test container to emulate an external service like GitHub. You will also learn how to write a custom ServiceConnection for a simplified configuration of working with a container.
Builders, Withers, and Records: Java’s path to immutability. A note on how and why to declare and work with immutable objects in Java. Both Builder and Wither, as well as record, which appeared with the 16th version of Java, are considered. On my own behalf, I would like to add that you should never forget that the state of an object can be changed using not only a setter, but also a getter, if it returns, for example, a mutable collection. This also needs to be monitored.
The “Spring Way” of Doing Things: 9 Ways to Improve Your Spring Boot Skills. The article contains many good practices and useful tips for working effectively with Spring Boot. Configuration, monitoring, testing, exception handling, and so on are affected. If you are starting to learn Spring Boot, you will find a lot of interesting things for yourself.
Inner world: Java NIO. A summary of the basic concepts and device java.nio, used to provide non-blocking input or output and which appeared in distant Java 1.4
Spring Framework – Internals of RestClient. A short article about RestClient in Spring Boot 3.2. Its advantages over RestTemplate and WebClient are explained, and its configuration is discussed.
When Database Integration Beats Microservices. The author offers several architecture options, considering in detail the microservice architecture and the integration approach through the database. Along the way, he examines the reasons why integration through a database is an anti-pattern, and offers a solution to the problems of this approach.
Just interesting
20 years since the release of Spring 1.0.
On March 24, 2004, version 1.0 of everyone’s favorite Spring was released – let’s remember its functionality on spring.io.
Analyzing JVM Energy Consumption for JDK 21: An Empirical Study. Large article about the energy consumption of various JVMs from the 21st version of Java. The article examines which JVMs are the most productive and energy efficient. In short: save nature – use Oracle GraalVM Native Image.
Thanks for reading! We are waiting for feedback in the comments. See you in a month 😉
Send materialsif we come across something interesting, we’ll publish it in the next issue!
Acknowledgement and Usage Notice
The editorial team at TechBurst Magazine acknowledges the invaluable contribution of Максимов Константин the author of the original article that forms the foundation of our publication. We sincerely appreciate the author’s work. All images in this publication are sourced directly from the original article, where a reference to the author’s profile is provided as well. This publication respects the author’s rights and enhances the visibility of their original work. If there are any concerns or the author wishes to discuss this matter further, we welcome an open dialogue to address potential issues and find an amicable resolution. Feel free to contact us through the ‘Contact Us’ section; the link is available in the website footer.