RFR: 8025909: Lambda Library Spec Updates

Henry Jen henry.jen at oracle.com
Tue Oct 15 22:53:41 PDT 2013


On 10/15/2013 04:05 PM, Mike Duigou wrote:
> Where is the null handling for methods like DoubleStream.allMatch() 
> described? I don't see an @throws NullPointerException if predicate 
> is null. The class level "functional interface parameters to methods,
> unless otherwise specified, may not be null" instruction is removed
> with reference to Stream docs. I hope this is sufficient notice.
> 

The idea is to avoid duplicate documentation(clutering) by consolidate
into reference of Stream and package documentation. It may not be
obvious, but should be enough?

Note that we state "must be non-null unless otherwise specified" but
don't specify what would happen if null is passed. I think that's is
intentionally ambiguous and allows some wiggle room here.

Should we be more explicit on NPE? I prefer to leave it as is, so it's
unspecified behavior if null is passed.

> For allMatch/noneMatch I think the case where predicate is null and 
> the stream is empty is covered by "and the predicate is not 
> evaluated".
> 

Right. That covers the empty case "does not evaluate the predicate", and
we didn't "otherwise specified" about null, so in theory it still "must
be non-null".

Cheers,
Henry

> Mike
> 
> On Oct 15 2013, at 15:34 , Henry Jen <henry.jen at oracle.com> wrote:
> 
>> Hi,
>> 
>> Please kindly review the latest update on lambda library spec, and
>>  a few minor code clean up.
>> 
>> Webrev and specdiff can be found at,
>> 
>> http://cr.openjdk.java.net/~henryjen/ccc/8025909/0/webrev 
>> http://cr.openjdk.java.net/~henryjen/ccc/8025909/0/specdiff
>> 
>> This webrev also covers update that address JDK-8024179 as the
>> spec update explains why reported scenario is expected.
>> 
>> Cheers, Henry
> 



More information about the lambda-dev mailing list