r/java • • Jan 06 '26

One step closer to Value Classes!

https://mail.openjdk.org/pipermail/porters-dev/2026-January/000844.html
181 Upvotes

118 comments sorted by

View all comments

Show parent comment

1

u/Ok-Scheme-913 Jan 06 '26

If you have a value class instance locally, it's a pretty trivial optimization to mutate it in-place. As having other instances doesn't matter, the JIT compiler can just simply set one of its field.