You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by ar...@apache.org on 2010/07/09 17:59:20 UTC

svn commit: r962582 - /myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java

Author: arobinson74
Date: Fri Jul  9 15:59:20 2010
New Revision: 962582

URL: http://svn.apache.org/viewvc?rev=962582&view=rev
Log:
TRINIDAD-1845 Commit the patch

Modified:
    myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java

Modified: myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java?rev=962582&r1=962581&r2=962582&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java (original)
+++ myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/RowKeySetTreeImpl.java Fri Jul  9 15:59:20 2010
@@ -79,8 +79,13 @@ public class RowKeySetTreeImpl extends R
   public boolean isContainedByDefault()
   {
     TreeModel model = getCollectionModel();
-    Object rowkey = model.getRowKey();
-    return new Search().find(rowkey).isDefaultContained;
+    
+    if (model != null)
+    {
+      Object rowkey = model.getRowKey();
+      return new Search().find(rowkey).isDefaultContained;
+    }
+    return false;
   }
 
   @Override
@@ -387,7 +392,7 @@ public class RowKeySetTreeImpl extends R
     int sz = ((rowkey != null) && (set.isDefaultContained ^ set.isDifferent)) ? 1 : 0;
     if (set.isDefaultContained)
     {
-      if (!fetchall)
+      if (!fetchall || model == null)
         return -1;
 
       Object old = model.getRowKey();
@@ -704,7 +709,7 @@ public class RowKeySetTreeImpl extends R
   {
     PathIterator()
     {
-      _value = isEmpty() ? null : nextItem(); // initialize;
+      _value = (getCollectionModel() == null || isEmpty()) ? null : nextItem(); // initialize;
     }
 
     PathIterator(Object noop)
@@ -793,7 +798,7 @@ public class RowKeySetTreeImpl extends R
     {
       super(null);
       _currIterator = _root.entrySet().iterator();
-      _value = isEmpty() ? null : nextItem(); // initialize;
+      _value = (getCollectionModel() == null || isEmpty()) ? null : nextItem(); // initialize;
     }
 
     protected Object nextItem()
@@ -854,4 +859,4 @@ public class RowKeySetTreeImpl extends R
   private static final long serialVersionUID = 1L;
   private static final TrinidadLogger _LOG =
     TrinidadLogger.createTrinidadLogger(RowKeySetTreeImpl.class);
-}
\ No newline at end of file
+}