编辑2014年1月1日, Apache Commons Collections
4.0终于在2013年11月21日发布,其中包含针对此问题的修复程序。
链接到
CollectionUtils.java
有问题的行(1688年至1691年),并确认该方法先前已中断:
public static <E> Collection<E> removeAll(final Collection<E> collection, final Collection<?> remove) { return ListUtils.removeAll(collection, remove);}原始答案
不,你不疯。
removeAll()实际上是(错误地)调用
retainAll()。
这是中的错误
CollectionUtils,影响版本3.2。它已经修复,但仅在4.0分支中。
https://issues.apache.org/jira/browse/COLLECTIONS-349
作为进一步的证明,这是到源代码的链接:
http://svn.apache.org/repos/asf/commons/proper/collections/tags/COLLECTIONS_3_2/src/java/org/apache/commons/collections/CollectionUtils.java
查看以下行:
public static Collection removeAll(Collection collection, Collection remove) { return ListUtils.retainAll(collection, remove);}是的…坏了!



