New candidate JEP: 401: Primitive Objects (Preview)

Brian Goetz brian.goetz at oracle.com
Sat Mar 20 02:01:24 UTC 2021



> When reading the proposal I see that in the feature we will get code like:
>
> Optional.val<User> findUser(...)

This is not what we anticipate.  I would expect that for migrated types, 
public interfaces would continue to use Optional (alias for 
Optional.ref); we'd mostly only see Optional.val inside of private 
implementation, where things actually hit the heap.  The primitive 
widening and reference conversions will make up the difference.





More information about the valhalla-dev mailing list