You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by el...@apache.org on 2006/09/27 00:02:24 UTC

svn commit: r450233 - in /incubator/roller/trunk/src/org/apache/roller/ui/rendering/util: WeblogFeedCache.java WeblogPageCache.java

Author: eliast
Date: Tue Sep 26 15:02:22 2006
New Revision: 450233

URL: http://svn.apache.org/viewvc?view=rev&rev=450233
Log:
- Fixed ClassCastException when generating cache keys that contained tags.

Modified:
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogFeedCache.java
    incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogPageCache.java

Modified: incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogFeedCache.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogFeedCache.java?view=diff&rev=450233&r1=450232&r2=450233
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogFeedCache.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogFeedCache.java Tue Sep 26 15:02:22 2006
@@ -23,6 +23,7 @@
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.Map;
+import java.util.Set;
 import java.util.TreeSet;
 
 import org.apache.commons.logging.Log;
@@ -177,7 +178,8 @@
         }
         
         if(feedRequest.getTags() != null && feedRequest.getTags().size() > 0) {
-          String[] tags = (String[])new TreeSet(feedRequest.getTags()).toArray();
+          Set ordered = new TreeSet(feedRequest.getTags());
+          String[] tags = (String[]) ordered.toArray(new String[ordered.size()]);  
           key.append("/tags/").append(Utilities.stringArrayToString(tags,"+"));
         }        
         

Modified: incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogPageCache.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogPageCache.java?view=diff&rev=450233&r1=450232&r2=450233
==============================================================================
--- incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogPageCache.java (original)
+++ incubator/roller/trunk/src/org/apache/roller/ui/rendering/util/WeblogPageCache.java Tue Sep 26 15:02:22 2006
@@ -24,6 +24,7 @@
 import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Set;
 import java.util.TreeSet;
 
 import org.apache.commons.logging.Log;
@@ -201,7 +202,8 @@
             }
             
             if(pageRequest.getTags() != null && pageRequest.getTags().size() > 0) {
-              String[] tags = (String[])new TreeSet(pageRequest.getTags()).toArray();
+              Set ordered = new TreeSet(pageRequest.getTags());
+              String[] tags = (String[]) ordered.toArray(new String[ordered.size()]);  
               key.append("/tags/").append(Utilities.stringArrayToString(tags,"+"));
             }            
         }