You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by lu...@apache.org on 2012/01/27 03:48:41 UTC
svn commit: r1236498 -
/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
Author: lu4242
Date: Fri Jan 27 02:48:41 2012
New Revision: 1236498
URL: http://svn.apache.org/viewvc?rev=1236498&view=rev
Log:
small fix avoid object creation for null partial state
Modified:
myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java?rev=1236498&r1=1236497&r2=1236498&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java (original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/view/facelets/DefaultFaceletsStateManagementStrategy.java Fri Jan 27 02:48:41 2012
@@ -162,6 +162,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;
@@ -536,8 +538,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));