myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1533315 - in /myfaces/core/trunk: api/src/main/java/javax/faces/component/UIViewRoot.java impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextualStorage.java
Date Fri, 18 Oct 2013 02:42:15 GMT
Author: lu4242
Date: Fri Oct 18 02:42:15 2013
New Revision: 1533315

URL: http://svn.apache.org/r1533315
Log:
MYFACES-3747 Implement new JSF 2.2 ViewScope specification (fix save scope when instance implements
StateHolder like with the proxy)

Modified:
    myfaces/core/trunk/api/src/main/java/javax/faces/component/UIViewRoot.java
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextualStorage.java

Modified: myfaces/core/trunk/api/src/main/java/javax/faces/component/UIViewRoot.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/api/src/main/java/javax/faces/component/UIViewRoot.java?rev=1533315&r1=1533314&r2=1533315&view=diff
==============================================================================
--- myfaces/core/trunk/api/src/main/java/javax/faces/component/UIViewRoot.java (original)
+++ myfaces/core/trunk/api/src/main/java/javax/faces/component/UIViewRoot.java Fri Oct 18
02:42:15 2013
@@ -1431,7 +1431,8 @@ public class UIViewRoot extends UICompon
                 //No values
                 return null;
             }
-            else if (parentSaved == null && _viewScope != null && _viewScope.size()
== 0)
+            else if (parentSaved == null && _viewScope != null && _viewScope.size()
== 0
+                && !(_viewScope instanceof StateHolder) )
             {
                 //Empty view scope, no values
                 return null;

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextualStorage.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextualStorage.java?rev=1533315&r1=1533314&r2=1533315&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextualStorage.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/cdi/view/ViewScopeContextualStorage.java
Fri Oct 18 02:42:15 2013
@@ -88,10 +88,13 @@ public class ViewScopeContextualStorage 
         instanceInfo.setContextualInstance(bean.create(creationalContext));
 
         contextualInstances.put(beanKey, instanceInfo);
-        String name = ((Bean<T>) bean).getName();
-        if (name != null)
+        if(bean instanceof Bean)
         {
-            nameBeanKeyMap.put(name, beanKey);
+            String name = ((Bean<T>) bean).getName();
+            if (name != null)
+            {
+                nameBeanKeyMap.put(name, beanKey);
+            }
         }
 
         return instanceInfo.getContextualInstance();



Mime
View raw message