IntelliJ IDEA
IntelliJ IDEA – the Leading Java and Kotlin IDE, by JetBrains
Java Annotated Monthly – April 2024
Welcome to this month’s Java Annotated Monthly, where we’ll cover the most prominent updates, news, and releases in March. This edition is truly special because it introduces a new section – Featured content, where we invite influential people from the industry to share a personal selection of interesting articles or videos.
Our first guest, Neha Sardana, boasts over 15 years of experience in Java development. She’s a VP at Morgan Stanley and leads several Java User Groups, including Garden State JUG and NYJavaSig. Neha has a decade of experience in finance in Europe and the US, loves technology, and is keen on open-source projects.
Let’s begin!
Featured content
I would like to extend my deepest gratitude to JetBrains, especially to Helen Scott, Rachel Appel, and Marit van Dijk, for the invaluable opportunity to share my insights and enthusiasm for Java through this newsletter. Having dedicated over 15 years to the Java language, I can assert that it continually unveils a universe of expanding possibilities. In this edition, I am thrilled to discuss the latest advancements in Java as of this month.
Java 22 has been officially released as the non-LTS (long-term support) version by Oracle. Launched in March 2024, it introduces enhancements in three distinct categories of JEPs (JDK Enhancement Proposals):
- Language and Tooling
- 463: Implicitly Declared Classes and Instance Main Methods (Second Preview) → Project Amber
- 447: Statements before super(…) (Preview) → Project Amber
- 456: Unnamed Variables & Patterns → Project Amber
- 459: String Templates (Second Preview) → Project Amber
- 458: Launch Multi-File Source-Code Programs
- 461: Stream Gatherers (Preview)
- Performance and Runtime
- Libraries
- 454: Foreign Function & Memory API → Project Panama
- 460: Vector API (Seventh Incubator) → Project Panama
- 457: Class-File API (Preview)
- 462: Structured Concurrency (Second Preview) → Project Loom
- 464: Scoped Values (Second Preview) → Project Loom
These updates stand out for their significant contributions to enhancing developer productivity daily. For those interested in tracing the evolution from Java 12 to Java 22, I encourage you to explore the detailed analysis I published on my blog: Exploring Project Amber’s Key Enhancements from Java 12 to Java 22. Additionally, Mala Gupta has elucidated many new features of Java 22 in her post on the IntelliJ IDEA blog, which can be found here.
Summarizing the impact of Project Amber, Loom, and Panama:
- Project Amber continues to refine the Java language, enhancing its syntax and reducing boilerplate, thereby making Java more expressive and easier to work with. The focus on improving language features, as evidenced by the enhancements in Java 22, significantly bolsters developer efficiency and code readability. More information on Project Amber is available on the official OpenJDK website: OpenJDK Project Amber.
- Project Loom introduces a revolutionary approach to concurrency in Java. By adding lightweight threads or fibers, Project Loom aims to simplify concurrent programming, making it more scalable and easier to manage, thereby addressing one of the longstanding challenges in Java development.
- Project Panama seeks to bridge the gap between Java and native code, facilitating easier and more efficient calls to and from native libraries. This project aims to enhance the overall performance of Java applications, making it a pivotal advancement for developers working with native libraries.
Exploring these projects offers a glimpse into the future of Java, highlighting the language’s ongoing evolution and its commitment to improving developer productivity and application performance. For a deeper dive into Project Loom and Project Panama and to understand their significance, I recommend visiting Oracle’s blog on Java 22.
While Java 22 is not an LTS version from Oracle, it is important to learn about the new features and especially try out the preview features to become more accustomed to them if you are planning to adopt them in future LTS versions.
Finally, I am thrilled that it was announced at the Java 22 Launch Party that JavaOne is making a comeback in March 2025! For updates and more information, please visit JavaOne.
Java News
Java News Roundup 1, 2, 3, 4 – Catch every update in the world of Java.
Here’s our selection of the most prominent Java 22 announcements for you:
- JDK 22 Release Notes Review – Inside Java Newscast #65 by Billy Korando
- The Arrival of Java 22! By Sharat Chander
- JDK 22 in Two Minutes! – Sip of Java by Billy Korando
- Pruning dead exception handlers by Jorn Vernee
- Java 22 and IntelliJ IDEA
- Java 22 Is Here, And It’s Ready To Rock by Hanno Embregts
- Java 22: What’s New? by Loic Mathieu
- Foojay Podcast #45: Welcome to Java 22 with Frank Delporte, Loic Mathieu, Simon Ritter
- Welcome, GraalVM for JDK 22! by Alina Yurenko
- JDK 22 Security Enhancements by Sean Mullan
Java Tutorials and Tips
Check out the Java-unconfusing series, where Nataliia Dziubenko explores Java topics that appear simple but can lead to surprising outcomes. It’s useful to learn about these cases and understand how they work:
- I won’t let Java confuse you #1: String concatenation operator +
- I won’t let Java confuse you #2: expressions
Java 17 to 21: A Showcase of JDK Security Enhancements – This session provides a full guide on how JDK’s security has improved since JDK17. You’ll learn about the latest in encryption, updates to the APIs, how to set up JDK security, and how Java Flight Recorder can help.
Modern Java in Action – Nicolai Parlog demonstrates how he is writing a GitHub Crawler and how the Java 21 features help him with this task.
IntelliJ Tips & Tricks, Voxxed Days Zurich – This session dives into IntelliJ IDEA’s hidden gems, showing you how to boost productivity with features like shortcuts, fast navigation, code completion, live templates, and more, including the debugger and AI assistant. Discover how to make the most of your IDE and streamline your coding process.
Increase readability and reduce complexity with Java’s Pattern Matching – Jonathan Vila shows different ways of checking the type of an object and keeping the code easy to understand while also reducing the chances of introducing hard-to-spot bugs.
Builders, Withers, and Records: Java’s path to immutability – Immutable objects are simpler to use, safer, and great for multi-threading. This article explains how to create such objects in Java using Builders and Withers, and also introduces Records.
(Dirty?) Tricks in Java 22 – Inside Java Newscast #64 – Nikolay Parlog shows pattern matching with Optional, how to expand a sealed type hierarchy, when nested switches are useful, and the pros and cons of a reverse instanceof check.
Tips for reading code – Marit van Dijk shares some valuable advice on reading code inside the IDE.
JEP 457 Hello World Translator – This article shows how to use the JEP 457 Java Class-File API to write a simple program that changes “Hello World” to a different language, like “Hallo Wereld”, with just a few lines of code.
Kotlin Corner
The Ktor Roadmap for 2024 – Find out what new features and improvements are planned for 2024.
Kotlin Roundup: Unveiling the New Compose Multiplatform Release, Amper Update, and More! – In this roundup, you can explore the highlights of the latest developments in the Kotlin ecosystem.
Building a macOS screen saver in Kotlin – This article describes Márton Braun’s journey in designing a custom macOS screensaver, primarily using Kotlin and the powers of Kotlin Multiplatform to target macOS.
Handling Runtime Exceptions – Learn to handle different types of exceptions in Kotlin.
Seven recipes to understand flows and asynchrony in Kotlin – This article explores asynchrony and focuses on flows, explaining their purpose, the difference between hot and cold flows, and how to convert callbacks into suspend functions and flows.
AI Assistant vs Property-based Tests – Check out how Duncan McGregor tried using AI to create tests, but it wasn’t perfect. So, he mixed it with jqwik for property-based testing. This combo made testing easier and more reliable while also reducing his workload.
Type Projections… and why they work! – Dave Leeds invites you to the world of Kotlin’s type projections! This video shows how you can use type projections to get generic subtyping – even for types that are in library code. In less than nine minutes, you’ll learn both how you can use them and why they work.
Variance… without Generics! – Did you know you can apply the concepts of covariance and contravariance in Kotlin even outside of generics? Read this video to learn more about this.
A full Kotlin Tutorial by Rock The JVM – Kotlin at Light Speed – Have a look at a jam-packed mini-course that will give you a solid grounding in the Kotlin programming language.
Generics – The article explains Kotlin generics in a practical way, using a bakery café as an example.
Testing Mastery: Fast and Secure Application Tests – The article offers tips on how to do application tests quickly and safely, with Kotlin-based examples.
Languages, Frameworks, Libraries, and Technologies
This Week in Spring 1, 2, 3, 4 – Get to know all the latest from the world of Spring over the past month.
The State of Spring Survey Is Back! – We welcome your feedback!
Spring: Internals of RestClient – This article explains how Spring’s RestClient works, focusing on its structure and how it helps in building RESTful services.
Spring Releases for February 2024 – Here is the list of all the Spring projects that have been released this February.
Securing your Spring Apps with OAuth 2.0 – Part 1 – The article explains how to protect Spring applications with OAuth 2.0, using Keycloak for managing user logins and securing apps with tokens.
The “Spring Way” of Doing Things: 9 Ways to Improve Your Spring Boot Skills – Lee Sheinberg shares some practical tips, best practices, and resources for a deeper understanding of Spring Boot.
Writing integration tests with Testcontainers and Cosmos DB Docker emulator for Spring Boot applications – This blog post guides you through the process of creating integration tests for Spring Boot applications using Testcontainers and the Cosmos DB Docker emulator. It covers how to use dynamic ports instead of fixed ones and how to add the Cosmos DB emulator’s certificate to a temporal Java TrustStore that your tests can use.
Hello eBPF: First steps with libbpf (5) – Johannes Bechberger explains the advantages of switching from libbcc to the more recent libbpf.
OpenRewrite plugin on IntelliJ – IntelliJ IDEA now supports OpenRewrite. See how it works in this video.
Visualizing Eclipse Collections after Twenty Years of Development – In this article, Donald Raab looks back at Eclipse Collections’ 20-year history, using visuals to show how the framework has developed to become instrumental in Java programming.
Presentation: JavaScript: Empowered by Rust – Chris Biscardi explores what Rust is being used for on the frontend and introduces the language from the perspective of a JavaScript developer.
Localize applications with AI – Igor Kulakov takes us through the entire localization process with the help of AI tools using Spring Petclinic as a case study.
Testing Machine Learning: Insight and Experience from Using Simulators to Test Trained Functionality – Explaining decisions made by AI models, especially those trained on complex data, can be challenging due to their intricate internal structures. So, how do you test them? Get some insights from this article.
The Hidden Cost of Using Managed Databases – The article explains the hidden costs of using managed database services, highlighting that users should be aware of extra charges like data transfer fees.
Microservices Design Principles for Well-Crafted Architecture – This article focuses on the fundamentals of microservice architecture and Object-Oriented Programming, specifically addressing how services interact (coupling) and how they’re organized (cohesion).
PostgreSQL Index Types – In this article, Vlad Mihalcea explores the different types of indexes in PostgreSQL and guides you through the process of selecting the most suitable index type for various scenarios.
Understanding Platforms: What They Are, Why They Work, When to Use Them, How to Build Them – Hazel Weakly discusses platforms and platform engineering. She explains what it means to learn, and how collective thought scales across teams, organizations, and industries.
Debugging Streams With Peek – Read this article by Shai Almog to learn how to debug Java streams effectively using the peek()method with practical examples and tips for optimizing your code.
Bending pause times to your will with Generational ZGC – This article describes Netflix’s use of the Generational Z Garbage Collector to make Java applications run better with minimal interruptions.
Podcast: The State of Agile in 2024 – Is Agile still valid in 2024? Find out together with Joyce Tompsett and Shane Hastie.
Implement RAG Using Weaviate, LangChain4j, and LocalAI – In this blog, you will learn how to implement Retrieval Augmented Generation (RAG) using Weaviate, LangChain4j, and LocalAI. This implementation allows you to ask questions about your documents using natural language.
Conferences and Events
Java Day Bengaluru – Bangalore, India, April 3
JDevSummit IL – Tel Aviv, Israel, April 4
Qcon London – London, United Kingdom, April 8–10
JavaLand – Nürburgring, Germany, April 9–11
DevNexus – Atlanta, USA, April 9–11. Come visit the IntelliJ IDEA booth!
Devoxx France – Paris, France, April 17–19
Devoxx Greece – Athens, Greece, April 18–20
Java 22 and IntelliJ IDEA – Online, April 24
JAX Hybrid – Mainz, Germany, April 22–26
Great International Developers Conference – Bangalore, India, April 23–26
Spring Security – Zurich, Switzerland, April 25
Culture and Community
Measuring Developer Productivity via Humans – In this article, Abi Noda and Tim Cochran introduce a promising approach of qualitative metrics that draw insights directly from developers’ experiences. This human-centered data gives a more comprehensive view of productivity, suggesting that organizations should focus on human insights over system-generated data.
Presentation: You Can Go Your Own Way: Navigating Your Own Career Path – Erin Schnabel shares what she learned in the course of her journey towards becoming a distinguished engineer, sharing insights and ideas that can be used to find and shape opportunities and create a career.
Staff+ Engineering Beyond Big Techs: How to Succeed in the Technical Path on Non-Tech Companies – Loiane Groner talks about why companies not focused on tech should hire skilled tech people.
Fostering an Experimentation Culture in Software Development – Find out what experimentation culture is and why it can be beneficial in software development.
Making Code Explain Itself – Observability Through AI – In this episode, Shane Hastie speaks with Dr. Elizabeth Lawler, CEO of AppMap, about the role of observability in today’s AI-driven environment, the creative aspects of coding, and the common challenges that developers face daily.
And Finally…
Drop the Baggage: Use ‘_’ for Unnamed Local Variables and Patterns in Java 22 – Mala Gupta studies the Unnamed Variables & Patterns feature that allows you to skip over unused local variables and patterns by replacing their names or types with an underscore (_).
Easy Hacks: How to Throw Java Exceptions – Catching exceptions is crucial, but knowing how to throw them properly is just as vital. In his blog post, Maarten Balliauw demonstrates how to throw Java exceptions, details their various types, and explains how to make custom exceptions, among other things.
Getting Started with Databases in IntelliJ IDEA – Have you ever wondered how IntelliJ IDEA handles databases? Well, today is the perfect opportunity to find out in our database tutorial on initial setups and first steps.
K2 Kotlin Mode (Alpha) in IntelliJ IDEA – Starting from v.2024.1, IntelliJ IDEA comes with an optional K2 mode. In this mode, the IDE uses the K2 compiler for faster and more robust Kotlin code analysis. Read this article to learn the details.
Build a Spring Boot app with AI Assistant – Together with Marit van Dijk, find out how JetBrains’ AI Assistant helps in creating a Spring Boot app.
That wraps up today’s edition!
We’re already gathering ideas for the next Java Annotated Monthly, so feel free to share your suggestions via email or tweet by April 20. Also, don’t forget to explore our archive of past JAM issues, which is perfect for catching up on any missed blog posts or articles.