Java's most significant language update in ten years is about to be implemented. This change required 197,000 lines of code.

Java's most significant language update in ten years is about to be implemented. This change required 197,000 lines of code.

      **TL;DR** Value classes from Project Valhalla are set to be included in JDK 28, marking a 197,000-line alteration that changes how Java manages object identity. Oracle engineer Lois Foltan has confirmed that Java Enhancement Proposal 401, which introduces value classes and objects, will be incorporated into the OpenJDK mainline early next month with a target of JDK 28. This change, part of Project Valhalla, aims to resolve one of Java's longstanding performance issues. The pull request includes over 197,000 lines of code across 1,816 modified files, according to The Register.

      Foltan labeled this as an “extremely large change” on the OpenJDK mailing list and requested other committers to refrain from adding large commits during the integration period. The current Java Development Kit is version 26, with JDK 27 projected for September 2026 and JDK 28 in March 2027. JEP 401 will be a preview feature, allowing developers to opt in without it being enabled by default.

      JEP 401 tackles a fundamental issue in Java. Apart from a few primitives like int, char, and double, all types in Java are reference types. This means every object has a distinct identity in memory, even if two objects contain the same data. For instance, when comparing two instances of the LocalDate class representing the same date with the == operator, it returns false because they are different objects in memory.

      The Integer wrapper class complicates this further, as Java caches Integer instances for values below 128, allowing for equality comparison with == for those small values, while larger values always return false even if they match.

      JEP 401 calls this behavior “unwanted complexity,” and Java editors generally advise against using == with Integer. Value classes aim to resolve this issue by creating objects without identity, distinguished solely by their field values, allowing the JVM to store them in more memory-efficient ways and enhancing cache locality. Iterating over value types also becomes more efficient, as the runtime doesn't need to dereference pointers to access the actual data.

      JEP 401 will transition some existing JDK classes, including Integer, to value classes, with more classes likely to follow in future releases. Developers will also have the ability to define their own value classes for data types like coordinates, currency values, or timestamps.

      Project Valhalla has been in development since 2014, making it one of the most extended initiatives in Java's history. The challenge of modifying how object identity operates at the JVM level while ensuring backward compatibility with vast amounts of existing Java code explains the lengthy timeline. Some have humorously noted that reaching Valhalla, a mythological afterlife, might come before the project's completion.

      Brian Goetz, Oracle's Java Language Architect, cautioned on Reddit that JEP 401 is “just the first part of Valhalla.” He stated that while removing object identity is the initial step that allows for optimizations, fully adopting value semantics entails relinquishing more, including nullability and what he termed “atomicity-safety-under-race.” He drew parallels with C# structs, highlighting that similar developments are happening in other languages.

      Goetz also noted that Valhalla will introduce intentional breaking changes. For example, code synchronizing on Integer objects will raise an exception when Integer becomes a value class. He suggested that JEP 401 might still be in preview for the next long-term support release, JDK 29, anticipated for September 2027. "Hoping for it to exit preview for 29 seems … optimistic," he commented.

      This development comes as Oracle undergoes significant restructuring, potentially cutting up to 30,000 employees to support its shift towards AI infrastructure. However, the Java platform team appears largely unaffected by these cuts, and Project Valhalla signifies a deep language initiative that cannot be expedited merely by increasing the engineering workforce. From 2021 to 2023, Java gained over eight million new developers, and its importance in cloud computing and enterprise systems means that any fundamental performance enhancements will have widespread implications.

      For the millions of Java developers who have awaited value types for twelve years, the preview in JDK 28 is a significant milestone. For the remainder of Valhalla, Goetz's advice is clear: do not hold your breath.

Other articles

YouTube's AI content cleanup is penalizing the human creators who chose not to show their faces. YouTube's AI content cleanup is penalizing the human creators who chose not to show their faces. YouTube has shut down 16 channels that accumulated 4.7 billion views and is experimenting with viewer surveys to identify low-quality AI content. However, creators without a visible presence argue that this action unfairly affects them as well. After twenty years of independence, Roku is being acquired for $22 billion by this company. After twenty years of independence, Roku is being acquired for $22 billion by this company. Fox is acquiring Roku in a monumental $22 billion agreement that has the potential to transform the streaming industry, aligning one of the largest content libraries in television with a platform that reaches over 100 million homes globally. A network of X accounts is promoting AI nudify tools, causing significant distress for the victims. A network of X accounts is promoting AI nudify tools, causing significant distress for the victims. Researchers indicate that coordinated X accounts are assisting AI nudify applications in expanding their user base, as platforms such as Undress AI introduce paid video features and referral incentives, while those affected grapple with mitigating the impact. Polymarket's $345 million wager on peace in Iran is at a standstill due to disagreements among parties. Polymarket's $345 million wager on peace in Iran is at a standstill due to disagreements among parties. Polymarket's $345 million market for the Iran peace deal is under contention, as an interim agreement might not fulfill the contract's stipulation for "permanent" peace. LinkedIn connection results in World Cup debut for Cape Verde. LinkedIn connection results in World Cup debut for Cape Verde. Roberto Lopes, a defender for Shamrock Rovers and originally from Dublin, was recruited for the Cape Verde national team through LinkedIn. He is now competing against Spain at the 2026 World Cup. This new Mac application holds your screen captive until you consume water. This new Mac application holds your screen captive until you consume water. Hydration Hostage locks your Mac screen at predetermined times and only unlocks when the on-device camera verifies that you've consumed water.

Java's most significant language update in ten years is about to be implemented. This change required 197,000 lines of code.

Project Valhalla's JEP 401 will introduce value classes to JDK 28, eliminating object identity from Java types through a 197,000-line modification that has taken twelve years to develop.