You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by Chris Bartlett <cb...@gmail.com> on 2010/11/30 12:07:01 UTC
Sequence.remove(x) implementation inconsistencies
I just noticed that the javadocs for org.apache.pivot.collections.Sequence
state that
public int remove(T item); will return 'The index of the item that was
removed, or -1 if the item could not be found.'
http://svn.apache.org/repos/asf/pivot/trunk/core/src/org/apache/pivot/collections/Sequence.java
However, both
org.apache.pivot.collections.concurrent.SynchronizedList &
org.apache.pivot.collections.adapter.ListAdapter
throw IllegalArgumentExceptions rather than returning -1.
(Those are the only two problematic implementations of Sequence which I
could find.)
I can't see any code that relies on this behaviour so it looks safe remove
the Exception throwing.
Regards,
Chris
Re: Sequence.remove(x) implementation inconsistencies
Posted by Greg Brown <gk...@mac.com>.
Fixed - thanks.
On Nov 30, 2010, at 6:07 AM, Chris Bartlett wrote:
> I just noticed that the javadocs for org.apache.pivot.collections.Sequence
> state that
> public int remove(T item); will return 'The index of the item that was
> removed, or -1 if the item could not be found.'
> http://svn.apache.org/repos/asf/pivot/trunk/core/src/org/apache/pivot/collections/Sequence.java
>
> However, both
> org.apache.pivot.collections.concurrent.SynchronizedList &
> org.apache.pivot.collections.adapter.ListAdapter
> throw IllegalArgumentExceptions rather than returning -1.
> (Those are the only two problematic implementations of Sequence which I
> could find.)
>
> I can't see any code that relies on this behaviour so it looks safe remove
> the Exception throwing.
>
> Regards,
>
> Chris