You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by bo...@apache.org on 2011/10/22 09:07:21 UTC

svn commit: r1187663 - in /myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet: FacesContextImpl.java FacesContextImplBase.java

Author: bommel
Date: Sat Oct 22 07:07:21 2011
New Revision: 1187663

URL: http://svn.apache.org/viewvc?rev=1187663&view=rev
Log:
(MYFACES-3366) FacesContext should use FacesContext.getCurrentInstance instead of 'this'

Modified:
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java
    myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImplBase.java

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java?rev=1187663&r1=1187662&r2=1187663&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java (original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImpl.java Sat Oct 22 07:07:21 2011
@@ -355,6 +355,7 @@ public class FacesContextImpl extends Fa
         assertNotReleased();
 
         RenderKit renderKit = getRenderKit();
+        FacesContext facesContext = FacesContext.getCurrentInstance();
         if (renderKit == null)
         {
             // NullPointerException with StateManager, because
@@ -373,12 +374,12 @@ public class FacesContextImpl extends Fa
             // will be the one tied to faces-config selected RenderKit. But the usual 
             // method to check if a request is a postback, is always detect the param
             // javax.faces.ViewState, so there is no problem after all.
-            String renderKitId = this.getApplication().getViewHandler().calculateRenderKitId(this);
+            String renderKitId = facesContext.getApplication().getViewHandler().calculateRenderKitId(facesContext);
             RenderKitFactory factory = (RenderKitFactory) 
                 FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
-            renderKit = factory.getRenderKit(this, renderKitId);            
+            renderKit = factory.getRenderKit(facesContext, renderKitId);
         }
-        return renderKit.getResponseStateManager().isPostback(this);            
+        return renderKit.getResponseStateManager().isPostback(facesContext);
     }
 
     @Override

Modified: myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImplBase.java
URL: http://svn.apache.org/viewvc/myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImplBase.java?rev=1187663&r1=1187662&r2=1187663&view=diff
==============================================================================
--- myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImplBase.java (original)
+++ myfaces/core/branches/2.0.x/impl/src/main/java/org/apache/myfaces/context/servlet/FacesContextImplBase.java Sat Oct 22 07:07:21 2011
@@ -177,7 +177,7 @@ public abstract class FacesContextImplBa
             return _elContext;
         }
 
-        _elContext = new FacesELContext(getApplication().getELResolver(), this);
+        _elContext = new FacesELContext(getApplication().getELResolver(), FacesContext.getCurrentInstance());
 
         ELContextEvent event = new ELContextEvent(_elContext);
         for (ELContextListener listener : getApplication().getELContextListeners())
@@ -272,7 +272,7 @@ public abstract class FacesContextImplBa
             {
                 _renderKitFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY);
             }
-            _cachedRenderKit = _renderKitFactory.getRenderKit(this, renderKitId);
+            _cachedRenderKit = _renderKitFactory.getRenderKit(FacesContext.getCurrentInstance(), renderKitId);
         }
         
         return _cachedRenderKit;