On 09/25/2015 02:30 PM, Paul Sandoz wrote:
>There's also another problem. The orElseGet(null) is documented to
>work to work fine for non-empty optional
>(why on the Earth it was specified this way?).
Arguably it was a mistake that we did not catch in the frenzy of Java 8 feature 
freeze. I would like to revert it but existing code might already be reliant on 
it:-(

Paul.


It would be of no use if it was specified to throw on non-empty Optional. Usually this method is meant to be called on the result of another method returning Optional to compose a fluent call chain.

Regards, Peter

Reply via email to