myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1236499 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
Date Fri, 27 Jan 2012 02:48:53 GMT
Author: lu4242
Date: Fri Jan 27 02:48:53 2012
New Revision: 1236499

URL: http://svn.apache.org/viewvc?rev=1236499&view=rev
Log:
small fix avoid object creation for null partial state

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java?rev=1236499&r1=1236498&r2=1236499&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
Fri Jan 27 02:48:53 2012
@@ -163,6 +163,8 @@ public class DefaultFaceletsStateManagem
     private static final String SERIALIZED_VIEW_REQUEST_ATTR = 
         StateManagerImpl.class.getName() + ".SERIALIZED_VIEW";
     
+    private static final Object[] EMPTY_STATES = new Object[]{null, null};
+    
     private ViewDeclarationLanguageFactory _vdlFactory;
     
     private RenderKitFactory _renderKitFactory = null;
@@ -537,8 +539,15 @@ public class DefaultFaceletsStateManagem
             
             // As required by ResponseStateManager, the return value is an Object array.
 First
             // element is the structure object, second is the state map.
-        
-            serializedView = new Object[] { null, states };
+
+            if (states == null)
+            {
+                states = EMPTY_STATES;
+            }
+            else
+            {
+                serializedView = new Object[] { null, states };
+            }
             
             //externalContext.getRequestMap().put(SERIALIZED_VIEW_REQUEST_ATTR,
             //        getStateCache().encodeSerializedState(context, serializedView));



Mime
View raw message