Default method survey results

Zhong Yu zhong.j.yu at gmail.com
Sat Aug 18 09:48:47 PDT 2012


On Fri, Aug 17, 2012 at 3:50 PM, Rémi Forax <forax at univ-mlv.fr> wrote:
> On 08/17/2012 09:38 PM, Zhong Yu wrote:
>> Another thing, remove() is a stateful operation, it depends on a prev
>> next() call. If the caller invokes remove() without a prev next(), we
>> should ideally throw IllegalStateException, regardless whether the
>> operation is supported. I'm just saying; it's not a big deal either
>> way.
>>
>
> No, it works the other way around, see the javadoc.

I don't see that in javadoc. Is the order of @throws doclets important?

Intuitively, a remove() without a prev next() is nonsensical, it's not
a well formed operation, therefore it's does not deserve a
UnsupportedOperationException. It's a 400 bad request, not 501 Not
Implemented.

But I myself wrote lots of "void remove(){ throw new UOE(); }" , so
I'm not going to be serious about it:) Also I don't find it very
annoying to have to write that one liner for my iterators.

> Rémi
>
>
>


More information about the lambda-dev mailing list