JavaJava
Conference50min
ADVANCED

Finally, final means final - A deep dive into field immutability in Java

This talk explores Java's 'final' keyword, its limitations in ensuring immutability, and how JVM assumptions can impact performance. It covers recent enhancements to 'final', the roadmap for stronger immutability, and introduces the "Stable Value" preview feature, which combines mutable flexibility with the performance benefits of 'final' fields.

Per Minborg
Per MinborgOracle

talkDetail.whenAndWhere

talks.scheduleTBD
Room 5
talks.roomOccupancytalks.noOccupancyInfo
talks.description
Java's main tool for expressing immutability is the keyword 'final'. But did you know that the current JVM must assume some 'final' fields will change, and why this will slow down your application?

In this talk, we will take a deep dive into the semantics and practical implications of field immutability in Java – from compile-time guarantees to JVM behavior. We will take a closer look at how the current JVM treats final fields and how you can leverage this to create faster code already today. We will also explore some of the recent efforts to enhance the strength of the 'final' keyword over time and what the roadmap for this will look like. At the end, we will see how Java's new preview feature "Stable Value" can offer the flexibility of mutable fields while still retaining the performance of 'final' fields, and where this is important.
immutability
jvm
final
performance
talks.speakers
Per Minborg

Per Minborg

Oracle

Sweden

Per Minborg works in the Java Core Library team at Oracle and is also a member of the Panama project team. He is an inventor and developer with more than 20 years of Java coding experience. He has been a frequent contributor to various open-source projects, is a regular speaker at events, Oracle JavaOne alumnus, and co-author of the publication Modern Java.

talkDetail.rateThisTalk

talkDetail.poortalkDetail.excellent

talkDetail.ratingNotYetAvailable

talkDetail.ratingAvailableWhenStarted

talkDetail.signInRequired

talkDetail.signInToRateDescription