myfaces _DeltaList
------------------

                 Key: MYFACES-3227
                 URL: https://issues.apache.org/jira/browse/MYFACES-3227
             Project: MyFaces Core
          Issue Type: Wish
          Components: General
    Affects Versions: 2.1.1
         Environment: tomcat 7.0.14 myfaces 2.1.1
            Reporter: lkw
            Priority: Minor


hi
at first, i'm not native english speaker.

let's see follow MyFaces's _DeltaList's code.
...
===
    public boolean retainAll(Collection<?> c)
    {
        return _delegate.retainAll(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(i);
==
result is 2,3.


i think that _DeltaList.retainAll should have clearInitialState() method call 
as follow.
===
    public boolean retainAll(Collection<?> c)
    {
        boolean result = _delegate.retainAll(c);
        if (result==true)
            clearInitialState();
        return result;
    }
===
of course, i know that calling to this method is not so many frequency.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to