commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Colebourne" <scolebou...@btopenworld.com>
Subject Re: [collections] Backwards compatability 3.0 to 2.1
Date Tue, 04 May 2004 23:22:22 GMT
Collections 3.0 is SOURCE and TEST compatible with 2.1 via deprecation (see
below).

The following BINARY incompatabilities were present and not noted in the
release notes (I've just manually checked for them):

Important:
The following IteratorUtils methods changed return type causing errors when
linking:
IteratorUtils.arrayIterator(Object[])
IteratorUtils.arrayIterator(Object[], int)
IteratorUtils.arrayIterator(Object[], int, int)
 - solution: use new ArrayIterator(Object[], int, int)
IteratorUtils.singletonIterator()
 - solution: use new SingletonIterator(object)
IteratorUtils.emptyIterator()
IteratorUtils.emptyListIterator()
IteratorUtils.EMPTY_ITERATOR
IteratorUtils.EMPTY_LIST_ITERATOR
- no solution

All methods/classes deprecated in 2.1 were removed.

Maybe important:
BufferUnderflowException now extends NoSuchElementException instead of just
RuntimeException

Not so important:
BeanMap.MyMapEntry  no longer extends DefaultMapEntry
FilterIterator no longer extends ProxyIterator
FilterListIterator no longer extends ProxyListIterator
TransformIterator no longer extends ProxyIterator


The main issue is that IteratorUtils got screwed up. Solutions are given
above for most of the methods (ie. the solution works in both 2.1 and 3.0.
The empty iterators are just plain screwed though. This is exactly why we
need a binary compatability checker.

Stephen

----- Original Message -----
From: "Stephen Colebourne" <scolebourne@btopenworld.com>
> I took the time to run Collections 3.0 against the Collections 2.1 tests.
> IT PASSED  ;-)
>
>
> This is the full details of the 3 'failures':
>
> ArrayIterator 'failure':
> new ArrayIterator(Object,1,1) should throw an IllegalArgumentException
>
.collections.iterators.TestArrayIterator2.testIndexedArray(TestArrayIterator
> 2.java:203)
> Reason - Collections 3.0 enhanced constructor to allow iteration over a
zero
> length array.
> Backwards compatible unless caller relied on error.
>
> UniqueFilterIterator 'failure':
> java.lang.IllegalStateException
>  java.util.AbstractList$Itr.remove(AbstractList.java:428)
> .collections.iterators.FilterIterator.remove(FilterIterator.java:126)
>
.collections.iterators.TestUniqueFilterIterator.testRemove(TestUniqueFilterI
> terator.java:153)
> Reason - Collections 3.0 enhanced UniqueFilterIterator to allow remove()
> Backwards compatible unless caller relied on error.
>
> PredicatedMap 'failure':
> Reason - Collections 3.0 fixed a bug whereby the toArray() method wasn't
> protected by the predicate
> Backwards compatible unless caller relied on bug.
>
> Stephen
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message