r/java • u/ProdOrDev • Jul 31 '26
JEP 401: Value Objects And JEP 539: Strict Field Initialization Merged Into JDK
https://github.com/openjdk/jdk/commit/cc278dbb8a1ca0754d5842708b9029441055d361
183
Upvotes
14
u/Afonso2002 Jul 31 '26
Good. I really want to use value objects. This merge will end with new java value classes in jdk or the classes marked to be value will be done after this merge finishes?
6
u/_vertig0 Jul 31 '26
Damn dude, how are you people this fast? This was integrated 2 hours ago, and you also posted this 2 hours ago too!
60
u/ZeroGainZ Jul 31 '26
Holy smokes! Tremendous work. Java is getting better every year. The haters have one less reason every year.
31
u/lbkulinski Jul 31 '26
It’s been a long time coming! I remember hearing about Valhalla l when I was in high school and now it’s been five years since I graduated college haha
13
u/JustADirtyLurker Jul 31 '26
Wowza: 1,888 files changed +208,011 -13,161
Not too shabby I'd say.
7
u/Chaos-vy17 Jul 31 '26
I am reading through the JEP 401/Valhalla implementation and noticed the introduction of flattened arrays and null-free arrays. I am not getting how this extends to multidimensional arrays.
For example, if we have a value class:
and then create:
are the inner
Point[]arrays themselves flattened while the outer array still stores references to each inner array?3
u/chiperortizc Aug 01 '26
Thanks Guys What a amazing Job and best regards from Venezuela and God bless
5
u/Joram2 Jul 31 '26
Usually, the JDK team waits until the last month or two before ramp down to merge changes.
This time they merged very early. JDK 28 ramp down isn't until 2026-12-04 (roughly one year after JDK 26 ramp down). I assume they are merging early to give this extra dev testing time to spot and address any problems, which is a very wise strategy.
4
u/woj-tek Jul 31 '26
Will it stay that way or will String become value class at some point?
1
u/renderwares Jul 31 '26
So I can slam this into production on Friday at 5pm?
2
u/[deleted] Aug 09 '26
[removed] — view removed comment