javaserverfaces
  1. javaserverfaces
  2. JAVASERVERFACES-2528

javax.faces.model.CollectionDataModel.setWrappedData(Object data) does not set data if not null

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2.0-m05
    • Fix Version/s: 2.2.0-m06
    • Component/s: managed bean
    • Labels:
      None
    • Environment:

      N/A

      Description

      Is appears if that we never save the data object we pass into setWrappedData(). Here is teh code below.

      public Object getWrappedData()

      { return (this.inner); <----- inner never gets set in setWrappedData unless you pass in 'null' (see below method) }

      /**

      • @throws ClassCastException if <code>data</code> is
      • non-<code>null</code> and is not a <code>Collection</code>
        */
        public void setWrappedData(Object data) {

      if (data == null)

      { inner = null; arrayFromInner = null; setRowIndex(-1); }

      else

      { final Collection<E> collection = (Collection<E>) data; arrayFromInner = (E[]) new Object[collection.size()]; collection.toArray(arrayFromInner); setRowIndex(0); }

      }

      1. changebundle.txt
        5 kB
        Manfred Riem

        Activity

        Hide
        dougd added a comment -

        r=dougd

        Show
        dougd added a comment - r=dougd
        Hide
        Manfred Riem added a comment -

        Applied to 2.2 trunk,

        svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2528, r=dougd, Make sure when setWrappedData is called the collection is actually used."
        Sending jsf-api\src\main\java\javax\faces\model\CollectionDataModel.java
        Adding test\unit\src\test\java\javax\faces\model
        Adding test\unit\src\test\java\javax\faces\model\CollectionDataModelTest.java
        Transmitting file data ..
        Committed revision 10805.

        Show
        Manfred Riem added a comment - Applied to 2.2 trunk, svn commit -m "Fixes http://java.net/jira/browse/JAVASERVERFACES-2528 , r=dougd, Make sure when setWrappedData is called the collection is actually used." Sending jsf-api\src\main\java\javax\faces\model\CollectionDataModel.java Adding test\unit\src\test\java\javax\faces\model Adding test\unit\src\test\java\javax\faces\model\CollectionDataModelTest.java Transmitting file data .. Committed revision 10805.

          People

          • Assignee:
            Manfred Riem
            Reporter:
            dougd
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: