Primitive streams and optional (original) (raw)

Doug Lea dl at cs.oswego.edu
Wed Dec 5 04:56:44 PST 2012


On 12/05/12 07:42, Remi Forax wrote:

This experience among others led to the non-nulls policy in j.u.c.

If we can go back in time and disallow null for all collections, we will live in a better world, but that not the case.

If we could go back in time and disallow null for all streams, we will live in a better world. Oh, wait! We don't have to go back in time! We can just make a better world!

I'm pretty sure that because j.u.c collections use null to tag entry that should be removed and because the VM aggressively optimizes value that was never null before, code that triggers de-optimization the first time you remove an element from a concurrent collection should exist.

I'm pretty sure that all such cases are OK because they trigger different branches that would somehow need encoding anyway. So branching on null vs branching on something else is a wash. (Although there might be a case here and there where different encodings might win because they currently disable triggerings of agressive-null mechanics that would otherwise be enabled along branches.

-Doug



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