Java Kotlin Tutorials

Java Annotated Monthly – May 2024

Welcome to the latest edition of Java Annotated Monthly! This time around, we’re thrilled to have Holly Cummins on board for our featured content section.

As usual, we’ve gathered a bunch of fresh updates, insights, and interesting discussions from across the tech scene in April.

So, grab your favorite beverage, settle in, and let’s explore the latest developments in the world of Java and beyond!

Make sure you never miss our helpful monthly selection: 

Featured content 

We’d like to start by thanking Holly Cummins for curating this month’s featured content!

Holly Cummins

A Senior Principal Software Engineer at Red Hat and Java Champion, Holly is part of the Quarkus team, with a focus on the Quarkus ecosystem. Holly will be presenting at Devoxx UK in May, and Code Europe Kraków and StaffPlus London this June. You can also find her past talks and writing at hollycummins.com.

As an avid JetBrains Community Contributor, I was honoured to be invited to provide featured content for the Java Annotated Monthly newsletter. I started with a blank page with a few scraps of links and ended up with a whole blog post, much too long for a newsletter. Here are the edited highlights of what I’ve found interesting in the Java world recently.

This past month, I’ve been enjoying JetBrains’ new full line code completion feature. There’s a lot to like about it: The feature is included in my existing IntelliJ IDEA Ultimate subscription, runs locally, is privacy-friendly, is integrated into my existing tools, and solves a real problem (typing is boring).

As an industry, we’re starting to get a better understanding of where LLMs are useful and where they aren’t. Molly White, of web3isgoinggreat fame, has just published a fantastic piece called “AI Isn’t Useless”. I also wrote on my blog last month about the big question of whether AI will take developer jobs.

AI is not just for Python people anymore – it’s opening up to Java developers, too! LangChain4j simplifies integrating machine learning into Java applications. Last month, my colleagues released an Easy RAG Quarkus extension, which allows you to set up a LangChain4j retrieval-augmented generation (RAG) pipeline and app with just a single piece of configuration. I chat to some of my Quarkus colleagues about the Quarkus + LangChain4j integration in the latest episode of Quarkus Insights.

Mario Fusco did a talk at Devoxx Greece about how LLMs and symbolic reasoning are complementary. He’s written it up along with several sample applications, including an airline chatbot. I think we’ll be seeing more of this kind of hybrid approach in the future, as our industry gets more mature in how we use LLMs.

Being able to leverage AI from Java is important because Java is getting better and better. One JVM improvement I’m excited about is project Leyden. Leyden isn’t news, but we’re seeing a nice stream of updates and JEPs. Per-Åke Minborg from Oracle gave a nice Leyden update at this year’s Jfokus. Both the slides and video are now available. Leyden is part of a bigger (and exciting!) trend of technologies designed to make Java start faster and run leaner, which also includes GraalVM, CRaC, and Quarkus.

Java News

Java News roundup 1, 2, 3, 4 – Stay updated with the weekly Java news from the past month.

Java 23: Restoring the Balance with Primitive Patterns – Inside Java Newscast #66 – Java 23 will introduce primitive patterns in instanceof and switch, marking the next step in the evolution of pattern matching. This update also covers other upcoming patterns like deconstruction, static, instance, and constant.

Java Withers – Inside Java Newscast #67 – Check out how JEP 468 introduces with expressions, or “withers”, to address verbosity when modeling mutable states with immutable records.

Java Tutorials and Tips

Building a Java application in IntelliJ IDEAMarit van Dijk demonstrates how to create a Java app in IntelliJ IDEA, covering everything from writing your first code snippets to running and testing the finished app, as well as debugging and refactoring.

Mastering Java Concurrency: Dive into Part 1! – In this series, you will study Java concurrency and cover everything from basic to advanced topics. In this article, you’ll start with essential concepts like thread caching issues, basic thread synchronization, and using multiple locks with synchronized code blocks. 

Spring Tips: Hello, Java 22!Josh Long demonstrates how to use Java 22 and Spring. 

Apache Maven 102: Best PracticesBrian Demers covers the basics of Maven and then moves on to the best practices for both Maven single and multi-module projects. He’ll even shows you how to troubleshoot your builds, too. 

My ten-year quest for concise lambda expressions in JavaDonald Raab tells a story about how a dislike for reading and writing for loops became so acute that it led him to create a Smalltalk-inspired open-source collections library (Eclipse Collections) for Java.

Programmer’s Guide to JDK Flight Recorder – This video explains how to start and stop recordings, read recording files, and consume events continuously. It also demonstrates the FlightRecorderMXBean interface and how it can be used to control and transfer recording data over JMX and provides practical tips and guidelines to help you craft your own event.

