RFR : JDK-8001642 : Add Optional<T>, OptionalDouble, OptionalInt, OptionalLong
Tim Peierls
tim at peierls.net
Fri Apr 26 04:45:37 PDT 2013
On Fri, Apr 26, 2013 at 5:22 AM, Remi Forax <forax at univ-mlv.fr> wrote:
> On 03/28/2013 07:23 PM, Kevin Bourrillion wrote:
>
>> I do NOT wish to restart this discussion; I just noticed a falsehood that
>> was never exposed: Guava's Optional /cannot/ be used to hold null. So this
>> particular concern is not a concern at all.
>
>
> What I should have written is that Guava unlike the JDK allows to create
> an Optional from null,
> the fact that it stores null or not is an implementation detail.
>
Kevin's point was that there's no need to worry about confusion over this
particular difference. The method used in Guava to create an Optional from
a reference that might be null has a name that makes this very clear:
Optional.fromNullable. Both Guava and JDK have null-rejecting Optional.of()
methods.
--tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/lambda-libs-spec-experts/attachments/20130426/16114902/attachment.html
More information about the lambda-libs-spec-experts
mailing list