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 2009/10/21 04:59:03 UTC

svn commit: r827876 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/context/FacesContextFactoryImpl.java

Author: lu4242
Date: Wed Oct 21 02:59:03 2009
New Revision: 827876

URL: http://svn.apache.org/viewvc?rev=827876&view=rev
Log:
check for null is not necessary, because always the default external context instance is myfaces one. If portlet-bridge is used, the default one is the portlet one, but in that case, this factory is never called.

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/context/FacesContextFactoryImpl.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/context/FacesContextFactoryImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/context/FacesContextFactoryImpl.java?rev=827876&r1=827875&r2=827876&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/context/FacesContextFactoryImpl.java (original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/context/FacesContextFactoryImpl.java Wed Oct 21 02:59:03 2009
@@ -133,19 +133,16 @@
         
         if (_firstExternalContextInstance != null)
         {
-            if (_firstExternalContextInstance.get() == null)
+            defaultExternalContext = (ExternalContext)
+                externalContext.getRequestMap().remove(
+                        ExternalContextFactoryImpl.EXTERNAL_CONTEXT_KEY);
+            
+            if (defaultExternalContext != null)
             {
-                defaultExternalContext = (ExternalContext)
-                    externalContext.getRequestMap().remove(
-                            ExternalContextFactoryImpl.EXTERNAL_CONTEXT_KEY);
-                
-                if (defaultExternalContext != null)
-                {
-                    // Initialize the firstExternalContext that old jsf 1.2 or lower
-                    // implementations of ExternalContext should fall when call jsf 2.0
-                    // methods.
-                    _firstExternalContextInstance.set(defaultExternalContext);
-                }
+                // Initialize the firstExternalContext that old jsf 1.2 or lower
+                // implementations of ExternalContext should fall when call jsf 2.0
+                // methods.
+                _firstExternalContextInstance.set(defaultExternalContext);
             }
         }