RowKeySetAttributeChange doesn't check if oldValue is non-null and a RowKeySet 
before casting and dereferencing
---------------------------------------------------------------------------------------------------------------

                 Key: TRINIDAD-2074
                 URL: https://issues.apache.org/jira/browse/TRINIDAD-2074
             Project: MyFaces Trinidad
          Issue Type: Bug
          Components: Components
    Affects Versions:  1.2.12-core, 2.0.0-beta-3
            Reporter: Blake Sullivan


The problem is in the GetOldValueAndUpdate.invokeContextCallback()
implementation.

We want to reuse the oldValue if one exists, but don't check that the
oldValue is non-null.  The UIXTable and UIXTree aren't supposed to return
null values, but unfortunately do in some strange cases.  Regardless, the
safe thing to do is to check for null, and in fact, the safer thing to do is
to ensure that the oldValue is an instanceOf RowKeySet (which also catches
the null case), since we are going to cast to a RowKeySet.

This turns into a one line addition of an if check:

      if (oldValue instanceof RowKeySet)
      {
        RowKeySetAttributeChange._updateKeySet(null,
                                               (RowKeySet)oldValue,
                                               _newKeySet);
      }

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

Reply via email to