Details
Description
hi
at first, i'm not native english speaker.
let's see follow MyFaces's _DeltaList's code.
...
===
public boolean retainAll(Collection<?> c)
===
follow is java.util.List's retainAll method javadoc.
===
/**
- Retains only the elements in this list that are contained in the
- specified collection (optional operation). In other words, removes
- from this list all the elements that are not contained in the specified
- collection.
* - @param c collection containing elements to be retained in this list
- @return <tt>true</tt> if this list changed as a result of the call
- @throws UnsupportedOperationException if the <tt>retainAll</tt> operation
- is not supported by this list
- @throws ClassCastException if the class of an element of this list
- is incompatible with the specified collection (optional)
- @throws NullPointerException if this list contains a null element and the
- specified collection does not permit null elements (optional),
- or if the specified collection is null
- @see #remove(Object)
- @see #contains(Object)
*/
boolean retainAll(Collection<?> c);
===
so
===
List<Integer> thisList = new ArrayList<Integer>();
thisList.add(1);
thisList.add(2);
thisList.add(3);
List<Integer> paramList = new ArrayList<Integer>();
paramList.add(2);
paramList.add(3);
paramList.add(4);
thisList.retainAll(paramList);
for(Integer i:thisList)
System.out.println;
==
result is 2,3.
i think that _DeltaList.retainAll should have clearInitialState() method call as follow.
===
public boolean retainAll(Collection<?> c)
===
of course, i know that calling to this method is not so many frequency.