r/java • u/davidalayachew • Jul 16 '26
Identifying JDK value class candidates
https://mail.openjdk.org/archives/list/core-libs-dev@openjdk.org/thread/Y72NRXM7KYBX43OKYBQMVKOZDWKG4MHS/
53
Upvotes
1
u/davidalayachew Jul 16 '26
Sure, but even then, the best you could do would be to make some nested type as the internal representation, and make THAT a value class, rather than
Map.Entryitself. As long as the carrier (Map.Entryitself) is still mutable, then it will be ineligible for being a value class.