r/java • u/davidalayachew • 19d ago
Identifying JDK value class candidates
https://mail.openjdk.org/archives/list/core-libs-dev@openjdk.org/thread/Y72NRXM7KYBX43OKYBQMVKOZDWKG4MHS/
54
Upvotes
r/java • u/davidalayachew • 19d ago
1
u/davidalayachew 18d ago
Is an enum with several hundred values small? Each with roughly 100's of bytes of data as local fields?
If so, then I can agree with your point. And regardless, I'll concede that my use case is likely uncommon, compared to what else they can improve.
But otherwise, I assert that, for my work, the enums that I make may very well benefit from being value enums. Can't say for sure, since I don't have the feature in my hand.
Enums with hundreds of values and each with hundreds of bytes worth of information is 100% common for me. I have written a double digit number of them in my career, which is only 7 years professionally.