This page details the compatibility of different collections releases.
There are two types of compatibility discussed here, source and binary.
Releases of commons collections aim to be source and binary compatible within minor versions, and to avoid breakages as much as possible between major versions.
Commons collections 3.0 is source compatible with version 2.1 and 2.0 with the exception of classes previously deprecated in 2.0/2.1 (which were removed in 3.0).
Commons collections 3.0 is binary compatible with version 2.1 and 2.0
except for certain methods on one class.
As the release was a major version, this is permitted, however it was unintentional and an error.
The problem is in the IteratorUtils
class (see methods below).
(Strictly speaking, there are some minor incompatibilities on other classes, but these
changes were deliberate and have not caused any known issues.)
It is not possible to make v2.1 and v3.0 compatible without futher binary incompatibility. The chosen solution is to provide a work around by releasing v2.1.1 and v3.1. The following deprecations must be resolved in v2.1.1 to allow compatibiilty with v3.1.
IteratorUtils.arrayIterator(...)
-
use new ArrayIterator(...)
insteadIteratorUtils.singletonIterator(...)
-
use new SingletonIterator(...)
insteadIteratorUtils.emptyIterator()
-
use EmptyIterator.INSTANCE
insteadIteratorUtils.emptyListIterator()
-
use EmptyListIterator.INSTANCE
insteadIteratorUtils.EMPTY_ITERATOR
-
use EmptyIterator.INSTANCE
insteadIteratorUtils.EMPTY_LIST_ITERATOR
-
use EmptyIterator.INSTANCE
insteadFor the future, a new tool clirr is being developed to help spot binary incompatibility before release.