Expected behavior of a Streams.cycled() instance - found issues and questions
paul.sandoz at oracle.com
Tue Oct 23 12:17:42 PDT 2012
On Oct 23, 2012, at 7:11 PM, Brian Goetz <brian.goetz at Oracle.COM> wrote:
>> 5) cycledStream.uniqueElements() leads to IllegalStateException though
>> it should not according to common sense.
Got a stack trace?
> Well, I'm not sure I agree with the notion of common sense here; I think
> its a bit much to ask the runtime to do this kind of analysis. But this
> is a fine example of the sort of trouble we get in when we do try and
> protect the user from themselves; this ISE is exactly what you're asking
> for in (1), and we should probably remove it.
Yeah, we can only catch some not all cases so it is inconsistent.
However, for the above case I am wondering where the exception is thrown because it does not seem to match the places in AbstractPipeline an ISE is currently thrown.
More information about the lambda-dev