portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From vku...@apache.org
Subject svn commit: r773538 - /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/caches/HashMapPathResolverCache.java
Date Mon, 11 May 2009 12:29:12 GMT
Author: vkumar
Date: Mon May 11 12:29:12 2009
New Revision: 773538

URL: http://svn.apache.org/viewvc?rev=773538&view=rev
Log:
Making path cache as synchronized for handling concurrency issue
https://issues.apache.org/jira/browse/JS2-1001

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/caches/HashMapPathResolverCache.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/caches/HashMapPathResolverCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/caches/HashMapPathResolverCache.java?rev=773538&r1=773537&r2=773538&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/caches/HashMapPathResolverCache.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/caches/HashMapPathResolverCache.java
Mon May 11 12:29:12 2009
@@ -16,6 +16,7 @@
  */
 package org.apache.jetspeed.decoration.caches;
 
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.Map;
 
@@ -31,11 +32,11 @@
  */
 public class HashMapPathResolverCache implements PathResolverCache
 {
-    protected Map cache;
+    protected Map<String,String> cache;
     
     public HashMapPathResolverCache()
     {
-        this.cache = new HashMap();
+        this.cache = Collections.synchronizedMap(new HashMap<String,String>());
     }
 
     public void addPath(String key, String path)
@@ -45,12 +46,12 @@
 
     public String getPath(String key)
     {
-        return (String) cache.get(key);
+        return cache.get(key);
     }
 
     public String removePath(String key)
     {
-        return (String) cache.remove(key);
+        return cache.remove(key);
     }
 
     public void clear()



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message