Clarification on migration to value types and boxed vs unboxed representations

Brian Goetz brian.goetz at oracle.com
Tue Jan 6 03:10:28 UTC 2015


> I suspect that 3rd party library authors are in a more pickley situation
> having not planned this through as clearly. Upside: they are probably
> willing to do backwards incompatible releases where its a very
> corner-case situation. I'm trying to think if I believe this to be worse
> than variables called enum or implementations of List that had `List<T>
> sort(Comparator)`.

Age makes a difference too.  Optional is new, and the disclaimers 
arrived on day 1.  Integer, on the other hand, is probably hopelessly 
polluted, and I am sure that it would break gobs of important code if 
Integer ceased to be lockable (despite what we may think of such a 
practice.)

It may be that Optional remains forever polluted by identity, preventing 
us from migrating it to a value, which would be Really Sad, but not out 
of the realm of possible.  I'm still optimistic (mostly probably because 
I've not thought really hard about it yet.)




More information about the valhalla-dev mailing list