portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r776671 - /portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
Date Wed, 20 May 2009 11:52:59 GMT
Author: ate
Date: Wed May 20 11:52:59 2009
New Revision: 776671

URL: http://svn.apache.org/viewvc?rev=776671&view=rev
Log:
Fix for JS2-1020: Incorrect caching of user preferences can cause preference values to be
returned from another user or stale values on export
See: http://issues.apache.org/jira/browse/JS2-1020

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java?rev=776671&r1=776670&r2=776671&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/PortletPreferencesServiceImpl.java
Wed May 20 11:52:59 2009
@@ -748,8 +748,9 @@
         JetspeedPreferencesMap userPreferences = new JetspeedPreferencesMap();
         String appName = portletdefinition.getApplication().getName();
         String portletName = portletdefinition.getPortletName();
-
-        CacheElement cachedDefaults = preferenceCache.get(getEntityPreferenceKey(appName,
portletName,windowId));
+        
+        String userCacheKey = getUserPreferenceKey(appName, portletName,windowId, userName);
+        CacheElement cachedDefaults = preferenceCache.get(userCacheKey);
         if (cachedDefaults != null)
         {
             userPreferences = (JetspeedPreferencesMap) cachedDefaults.getContent();
@@ -771,7 +772,7 @@
                 value.setReadOnly(preference.isReadOnly());
                 userPreferences.put(preference.getName(), value);
             }
-            preferenceCache.put(preferenceCache.createElement(getEntityPreferenceKey(appName,
portletName,windowId), userPreferences));
+            preferenceCache.put(preferenceCache.createElement(userCacheKey, userPreferences));
         }
         return userPreferences;
     }



---------------------------------------------------------------------
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