Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-3227

myfaces _DeltaList does not call clearInitialState when retainAll(Collection<?>) method is called

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.1.1
    • 2.0.8, 2.1.2
    • General
    • None
    • tomcat 7.0.14 myfaces 2.1.1

    Description

      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;
      ==
      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.

      Attachments

        Activity

          People

            lu4242 Leonardo Uribe
            imcharsi lkw
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 336h
                336h
                Remaining:
                Remaining Estimate - 336h
                336h
                Logged:
                Time Spent - Not Specified
                Not Specified