Index: src/java/org/apache/wiki/plugin/WeblogPlugin.java
===================================================================
--- src/java/org/apache/wiki/plugin/WeblogPlugin.java	(revision 770483)
+++ src/java/org/apache/wiki/plugin/WeblogPlugin.java	(working copy)
@@ -42,6 +42,7 @@
 import org.apache.wiki.preferences.Preferences;
 import org.apache.wiki.preferences.Preferences.TimeFormat;
 import org.apache.wiki.providers.ProviderException;
+import org.apache.wiki.util.PageTimeComparator;
 import org.apache.wiki.util.TextUtil;
 
 
@@ -261,13 +262,11 @@
 
         try
         {
-            List<WikiPage> blogEntries = findBlogEntries( engine.getContentManager(),
+            SortedSet<WikiPage> blogEntries = findBlogEntriesSorted( engine.getContentManager(),
                                                           weblogName,
                                                           startTime.getTime(),
                                                           stopTime.getTime() );
 
-            Collections.sort( blogEntries, new PageDateComparator() );
-
             sb.append("<div class=\"weblog\">\n");
             
             for( Iterator i = blogEntries.iterator(); i.hasNext() && maxEntries-- > 0 ; )
@@ -428,15 +427,54 @@
      *  @param baseName The basename (e.g. "Main" if you want "Main_blogentry_xxxx")
      *  @param start The date which is the first to be considered
      *  @param end   The end date which is the last to be considered
-     *  @return a list of pages with their FIRST revisions.
+     *  @return an unordered list of pages with their FIRST revisions.
      *  @throws ProviderException If something goes wrong
      */
     public List<WikiPage> findBlogEntries( ContentManager mgr,
                                  String baseName, Date start, Date end )
         throws ProviderException
     {
+        return (List<WikiPage>)findBlogEntries( new ArrayList<WikiPage>(), mgr, baseName, start, end );
+    }
+
+    /**
+     *  Attempts to locate all pages that correspond to the
+     *  blog entry pattern.  Will only consider the days on the dates; not the hours and minutes.
+     *
+     *  @param mgr A ContentManager which is used to get the pages
+     *  @param baseName The basename (e.g. "Main" if you want "Main_blogentry_xxxx")
+     *  @param start The date which is the first to be considered
+     *  @param end   The end date which is the last to be considered
+     *  @return a SortedSet of pages with their FIRST revisions in reverse date order (i.e. newest first).
+     *  @throws ProviderException If something goes wrong
+     */
+    public SortedSet<WikiPage> findBlogEntriesSorted( ContentManager mgr,
+                                 String baseName, Date start, Date end )
+        throws ProviderException
+    {
+        return (SortedSet<WikiPage>)findBlogEntries( new TreeSet<WikiPage>(PageTimeComparator.DEFAULT_PAGETIME_COMPARATOR), mgr, baseName, start, end );
+    }
+
+    /**
+     *  Attempts to locate all pages that correspond to the
+     *  blog entry pattern.  Will only consider the days on the dates; not the hours and minutes.
+     *  
+     *  Ordering of the resulting pages is determined by the passed in result collection.
+     *
+     *  @param result the Collection to be filled with the resulting WikiPages
+     *  @param mgr A ContentManager which is used to get the pages
+     *  @param baseName The basename (e.g. "Main" if you want "Main_blogentry_xxxx")
+     *  @param start The date which is the first to be considered
+     *  @param end   The end date which is the last to be considered
+     *  @return the passed Collection now filled with pages with their FIRST revisions.
+     *  @throws ProviderException If something goes wrong
+     */
+    public Collection<WikiPage> findBlogEntries( Collection<WikiPage> result, ContentManager mgr,
+                                 String baseName, Date start, Date end )
+        throws ProviderException
+    {
+        result.clear();
         Collection<WikiPage> everyone = mgr.getAllPages( null );
-        ArrayList<WikiPage> result = new ArrayList<WikiPage>();
 
         baseName = makeEntryPage( baseName );
         SimpleDateFormat fmt = new SimpleDateFormat(DEFAULT_DATEFORMAT);
@@ -490,22 +528,6 @@
         return result;
     }
 
-    /**
-     *  Reverse comparison.
-     */
-    private static class PageDateComparator implements Comparator<WikiPage>
-    {
-        public int compare( WikiPage page1, WikiPage page2 )
-        {
-            if( page1 == null || page2 == null )
-            {
-                return 0;
-            }
-
-            return page2.getLastModified().compareTo( page1.getLastModified() );
-        }
-    }
-
     /** 
      *  Mark us as being a real weblog. 
      *  {@inheritDoc}
Index: src/java/org/apache/wiki/util/PageTimeComparator.java
===================================================================
--- src/java/org/apache/wiki/util/PageTimeComparator.java	(revision 770483)
+++ src/java/org/apache/wiki/util/PageTimeComparator.java	(working copy)
@@ -27,17 +27,12 @@
 import org.apache.wiki.log.Logger;
 import org.apache.wiki.log.LoggerFactory;
 
-
 /**
- *  Compares the lastModified date of its arguments.  Both o1 and o2 MUST
- *  be WikiPage objects, or else you will receive a ClassCastException.
+ *  Compares the lastModified date of two WikiPages.
  *  <p>
  *  If the lastModified date is the same, then the next key is the page name.
  *  If the page name is also equal, then returns 0 for equality.
  */
-// FIXME: Does not implement equals().
-// FIXME3.0: move to util package
-
 public class PageTimeComparator
     implements Comparator<WikiPage>, Serializable
 {
@@ -45,6 +40,9 @@
 
     static Logger log = LoggerFactory.getLogger( PageTimeComparator.class ); 
 
+    // A special singleton instance for quick access
+    public static final Comparator<WikiPage> DEFAULT_PAGETIME_COMPARATOR = new PageTimeComparator();
+
     /**
      *  {@inheritDoc}
      */
@@ -80,4 +78,21 @@
 
         return timecomparison;
     }
+    
+    /**
+     *  {@inheritDoc}
+     */
+    public boolean equals(Object o)
+    {
+        // Nothing to compare.  All PageTimeComparators are equal.
+        return (o instanceof PageTimeComparator);
+    }
+    
+    /**
+     *  {@inheritDoc}
+     */
+    public int hashcode()
+    {
+        return 864420504;
+    }
 }
Index: src/java/org/apache/wiki/xmlrpc/MetaWeblogHandler.java
===================================================================
--- src/java/org/apache/wiki/xmlrpc/MetaWeblogHandler.java	(revision 770483)
+++ src/java/org/apache/wiki/xmlrpc/MetaWeblogHandler.java	(working copy)
@@ -246,13 +246,11 @@
 
             WeblogPlugin plugin = new WeblogPlugin();
 
-            List<WikiPage> changed = plugin.findBlogEntries(m_context.getEngine().getContentManager(), 
+            SortedSet<WikiPage> changed = plugin.findBlogEntriesSorted(m_context.getEngine().getContentManager(), 
                                                             blogid,
                                                             new Date(0L),
                                                             new Date());
 
-            Collections.sort( changed, new PageTimeComparator() );
-
             int items = 0;
             for( Iterator i = changed.iterator(); i.hasNext() && items < numberOfPosts; items++ )
             {