Records for Cleaner and More Expressive Parameterized Tests in JUnit 5A N M Bazlur Rahman explores how to leverage Java records for parameterized tests through a concrete example – the testing of an expression evaluator.

Foojay Podcast #47: Artificial Intelligence and Machine Learning with Java – Artificial intelligence has become significantly more accessible, transforming how we search for information and develop software. What does the near future hold, and how can we program AI ourselves using Java? Find the answers to these questions and more with Lize Raes, Lutske de Leeuw, and Frank Delporte

What if null was an Object in Java? – This blog by Donald Raab breaks down the differences between null in Java and nil in Smalltalk. Exploring how different languages solve similar problems is insightful, and this quick comparison aims to highlight the pros and cons efficiently.

5 Ways to Improve Your Maven Projects Using Build ScansBrian Demers explores how Build Scans can speed up your builds and improve teamwork by simplifying the sharing of build insights.

Kotlin Corner

Mastering Algorithmic Problem Solving: Insights From Kotlin Heroes – Prepare for technical interviews and sharpen your algorithm skills with the recording of this webinar by Pavel Mavrin and Pavel Kunyavskiy.

The Ktor Plugin Registry Has Launched! – Earlier this month, in the Ktor 2024 product roadmap, we announced the launch of our Ktor Plugin Registry. This registry is now available. It enables the submission of community-based plugins to the Ktor team, categorizes plugins for easy searching, and provides users with essential documentation.

Data Analytics With Kotlin Notebooks, DataFrame, and Kandy – Recently Anton Arhipov and Roman Belov explored the power of data analysis tools. Check out a recording of their livestream, and be sure to get the example from the session so you can try the Kotlin Notebook plugin with the DataFrame and Kandy libraries at your convenience. 

Plotting Financial Data in Kotlin with Kandy – Andrei Kingsley demonstrates a straightforward workflow that covers downloading, analyzing, and visualizing financial data.

K2 Kotlin Mode (Alpha) in IntelliJ IDEA – Big news for Kotlin users! 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.

The K2 Kotlin compiler migration guide is now available! 

RockTheJvm’s Ultimate Guide on Kotlin Flows – This article explores an important concept in Kotlin coroutines: Kotlin flows. Daniel Ciocîrlan breaks down the basics of flows and demonstrates how to use them effectively, manage errors, and much more.

Dave Leeds explains inline functions: inline, crossinline, and noinline – We all know the basics of inlining a function, but in Kotlin, some details affect how you should use lambdas with them. In this video, Dave Leeds takes you through the basics of inline functions and shows you how to get the behavior you desire using crossinline and noinline.

Ktor and Dependency InjectionDuncan McGregor demonstrates how to inject dependencies into a Ktor project to make it testable.

Extending Ktor: Unleash the Full Potential of Kotlin’s Web Framework – In this session, you’ll discover how to make plugins for Ktor, a framework for Kotlin server-side development. You’ll learn how to integrate essential functionalities like Kafka for message-driven architectures, implement advanced rate limiting for traffic control, and enhance system resilience with a sophisticated circuit breaker plugin. 

ICPC World Finals 2023: Kotlin Heroes Blind Coding Challenge – Watch super-talented programmers take on Kotlin puzzles in a special blind coding challenge. Witness their problem-solving skills under pressure and see Kotlin’s power in action. In this format, one participant has only a keyboard, while the other has only a monitor. It’s a unique test of skill and adaptability!

A Step-by-Step Guide to Performing Data Analysis With Kotlin DataFrameGarth Gilmour shares his first article in a series of tutorials on how to easily manipulate and visualize your data using the Kotlin DataFrame and Kandy libraries

Languages, Frameworks, Libraries, and Technologies

This week in Spring 1, 2, 3, 4, 5 – We’ve gathered all the April Spring updates in one place for your convenience! 

Spring Tips: the Spring Expression Language – Check out the demonstration of the Spring Expression Language, an embedded language for resolving simple expressions that is built right into the Spring Framework.

A Bootiful Podcast: Spring founders Rod Johnson and Juergen Hoeller on the 20th Anniversary of Spring Framework 1.0 – 20 amazing years have passed since the framework’s inception. Spring founders Rod Johnson and Juergen Hoeller talk about Spring’s journey since its 1.0 release in 2004.

Great news: Spring Now Offers Free Access to Spring Academy Pro Content

Smarter Logging in Spring Boot with AOPMuaath Bin Ali shares his approach to logging. 

Expressive REST Resources with Java Records and Jakarta RESTLuqman Saeed explains why it’s better to use DTOs than to expose database entities directly.

Debugging Streams with Peek – Check out this article by Shai Almog to learn how to use peek() for debugging Java streams. The blog post comes with code examples and explains common pitfalls.

