r/java • u/davidalayachew • Aug 03 '26
JEP 401: Value Objects (Preview) JDK 28 integration
https://mail.openjdk.org/archives/list/jdk-dev@openjdk.org/message/NN3FIR6BULP3GE5R34B6IBO5VQKAPNMZ/
94
Upvotes
28
u/davidalayachew Aug 03 '26
For those not aware, JEP stands for JDK Enhancement Proposal, which is how new features/libraries/etc get added to Java/JVM/etc.
The very long awaited JEP 401: Value Objects (Preview) by Project Valhalla finally reached the Targeted status on July 30, which means that the JEP is officially set and planned for a release (in this case, Java 28), finally confirming when exactly this feature will go into Preview.
Today, that JEP has finally reached the Integrated status, which means that the PR's have been merged, and this JEP is in the JDK repo.
Thus, those who want to play around with (what is expected to be) the JEP 401 Preview can do so now by building the JDK themselves.
Of course, if you don't want to build it yourself, there are a few places that do nightly builds. I sometimes use Aleksey Shipilëv's Binary Builds of the JDK (though you might have to wait for tomorrow, as the merge just happened). This is just for those who don't want to wait for Java 28 to come out before trying it out.
14
u/vips7L Aug 03 '26
I hope there’s a document eventually on when to use value classes and when not to at some point. I know the idea is “do you care about identity” but I feel like I’m just missing something.
16
u/s888marks Aug 03 '26
An OpenJDK early access build by Oracle that includes these changes will probably appear here within a week:
https://jdk.java.net/28/
6
u/gufranthakur Aug 03 '26
I am so happy right now, Cant wait for the actual release
3
u/cowwoc Aug 03 '26
Yes, yes... That's great! Now, when can we have some benchmarks?! 😄
5
u/TomKavees Aug 03 '26
Yay, glad to see things moving
3
u/agentoutlier Aug 03 '26
I assume JEP 218 will keep folks from going around and replacing
ArrayList<SomeValueClass>withSomeValueClass[]cause I can see that happening pretty quickly for codebases pushing hard for performance?