Nulls

Brian Goetz brian.goetz at oracle.com
Mon Sep 24 09:08:09 PDT 2012


>> so Optional should be able to store null.
>
> This is how all these discussions seem to go: Some existing
> or potential abuse of null leads to rules allowing further
> abuse. Every time I lose the straight "null means nothing there"
> argument, I figure that I'm complicit in adding a few million
> dollars to Hoare's billion dollar mistake.

I think we're trying to not encourage further abuse.  There's consensus 
that present Optional should NOT store null.  Similarly, the 
Joe/Tim/Brian cabal is trying to NOT burden the streams 
API/implementation with any special null-awareness, again for the sake 
of not coddling abuse.

> If present Optionals can be null, the world is probably better off
> without them; so methods like findAny ONLY take the valueIfNone form.

I don't see any value to present Optionals being able to take null.




More information about the lambda-libs-spec-experts mailing list