Specifying "abnormal" behavior
Georgiy Rakov
georgiy.rakov at oracle.com
Mon Nov 26 02:10:08 PST 2012
Hello,
now "abnormal" behavior could occur in some lambda API use cases. By
"abnormal" I mean things like hanging, throwing OutOfMemory exception,
etc. Such "abnormal" behavior now occurs while dealing with infinite
streams. For instance following line of code causes hanging:
*Streams.cycle(Arrays.asList(1, 2, 3)).filter(o ->
o>4).iterator().hasNext();*
So I wonder:
1) If spec is going to specify the circumstances which could cause such
"abnormal" behavior, for instance "an attempt to sort infinite stream
leads to unpredictable result".
2) Moreover whether spec is going to specify that behavior exactly. For
instance instead of saying "an attempt to sort infinite stream leads to
/unpredictable result/" it will say "an attempt to sort infinite stream
causes /OutOfMemory exception/".
Thanks, Georgiy.
More information about the lambda-dev
mailing list