myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arobinso...@apache.org
Subject svn commit: r808657 - /myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/XMLMenuModel.java
Date Thu, 27 Aug 2009 21:59:31 GMT
Author: arobinson74
Date: Thu Aug 27 21:59:30 2009
New Revision: 808657

URL: http://svn.apache.org/viewvc?rev=808657&view=rev
Log:
TRINIDAD-1557 - applied patch

Modified:
    myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/XMLMenuModel.java

Modified: myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/XMLMenuModel.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/XMLMenuModel.java?rev=808657&r1=808656&r2=808657&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/XMLMenuModel.java
(original)
+++ myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/model/XMLMenuModel.java
Thu Aug 27 21:59:30 2009
@@ -41,6 +41,7 @@
 import org.apache.myfaces.trinidad.logging.TrinidadLogger;
 import org.apache.myfaces.trinidad.util.ClassLoaderUtils;
 import org.apache.myfaces.trinidad.util.ContainerUtils;
+import org.apache.myfaces.trinidad.util.TransientHolder;
 
 
 /**
@@ -601,12 +602,14 @@
    // a synchronized block.
    synchronized (lock)
    {
-      Map contentHandlerMap = (Map) scopeMap.get(_CACHED_MODELS_KEY);
+     TransientHolder<Map<Object, List<MenuContentHandler> >> holder = 

+       (TransientHolder<Map<Object, List<MenuContentHandler> >>) scopeMap.get(_CACHED_MODELS_KEY);
+      Map<Object, List<MenuContentHandler>> contentHandlerMap = (holder != null)
? holder.getValue() : null;
       if (contentHandlerMap == null)
       {
         contentHandlerMap =
-            new ConcurrentHashMap<String, List<MenuContentHandler>>();
-        scopeMap.put(_CACHED_MODELS_KEY, contentHandlerMap);
+            new ConcurrentHashMap<Object, List<MenuContentHandler>>();
+        scopeMap.put(_CACHED_MODELS_KEY, TransientHolder.newTransientHolder( contentHandlerMap)
);
         scopeMap.put(_CACHED_MODELS_ID_CNTR_KEY,new AtomicInteger(-1));
       }
       return contentHandlerMap;



Mime
View raw message