Debug Without Breakpoints – In this article, Igor Kulakov demonstrates IntelliJ IDEA’s Pause feature, a powerful yet lesser-known tool for debugging. You’ll see its use cases and limitations as well as discover a secret stepping trick.

12 Text Tools For Developers – As developers, you don’t just code in an IDE all day. You need to analyze logs, test web services, generate data, conduct security tests, and more. Here are some free text tools to make your job easier.

How to Detect Cache Misses Using Observability – In this article, Saeed Zarinfam explains cache misses and the caching concept in general, as well as how to implement it in Spring Boot.

PostgreSQL FOR UPDATE vs. FOR NO KEY UPDATEVlad Mihalcea explores the distinction between PostgreSQL’s FOR UPDATE and FOR NO KEY UPDATE when locking a parent record and inserting a child row.

Effective cloud-native Java app development with Open Liberty in IntelliJ IDEAGrace Jansen demonstrates how the Liberty Tools plugin facilitates the swift, seamless, and productive development of cloud-native Java applications using Open Liberty and WebSphere Liberty.

The best way to use the OneToOne optional attribute – In this article, you’ll find out the best way to use the OneToOne optional attribute to avoid N+1 query issues.

Troubleshoot Slow Debuggering – While the Java debugger usually has minimal overhead, it can still cause notable runtime costs in specific situations. In unfortunate cases, it might even freeze the VM entirely. Igor Kulakov examines the reasons behind these issues and their possible solutions.

Conferences and Events

You can attend these events either online or in person:

Devoxx UK – London, United Kingdom, May 8–10

J On the Beach – Malaga, Spain, May 8–10

Java Day Istanbul – Istanbul, Türkiye, May 11

JCON Europe – Cologne, Germany, May 13–16

JAlba – Edinburgh, Scotland, May 15

GeeCON – Kraków, Poland, May 15–17

Voxxed Days Brussels – Brussels, Belgium, May 21–22

Running Uncensored and Open Source LLMs on Your Local Machine – Online, May 23

jPrime – Sofia, Bulgaria, May 28–29

Spring I/O – Barcelona, Spain, May 29–31

JCON OpenBlend Slovenia – Portorož, Slovenia, May 29–31

Culture and Community

A Decade of JDK Updates in OpenJDK – Since Oracle initiated the JDK 7 Updates Project in 2011, the OpenJDK community has seen significant evolution. In this livestream, recorded at FOSDEM 2024, you’ll explore the history of these developments and examine the current process of developing JDK updates.

Can Our Tools Increase Developer Productivity? – In this episode, Trisha Gee discusses the significance of continually learning about your software tools and their features to enhance your productivity as a developer and advance your career as a software engineer.

Presentation: Survival Strategies for the Noisy Neighbor Apocalypse – Discover the surprising connection between a noisy neighbor and the world of software development in this blog post!

The Race to Make Humans Obsolete – Is it possible to be both excited and concerned about AI at the same time? What do you think?

Podcast: Using Cognitive Science to Improve Developer Experience – Is cognitive fatigue a significant issue in software development? Is multitasking effective? Can AI tools reduce cognitive load? Find the answers to these and other questions in this podcast. 

And Finally…

Full Line Code Completion: All You Need to Know – In this blog post, we’ll tell you more about what the full line code completion feature in JetBrains IDEs is, how it works, what languages are supported, and how you can provide feedback about it to us.

Java Frameworks You Must Know in 2024 – Take a look at this list of essential frameworks that every beginner Java developer should explore.

The WireMock Plugin for IntelliJ IDEA Is Here! – In this post, we’ll take a quick look at the new WireMock plugin introduced with IntelliJ IDEA 2024.1. It works in all JetBrains IDEs and provides a built-in mock server. We’ll also explore a few features that should stoke your excitement.

Easy Hacks: How to Handle Exceptions in Java – In this post, Maarten Balliauw shows you how to handle exceptions in Java and demonstrates some techniques for managing expected and unexpected events in your projects.

Videos 

Java 22 and IntelliJ IDEA – In this webinar, Mala Gupta demonstrates how IntelliJ IDEA accelerates the adoption of Java 22 features such as string templates, implicitly declared classes, instance main methods, statements before super(), unnamed variables and patterns, and more.

Learning Git with Anna Skoulikari – Based on her book Learning Git: A Hands-On and Visual Guide to the Basics of Git, this talk by Anna Skoulikari offers a taste of her approach to teaching Git basics using colors, visuals, and storytelling.

We’ve also released several talks from our recent IntelliJ IDEA Conf – here is the dedicated playlist.

That is all for today!

We’re already gathering ideas for the next Java Annotated Monthly, so feel free to share your suggestions via email or X by May 20. Also, don’t forget to explore our archive of past JAM issues, which is perfect for catching up on any blog posts or articles you may have missed.

image description