Optional.or name Re: RFR 8080418 Add Optional.or() (original) (raw)

Paul Sandoz paul.sandoz at oracle.com
Mon Oct 12 07:48:13 UTC 2015


On 25 Sep 2015, at 12:58, Paul Sandoz <Paul.Sandoz at oracle.com> wrote:

Hi, Please review this change to add a method Optional.or that allows one to better compose optionals: http://cr.openjdk.java.net/~psandoz/jdk9/JDK-8080418-optional-or/webrev/ I also took the opportunity to clear up the JavaDoc, it was a little inconsistent and i personally found it harder to read in source code.

Now that the overall documentation changes and functional behaviour of Optional.or has been agreed i would like to see if we can find a better name, suggestions welcome, so lets get our paint brushes out :-)

I suggest we avoid commenting on comments, otherwise this thread could get out of control.

“Optional.or” is the best name so far i have come up with. The “orElse” prefix is reversed for terminal methods and i don’t want to overload that.

--

Alternative suggestions:

Paul.



More information about the core-libs-dev mailing list