Index: src/java/org/apache/wiki/JCRWikiPage.java
===================================================================
--- src/java/org/apache/wiki/JCRWikiPage.java	(revision 770483)
+++ src/java/org/apache/wiki/JCRWikiPage.java	(working copy)
@@ -478,9 +478,9 @@
         return null;
     }
     
-    public Collection<WikiPath> getRefersTo() throws ProviderException
+    public List<WikiPath> getRefersTo() throws ProviderException
     {
-        Collection<WikiPath> refs = new ArrayList<WikiPath>();
+        List<WikiPath> refs = new ArrayList<WikiPath>();
         
         try
         {
Index: src/java/org/apache/wiki/ReferenceManager.java
===================================================================
--- src/java/org/apache/wiki/ReferenceManager.java	(revision 770483)
+++ src/java/org/apache/wiki/ReferenceManager.java	(working copy)
@@ -20,10 +20,7 @@
  */
 package org.apache.wiki;
 
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Set;
-import java.util.TreeSet;
+import java.util.*;
 
 import javax.jcr.*;
 
@@ -250,7 +247,7 @@
     {
         WikiPage page = m_engine.getContentManager().getPage( pageName );
         
-        Collection<WikiPath> refTo = page.getRefersTo();
+        List<WikiPath> refTo = page.getRefersTo();
 
         for( WikiPath referred : refTo )
         {
@@ -406,7 +403,7 @@
         //  Get the old refererences so that we can go and ping every page on that
         //  list and make sure that their referredBy lists are fine.
         //
-        Collection<WikiPath> oldRefersTo = page.getRefersTo();
+        List<WikiPath> oldRefersTo = page.getRefersTo();
 
         //
         //  Set up the new references list
@@ -440,9 +437,11 @@
             }
         }
         
+        // List.contains is pathologically bad so convert to HashSet for the contains check.
+        HashSet<WikiPath> oldReferences = new HashSet<WikiPath>(oldRefersTo);
         for( WikiPath name : newRefersTo )
         {
-            if( !oldRefersTo.contains(name) )
+            if( !oldReferences.contains(name) )
             {
                 // There is a new reference which is not in the old references list,
                 // so we will need to add it to the new page's referencedBy list.
Index: src/java/org/apache/wiki/api/WikiPage.java
===================================================================
--- src/java/org/apache/wiki/api/WikiPage.java	(revision 770483)
+++ src/java/org/apache/wiki/api/WikiPage.java	(working copy)
@@ -22,7 +22,6 @@
 
 import java.io.InputStream;
 import java.io.Serializable;
-import java.util.Collection;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
@@ -241,7 +240,7 @@
      *          page refers to no other pages.
      *  @throws ProviderException If the references cannot be fetched.
      */
-    public Collection<WikiPath> getRefersTo() throws ProviderException;
+    public List<WikiPath> getRefersTo() throws ProviderException;
     
     /**
      *  Returns the parent of the page. 
