Return-Path: X-Original-To: apmail-myfaces-commits-archive@www.apache.org Delivered-To: apmail-myfaces-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D373010AE2 for ; Fri, 18 Oct 2013 02:42:47 +0000 (UTC) Received: (qmail 54228 invoked by uid 500); 18 Oct 2013 02:42:43 -0000 Delivered-To: apmail-myfaces-commits-archive@myfaces.apache.org Received: (qmail 54129 invoked by uid 500); 18 Oct 2013 02:42:41 -0000 Mailing-List: contact commits-help@myfaces.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "MyFaces Development" Delivered-To: mailing list commits@myfaces.apache.org Received: (qmail 54114 invoked by uid 99); 18 Oct 2013 02:42:39 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Oct 2013 02:42:39 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Oct 2013 02:42:36 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id A489E2388980; Fri, 18 Oct 2013 02:42:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commits@myfaces.apache.org From: lu4242@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20131018024215.A489E2388980@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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) bean).getName(); - if (name != null) + if(bean instanceof Bean) { - nameBeanKeyMap.put(name, beanKey); + String name = ((Bean) bean).getName(); + if (name != null) + { + nameBeanKeyMap.put(name, beanKey); + } } return instanceInfo.getContextualInstance();