Live data from Hacker News

JEP 401: Value Objects (Preview) merged to OpenJDK master

github.com

1–10 of 185 posts

Re: JEP 401: Value Objects (Preview) merged to OpenJDK master

#8

If I understand this correctly then Integer becomes a value class and every instance of it loses its object identity. I do not have a lot of knowledge about the details but from the outset it seems like a rather bold move to me.

Java has a mechanism for Integer and Long objects caching using something that already looks like value object, cached objects can be compared using ==. hashCode of Integer already returns int, the boxed int value. Not much of value is lost.
Post reply on HN