Apache Commons logo Commons Collections

Release notes for version 3.2

These are the release notes for Commons Collections 3.2:


Commons collections is a project to develop and maintain collection classes based on and inspired by the JDK collection framework. This project is Java 1.2 compatible, and does not use Java 5 generics.

This release adds various new classes and fixes a number of bugs. All feedback should be directed to commons-user at jakarta.apache.org.


COMPATIBILITY

This release is fully source and binary compatible with 3.1. (Checks performed using JDiff and Clirr, thanks). Please check the bug fixes to ensure you weren't relying on the behavior of a bug.

There are two new deprecations:
BeanMap is now deprecated and will be removed in 4.0. The class is now available in commons-beanutils (full jar version). This change was made to ensure that all bean related collections were in one place (ie. beanutils). If this causes major headaches to anyone please contact commons-dev at jakarta.apache.org.

MultiHashMap is now deprecated and will be removed in 4.0. The class is now available as MultiValueMap in the map subpackage. This new version of the class is a decorator and can wrap maps other than HashMap making it much more flexible. If this causes major headaches to anyone please contact commons-dev at jakarta.apache.org.

NEW CLASSES

  • MultiValueMap - Decorator implementation of MultiMap providing control over the map and collection implementations, updated MapUtils to match [29440]
  • DefaultedMap - Returns a default value when the key is not found, without adding the default value to the map itself [30911]
  • GrowthList - Decorator that causes set and indexed add to expand the list rather than throw IndexOutOfBoundsException [34171]
  • LoopingListIterator - When the end of the list is reached the iteration continues from the start, updated IteratorUtils to match [30166]
  • ReverseListIterator - A list iterator that returns the elements from the list in reverse order [39224]
  • BoundedBuffer - A new wrapper class which can make any buffer bounded, updated BufferUtils to match [37473]

ENHANCEMENTS

  • CollectionUtils.addIgnoreNull - Adds to the collection if the value being added is not null [30020]
  • MapUtils.putAll - Puts an array of key/value pairs into a map [30882]
  • CollectionUtils/MapUtils.isEmpty/isNotEmpty - Null-safe checks of collection emptyness [35890]
  • CollectionUtils.sizeIsEmpty - Checks if a collection, array, map, iterator or enumeration is empty
  • CollectionUtils/ListUtils - retainAll/removeAll that don't change original colllection
  • ExtendedProperties - Accepts List elements (does not enforce Vector) as values [36812]
  • ExtendedProperties - new Methods getList(String key) and getList(String key, List defaults) [36812]
  • ExtendedProperties - No longer uses an exception in normal processing [30497]
  • BlockingBuffer - now includes stack trace if InterupttedException occurs [33700]
  • BlockingBuffer - new methods that allow get and remove with a timeout, updated BufferUtils to match [27691]
  • BlockingBuffer - now allows you to specify a default timeout value for get/remove operations [37607]
  • TransformedMap/TransformedSortedMap - new factory decorateTransform() that transforms any existing entries in the map [30959]
  • ListOrderedMap - values can now be accessed as a List using valueList() [37015]
  • ListOrderedMap - additional list-like method, setValue(int,Object)
  • ListOrderedMap - additional method, put(int,Object,Object)
  • PriorityBuffer - now Serializable [36163]
  • ListIteratorWrapper - now implements ResettableListIterator [39449]
  • IfClosure - add single argument constructor, updated CllosureUtils to match [38495]
  • All/Any/One/None Predicate - allow construction with zero or one predicates [37979]

BUG FIXES

  • FastArrayList - Fix iterators and views to work better in multithreaded environments
  • FastArrayList - Fix iterator remove where ConcurrentModificationException not as expected [34690]
  • CursorableLinkedList (list subpackage) - Fix iterator remove/set not throwing IllegalStateException after next-previous-removeByIndex [35766]
  • TreeList/CursorableLinkedList/NodeCachingLinkedList/AbstractLinkedList - Fix iterator remove not working properly when called after previous [35258]
  • TreeList - remove(int) could break class invariants, breaking iterator previous [35258]
  • SetUniqueList.set(int,Object) - Destroyed set status in certain circumstances [33294]
  • AbstractLinkedMap.init() - Now calls createEntry() to create the map entry object [33706]
  • AbstractHashedMap deserialization - Fix to prevent doubling of internal data array [34265]
  • AbstractHashedMap initialization - Fix to setup threshold correctly, improving performance [35012]
  • BeanMap.initialize() - Internal variable now correctly initialised with only write methods that actually exist [15895]
  • MultiHashMap.remove(key, item) - Was returning the item even when nothing was removed [32366]
  • MultiHashMap.putAll(multimap) - Was adding the collection as a single item rather than individually [35631]
  • MultiHashMap - Enable compilation using J#
  • Flat3Map.equals() - Fix to make flat mode comparison actually work [34917]
  • TransformedMap.putAll - Now allows putAll of an empty map [34686]
  • StaticBucketMap.containsKey - Fix incorrect null checking [37567]
  • AbstractMapBag.BagIterator.remove - Removing the last entry used to break the class invariants [35747]
  • BoundedFifoBuffer/CircularFifoBuffer - Fix serialization to work in case where buffer serialized when full [31433]
  • BoundedFifoBuffer - Fix iterator remove bug causing ArrayIndexOutOfBounds error [33071]
  • UnboundedFifoBuffer - Fix iterator remove bug causing ArrayIndexOutOfBounds error [35733]
  • UnboundedFifoBuffer - Fix deserialization to work with subsequant object manipulation [35763]
  • BlockingBuffer - Fix internal locking code (internal fix, no effect on users of BlockingBuffer) [37028]
  • IteratorChain.remove() - Fix to avoid IllegalStateException when one of the underlying iterators is a FilterIterator [34267]
  • FilterIterator - Correctly handle setting of iterator and predicate after object creation [38074]
  • ExtendedProperties.convertProperties() - Fix to handle default properties maps correctly [32204]
  • Add casts to avoid some JDK1.5 compilation warnings [35474]
  • Make serialization version ids private [37106]

JAVADOC

  • MapUtils.safeAddToMap - Better comment
  • MapUtils.transformed*Map - Better comment
  • ListOrderedSet.decorate(List) - Better comment [32073]
  • BlockingBuffer - Add comments
  • Maps - synchronization comments [32573]
  • SwitchTransformer - defaultTransformer comment fix [39207]