java.lang.constant.ClassDesc and TypeDescriptor for hidden class??

Brian Goetz brian.goetz at oracle.com
Thu Apr 2 17:29:41 UTC 2020



>> I believe, then, that the right choice is to return an empty 
>> Optional, rather than return null or throw an exception.
>
> I’m fine with that reasoning too.  We are pushing irregularities
> around here, hopefully into the least important corner.

The idea is that consumers of Constable must already be prepared to have 
one of them say "sorry, no ConstantDesc for you", and deal accordingly.  
The use of Optional signals this, and makes this less messy than 
null/exception.  The downside is we lose the information of "why didn't 
it blend?"



More information about the valhalla-dev mailing list