You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bs...@apache.org on 2010/12/10 07:11:32 UTC

svn commit: r1044214 - /myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/change/RowKeySetAttributeChange.java

Author: bsullivan
Date: Fri Dec 10 06:11:31 2010
New Revision: 1044214

URL: http://svn.apache.org/viewvc?rev=1044214&view=rev
Log:
Handle case where the new and old keysets are the same

Modified:
    myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/change/RowKeySetAttributeChange.java

Modified: myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/change/RowKeySetAttributeChange.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/change/RowKeySetAttributeChange.java?rev=1044214&r1=1044213&r2=1044214&view=diff
==============================================================================
--- myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/change/RowKeySetAttributeChange.java (original)
+++ myfaces/trinidad/branches/1.2.12.3-branch/trinidad-api/src/main/java/org/apache/myfaces/trinidad/change/RowKeySetAttributeChange.java Fri Dec 10 06:11:31 2010
@@ -80,8 +80,12 @@ public class RowKeySetAttributeChange ex
         {
           RowKeySet oldKeySet = (RowKeySet)oldValue;
           
-          oldKeySet.clear();
-          oldKeySet.addAll((RowKeySet)attributeValue);
+          // check for equality because otherwise we would clear ourselves and end up empty
+          if (oldKeySet != attributeValue)
+          {
+            oldKeySet.clear();
+            oldKeySet.addAll((RowKeySet)attributeValue);
+          }
           
           // don't replace the RowKeySet
           putValue = false;