myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lu4...@apache.org
Subject svn commit: r1293630 - /myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/LifecycleProviderFactory.java
Date Sat, 25 Feb 2012 16:01:12 GMT
Author: lu4242
Date: Sat Feb 25 16:01:12 2012
New Revision: 1293630

URL: http://svn.apache.org/viewvc?rev=1293630&view=rev
Log:
MYFACES-3474 [perf] LifecycleProviderFactory does not cache created Factory (Thanks to Martin
Koci for provide this patch)

Modified:
    myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/LifecycleProviderFactory.java

Modified: myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/LifecycleProviderFactory.java
URL: http://svn.apache.org/viewvc/myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/LifecycleProviderFactory.java?rev=1293630&r1=1293629&r2=1293630&view=diff
==============================================================================
--- myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/LifecycleProviderFactory.java
(original)
+++ myfaces/core/trunk/impl/src/main/java/org/apache/myfaces/config/annotation/LifecycleProviderFactory.java
Sat Feb 25 16:01:12 2012
@@ -20,6 +20,7 @@ package org.apache.myfaces.config.annota
 
 import java.security.AccessController;
 import java.security.PrivilegedActionException;
+import java.util.Map;
 
 import javax.faces.FacesException;
 import javax.faces.context.ExternalContext;
@@ -43,7 +44,8 @@ public abstract class LifecycleProviderF
     
     public static LifecycleProviderFactory getLifecycleProviderFactory(ExternalContext ctx)
     {
-        LifecycleProviderFactory instance = (LifecycleProviderFactory) ctx.getApplicationMap().get(FACTORY_KEY);
+        Map<String, Object> applicationMap = ctx.getApplicationMap();
+        LifecycleProviderFactory instance = (LifecycleProviderFactory) applicationMap.get(FACTORY_KEY);
         if (instance != null)
         {
             return instance;
@@ -75,6 +77,10 @@ public abstract class LifecycleProviderF
         {
             throw new FacesException(pae);
         }
+        if (lpf != null)
+        {
+            applicationMap.put(FACTORY_KEY, lpf);
+        }
         return lpf;
     }
 



Mime
View raw message