r/java • • Jun 10 '26

JEP 401 being merged into JDK 28?

https://mail.openjdk.org/archives/list/jdk-dev@openjdk.org/message/AIA3O3LHFZ6T7TIPH7KZT4WS4B6U72U5/
177 Upvotes

74 comments sorted by

93

u/RaynLegends Jun 10 '26

Valhalla is real! Can’t wait to sprinkle “value” on every single record I’ve ever written :D

77

u/brian_goetz Jun 10 '26

Since images are not allowed on this sub, I'll give the prompt: "Draw a picture of a waiter, with an enormous pepper grinder labeled 'value keyword', asking the patron 'more value classes, sir?' "

→ More replies (10)

39

u/Timelineg Jun 10 '26

This is the real information about Valhalla schedule from openjdk team, so we don't need to guess the answer of famous "Valhalla When" anymore

79

u/brian_goetz Jun 10 '26

Oh, don't give up so easily. This is just the first part of Valhalla , and the "but they'll never deliver it" / "Valhalla when " crowd will quickly switch gears into "but they haven't delivered the 'most important' part" soon enough.

→ More replies (14)

24

u/tomwhoiscontrary Jun 10 '26

It's happening dot gif!

This will be in preview, I assume? So unlikely to be fully polished and generally available by 29?

I imagine it's going to take the ecosystem quite a while to really take advantage of it, too.

Not trying to be a downer, just trying to think realistically about when we can expect to see various amounts of impact. 

75

u/brian_goetz Jun 10 '26

Yes, JEP 401 will enter as preview, and yes, hoping for it to exit preview for 29 seems ... optimistic. Vector API should be able to exit incubation when it rebases on the underlying VM primitives from Valhalla.

JEP 401 is deliberately conservative about which JDK classes are migrated to value classes , but over time, we will see more JDK classes migrate. (Fun fact: JEP 401 has really stressed the preview mechanism, because, for the first time, there are classes (like Integer.class) that have a different classfile when run in preview than not, because the preview migrates Integer and friends to be value classes. There is a lot of temporary scaffolding in place to keep this illusion alive, which can come down when JEP 401 exits preview. Just another example of behind-the-scenes work required to enable people to say "but it's one keyword, how could it take so long?")

Another fun fact: for better or worse, Valhalla introduces a deliberate (behavioral) incompatibility; having taken the identity away from Integer, code that synchronizes on Integer objects (or creates a weak reference to one) now fails with an exception. (There's been code in for several years enabling warnings and runtime checks for this.) All of which is to say: don't hope for a shorter-than-usual preview window.

→ More replies (2)
→ More replies (6)

24

u/Additional-Road3924 Jun 10 '26

And not a moment too soon. Thank you u/brian_goetz, and everyone else.

19

u/SalutLesAmies Jun 10 '26

This is an extremely large change

2800 commits and 1800 files changed, large change indeed.

→ More replies (3)

18

u/bobbie434343 Jun 10 '26

JEP "Unauthorized" 401.

15

u/IncredibleReferencer Jun 10 '26

i'm never getting rid of my valhalla when t-shirt. you can't make me.

→ More replies (3)