Bug 857230 - Convert nsIMsgFilter::searchTerms from nsISupportsArray to nsIMutableArray. r=aceman draft
authorEric Rahm <erahm@mozilla.com>
Wed, 16 Nov 2016 12:43:32 -0800
changeset 46112 8e702457429d1e2e1be04aab270b9d74c6d325f1
parent 46110 d79dd1451227d43fb31d5f39f85ee4809e8a7f89
child 46113 23471ffea8a0cc6973536f18d3bd8c9d8c3ba56e
child 46114 934283acc0531f044e94ff75edb143a55f5bc83b
push id3996
push usermozilla@jorgk.com
push dateThu, 17 Nov 2016 00:08:30 +0000
treeherdertry-comm-central@23471ffea8a0 [default view] [failures only]
reviewersaceman
bugs857230
Bug 857230 - Convert nsIMsgFilter::searchTerms from nsISupportsArray to nsIMutableArray. r=aceman
mail/base/modules/searchSpec.js
mailnews/base/search/content/FilterEditor.js
mailnews/base/search/content/searchTermOverlay.js
mailnews/base/search/public/nsIMsgFilter.idl
mailnews/base/search/public/nsIMsgSearchSession.idl
mailnews/base/search/public/nsIMsgSearchValidityTable.idl
mailnews/base/search/public/nsMsgSearchAdapter.h
mailnews/base/search/public/nsMsgSearchScopeTerm.h
mailnews/base/search/src/nsMsgFilter.cpp
mailnews/base/search/src/nsMsgFilter.h
mailnews/base/search/src/nsMsgFilterList.cpp
mailnews/base/search/src/nsMsgFilterService.cpp
mailnews/base/search/src/nsMsgImapSearch.cpp
mailnews/base/search/src/nsMsgLocalSearch.cpp
mailnews/base/search/src/nsMsgLocalSearch.h
mailnews/base/search/src/nsMsgSearchAdapter.cpp
mailnews/base/search/src/nsMsgSearchImap.h
mailnews/base/search/src/nsMsgSearchNews.cpp
mailnews/base/search/src/nsMsgSearchNews.h
mailnews/base/search/src/nsMsgSearchSession.cpp
mailnews/base/search/src/nsMsgSearchSession.h
mailnews/base/search/src/nsMsgSearchTerm.cpp
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp
mailnews/base/src/virtualFolderWrapper.js
mailnews/base/util/nsMsgIncomingServer.cpp
mailnews/base/util/nsMsgUtils.cpp
mailnews/base/util/nsMsgUtils.h
mailnews/extensions/mailviews/public/nsIMsgMailView.idl
mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
mailnews/extensions/mailviews/src/nsMsgMailViewList.h
mailnews/imap/src/nsImapMailFolder.cpp
suite/mailnews/commandglue.js
suite/mailnews/msgViewPickerOverlay.js
suite/mailnews/searchBar.js
--- a/mail/base/modules/searchSpec.js
+++ b/mail/base/modules/searchSpec.js
@@ -356,17 +356,17 @@ SearchSpec.prototype = {
    *  userTerms.  The way this works is that each of the 'context' sets of
    *  terms gets wrapped into a group which is boolean anded together with
    *  everything else.
    */
   updateSession: function SearchSpec_applySearch() {
     let session = this.session;
 
     // clear out our current terms and scope
-    session.searchTerms.QueryInterface(Ci.nsISupportsArray).Clear();
+    session.searchTerms.QueryInterface(Ci.nsIMutableArray).clear();
     session.clearScopes();
 
     // the scope logic needs to know if any terms look at the body attribute.
     let haveBodyTerm = false;
 
     // -- apply terms
     if (this._virtualFolderTerms) {
       for (let term in fixIterator(this._virtualFolderTerms,
--- a/mailnews/base/search/content/FilterEditor.js
+++ b/mailnews/base/search/content/FilterEditor.js
@@ -134,17 +134,17 @@ function filterEditorOnLoad()
         {
           let filterAction = copiedFilter.getActionAt(i);
           newFilter.appendAction(filterAction);
         }
 
         // copy the search terms
         for (let i = 0; i < copiedFilter.searchTerms.Count(); i++)
         {
-          var searchTerm = copiedFilter.searchTerms.QueryElementAt(i,
+          var searchTerm = copiedFilter.searchTerms.queryElementAt(i,
             Components.interfaces.nsIMsgSearchTerm);
 
           var newTerm = newFilter.createTerm();
           newTerm.attrib = searchTerm.attrib;
           newTerm.op = searchTerm.op;
           newTerm.booleanAnd = searchTerm.booleanAnd;
           newTerm.value = searchTerm.value;
           newFilter.appendTerm(newTerm);
--- a/mailnews/base/search/content/searchTermOverlay.js
+++ b/mailnews/base/search/content/searchTermOverlay.js
@@ -169,17 +169,17 @@ function initializeBooleanWidgets()
     var searchTerms = document.getElementById("searchTermList");
     if (searchTerms)
       updateSearchTermsListbox(matchAll);
 }
 
 function initializeSearchRows(scope, searchTerms)
 {
     for (var i = 0; i < searchTerms.Count(); i++) {
-        var searchTerm = searchTerms.QueryElementAt(i, nsIMsgSearchTerm);
+        var searchTerm = searchTerms.queryElementAt(i, nsIMsgSearchTerm);
         createSearchRow(i, scope, searchTerm, false);
         gTotalSearchTerms++;
     }
     initializeBooleanWidgets();
     updateRemoveRowButton();
 }
 
 /**
@@ -477,17 +477,17 @@ function removeSearchRow(index)
 
     listitem.remove();
     
     // now remove the item from our list of terms
     gSearchTerms.splice(index, 1); 
 }
 
 // save the search terms from the UI back to the actual search terms
-// searchTerms: nsISupportsArray of terms
+// searchTerms: nsIMutableArray of terms
 // termOwner:   object which can contain and create the terms
 //              (will be unnecessary if we just make terms creatable
 //               via XPCOM)
 function saveSearchTerms(searchTerms, termOwner)
 {
     var matchAll = gSearchBooleanRadiogroup.value == 'matchAll';
     var i;
     for (i = 0; i < gSearchRemovedTerms.length; i++)
--- a/mailnews/base/search/public/nsIMsgFilter.idl
+++ b/mailnews/base/search/public/nsIMsgFilter.idl
@@ -1,26 +1,17 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "nsISupports.idl"
 #include "nsMsgFilterCore.idl"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-%{C++
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-%}
-interface nsISupportsArray;
+interface nsIMutableArray;
 
 interface nsIArray;
 interface nsIOutputStream;
 interface nsIMsgFilterCustomAction;
 interface nsIMsgFilterList;
 interface nsIMsgSearchScopeTerm;
 interface nsIMsgSearchValue;
 interface nsIMsgSearchTerm;
@@ -82,17 +73,17 @@ interface nsIMsgFilter : nsISupports {
                  out nsIMsgSearchValue value, // bad! using shared structure
                  out boolean BooleanAND,
                  out ACString arbitraryHeader);
 
     void appendTerm(in nsIMsgSearchTerm term);
 
     nsIMsgSearchTerm createTerm();
 
-    attribute nsISupportsArray searchTerms;
+    attribute nsIMutableArray searchTerms;
 
     attribute nsIMsgSearchScopeTerm scope;
 
     // Marking noscript because "headers" is actually a null-separated
     // list of headers, which is not scriptable.
     [noscript] void MatchHdr(in nsIMsgDBHdr msgHdr, in nsIMsgFolder folder,
                   in nsIMsgDatabase db,
                   in string headers,
--- a/mailnews/base/search/public/nsIMsgSearchSession.idl
+++ b/mailnews/base/search/public/nsIMsgSearchSession.idl
@@ -6,26 +6,17 @@
 #include "nsISupports.idl"
 #include "nsIMsgSearchValue.idl"
 
 interface nsIMsgSearchAdapter;
 interface nsIMsgSearchTerm;
 interface nsIMsgSearchNotify;
 interface nsIMsgHdr;
 interface nsIMsgDatabase;
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-%{C++
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-%}
-interface nsISupportsArray;
+interface nsIMutableArray;
 interface nsIMsgWindow;
 
 //////////////////////////////////////////////////////////////////////////////
 // The Msg Search Session is an interface designed to make constructing
 // searches easier. Clients typically build up search terms, and then run
 // the search
 //////////////////////////////////////////////////////////////////////////////
 
@@ -45,17 +36,17 @@ interface nsIMsgSearchSession :  nsISupp
  *                        otherwise ignored
  */
   void addSearchTerm(in nsMsgSearchAttribValue attrib,
                      in nsMsgSearchOpValue op,
                      in nsIMsgSearchValue value,
                      in boolean BooleanAND,
                      in string customString);
 
-  readonly attribute nsISupportsArray searchTerms;
+  readonly attribute nsIMutableArray searchTerms;
 
   nsIMsgSearchTerm createTerm ();
   void appendTerm(in nsIMsgSearchTerm term);
 
   /**
    * @name Search notification flags
    * These flags determine which notifications will be sent.
    * @{
--- a/mailnews/base/search/public/nsIMsgSearchValidityTable.idl
+++ b/mailnews/base/search/public/nsIMsgSearchValidityTable.idl
@@ -1,25 +1,16 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 #include "nsMsgSearchCore.idl"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-%{C++
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-%}
-interface nsISupportsArray;
+interface nsIArray;
 
 [scriptable, uuid(b07f1cb6-fae9-4d92-9edb-03f9ad249c66)]
 interface nsIMsgSearchValidityTable : nsISupports {
 
     void setAvailable(in nsMsgSearchAttribValue attrib,
                       in nsMsgSearchOpValue op, in boolean active);
     void setEnabled(in nsMsgSearchAttribValue attrib,
                     in nsMsgSearchOpValue op, in boolean enabled);
@@ -28,17 +19,17 @@ interface nsIMsgSearchValidityTable : ns
 
     boolean getAvailable(in nsMsgSearchAttribValue attrib,
                          in nsMsgSearchOpValue op);
     boolean getEnabled(in nsMsgSearchAttribValue attrib,
                        in nsMsgSearchOpValue op);
     boolean getValidButNotShown(in nsMsgSearchAttribValue attrib,
                                 in nsMsgSearchOpValue op);
 
-    [noscript] void validateTerms(in nsISupportsArray terms);
+    [noscript] void validateTerms(in nsIArray terms);
 
     readonly attribute long numAvailAttribs;
 
     void getAvailableAttributes(out unsigned long length,
                                 [retval, array, size_is(length)]
                                 out nsMsgSearchAttribValue attrs);
 
     void getAvailableOperators(in nsMsgSearchAttribValue attrib,
--- a/mailnews/base/search/public/nsMsgSearchAdapter.h
+++ b/mailnews/base/search/public/nsMsgSearchAdapter.h
@@ -24,30 +24,30 @@ class nsIMsgSearchScopeTerm;
 //
 // There is a separate Adapter class for area (pop, imap, nntp, ldap) to contain
 // the special smarts for that protocol.
 //-----------------------------------------------------------------------------
 
 class nsMsgSearchAdapter : public nsIMsgSearchAdapter
 {
 public:
-  nsMsgSearchAdapter (nsIMsgSearchScopeTerm*, nsISupportsArray *);
+  nsMsgSearchAdapter (nsIMsgSearchScopeTerm*, nsIArray *);
 
   NS_DECL_ISUPPORTS
   NS_DECL_NSIMSGSEARCHADAPTER
 
   nsIMsgSearchScopeTerm        *m_scope;
-  nsCOMPtr<nsISupportsArray>  m_searchTerms;       /* linked list of criteria terms */
+  nsCOMPtr<nsIArray>  m_searchTerms;       /* linked list of criteria terms */
 
   bool m_abortCalled;
   nsString  m_defaultCharset;
   bool m_forceAsciiSearch;
 
   static nsresult EncodeImap (char **ppEncoding,
-           nsISupportsArray *searchTerms,
+           nsIArray *searchTerms,
            const char16_t *srcCharset,
            const char16_t *destCharset,
            bool reallyDredd = false);
 
   static nsresult EncodeImapValue(char *encoding, const char *value, bool useQuotes, bool reallyDredd);
 
   static char *GetImapCharsetParam(const char16_t *destCharset);
   static char16_t *EscapeSearchUrl (const char16_t *nntpCommand);
--- a/mailnews/base/search/public/nsMsgSearchScopeTerm.h
+++ b/mailnews/base/search/public/nsMsgSearchScopeTerm.h
@@ -21,17 +21,17 @@ class nsMsgSearchScopeTerm : public nsIM
 public:
   nsMsgSearchScopeTerm (nsIMsgSearchSession *, nsMsgSearchScopeValue, nsIMsgFolder *);
   nsMsgSearchScopeTerm ();
   
   NS_DECL_ISUPPORTS
   NS_DECL_NSIMSGSEARCHSCOPETERM
     
   nsresult TimeSlice (bool *aDone);
-  nsresult InitializeAdapter (nsISupportsArray *termList);
+  nsresult InitializeAdapter (nsIArray *termList);
   
   char *GetStatusBarName ();
   
   nsMsgSearchScopeValue m_attribute;
   char *m_name;
   nsCOMPtr <nsIMsgFolder> m_folder;
   nsCOMPtr <nsIMsgSearchAdapter> m_adapter;
   nsCOMPtr <nsIInputStream> m_inputStream; // for message bodies
--- a/mailnews/base/search/src/nsMsgFilter.cpp
+++ b/mailnews/base/search/src/nsMsgFilter.cpp
@@ -1,34 +1,35 @@
 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // this file implements the nsMsgFilter interface
 
 #include "msgCore.h"
+#include "nsArray.h"
 #include "nsMsgBaseCID.h"
 #include "nsIMsgHdr.h"
 #include "nsMsgFilterList.h"    // for kFileVersion
 #include "nsMsgFilter.h"
 #include "nsMsgUtils.h"
 #include "nsMsgLocalSearch.h"
 #include "nsMsgSearchTerm.h"
 #include "nsIMsgAccountManager.h"
 #include "nsIMsgIncomingServer.h"
 #include "nsMsgSearchValue.h"
 #include "nsMsgI18N.h"
+#include "nsIMutableArray.h"
 #include "nsIOutputStream.h"
 #include "nsIStringBundle.h"
 #include "nsDateTimeFormatCID.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsIMsgFilterService.h"
-#include "nsIMutableArray.h"
 #include "prmem.h"
 #include "mozilla/ArrayUtils.h"
 #include "mozilla/Services.h"
 
 static const char *kImapPrefix = "//imap:";
 static const char *kWhitespace = "\b\t\r\n ";
 
 nsMsgRuleAction::nsMsgRuleAction()
@@ -167,19 +168,19 @@ NS_IMETHODIMP nsMsgRuleAction::GetCustom
 }
 
 nsMsgFilter::nsMsgFilter():
     m_temporary(false),
     m_unparseable(false),
     m_filterList(nullptr),
     m_expressionTree(nullptr)
 {
-  nsresult rv = NS_NewISupportsArray(getter_AddRefs(m_termList));
-  if (NS_FAILED(rv))
-    NS_ASSERTION(false, "Failed to allocate a nsISupportsArray for nsMsgFilter");
+  m_termList = nsArray::Create();
+  if (!m_termList)
+    NS_ASSERTION(false, "Failed to allocate a nsIArray for nsMsgFilter");
 
   m_type = nsMsgFilterType::InboxRule | nsMsgFilterType::Manual;
 }
 
 nsMsgFilter::~nsMsgFilter()
 {
   delete m_expressionTree;
 }
@@ -240,17 +241,17 @@ NS_IMETHODIMP nsMsgFilter::AddTerm(
 }
 
 NS_IMETHODIMP nsMsgFilter::AppendTerm(nsIMsgSearchTerm * aTerm)
 {
     NS_ENSURE_TRUE(aTerm, NS_ERROR_NULL_POINTER);
     // invalidate expression tree if we're changing the terms
     delete m_expressionTree;
     m_expressionTree = nullptr;
-    return m_termList->AppendElement(static_cast<nsISupports*>(aTerm));
+    return m_termList->AppendElement(static_cast<nsISupports*>(aTerm), /* weak = */ false);
 }
 
 NS_IMETHODIMP
 nsMsgFilter::CreateTerm(nsIMsgSearchTerm **aResult)
 {
     NS_ENSURE_ARG_POINTER(aResult);
     nsMsgSearchTerm *term = new nsMsgSearchTerm;
     NS_ENSURE_TRUE(term, NS_ERROR_OUT_OF_MEMORY);
@@ -437,27 +438,27 @@ NS_IMETHODIMP nsMsgFilter::GetTerm(int32
       term->GetBooleanAnd(booleanAnd);
     if (attrib && *attrib > nsMsgSearchAttrib::OtherHeader
         && *attrib < nsMsgSearchAttrib::kNumMsgSearchAttributes)
       term->GetArbitraryHeader(arbitraryHeader);
   }
   return NS_OK;
 }
 
-NS_IMETHODIMP nsMsgFilter::GetSearchTerms(nsISupportsArray **aResult)
+NS_IMETHODIMP nsMsgFilter::GetSearchTerms(nsIMutableArray **aResult)
 {
     NS_ENSURE_ARG_POINTER(aResult);
     // caller can change m_termList, which can invalidate m_expressionTree.
     delete m_expressionTree;
     m_expressionTree = nullptr;
     NS_IF_ADDREF(*aResult = m_termList);
     return NS_OK;
 }
 
-NS_IMETHODIMP nsMsgFilter::SetSearchTerms(nsISupportsArray *aSearchList)
+NS_IMETHODIMP nsMsgFilter::SetSearchTerms(nsIMutableArray *aSearchList)
 {
     delete m_expressionTree;
     m_expressionTree = nullptr;
     m_termList = aSearchList;
     return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgFilter::SetScope(nsIMsgSearchScopeTerm *aResult)
--- a/mailnews/base/search/src/nsMsgFilter.h
+++ b/mailnews/base/search/src/nsMsgFilter.h
@@ -6,16 +6,17 @@
 #ifndef _nsMsgFilter_H_
 #define _nsMsgFilter_H_
 
 #include "nscore.h"
 #include "nsISupports.h"
 #include "nsIMsgFilter.h"
 #include "nsIMsgSearchScopeTerm.h"
 #include "nsMsgSearchBoolExpression.h"
+#include "nsIMutableArray.h"
 #include "nsIDateTimeFormat.h"
 #include "nsIMsgFilterCustomAction.h"
 
 class nsMsgRuleAction : public nsIMsgRuleAction
 {
 public:
   NS_DECL_ISUPPORTS
 
@@ -87,17 +88,17 @@ protected:
   nsCString   m_scriptFileName;  // iff this filter is a script.
   nsCString   m_description;
   nsCString   m_unparsedBuffer;
 
   bool m_enabled;
   bool m_temporary;
   bool m_unparseable;
   nsIMsgFilterList *m_filterList;  /* owning filter list */
-  nsCOMPtr<nsISupportsArray> m_termList;       /* linked list of criteria terms */
+  nsCOMPtr<nsIMutableArray> m_termList;       /* linked list of criteria terms */
   nsCOMPtr<nsIMsgSearchScopeTerm> m_scope;         /* default for mail rules is inbox, but news rules could
                                                   have a newsgroup - LDAP would be invalid */
   nsTArray<nsCOMPtr<nsIMsgRuleAction> > m_actionList;
   nsMsgSearchBoolExpression *m_expressionTree;
   nsCOMPtr<nsIDateTimeFormat> mDateFormatter;
 };
 
 #endif
--- a/mailnews/base/search/src/nsMsgFilterList.cpp
+++ b/mailnews/base/search/src/nsMsgFilterList.cpp
@@ -1141,17 +1141,17 @@ nsresult nsMsgFilterList::ComputeArbitra
   nsCOMPtr<nsIMsgFilter> filter;
   nsMsgSearchAttribValue attrib;
   nsCString arbitraryHeader;
   for (uint32_t index = 0; index < numFilters; index++)
   {
     rv = GetFilterAt(index, getter_AddRefs(filter));
     if (!(NS_SUCCEEDED(rv) && filter)) continue;
 
-    nsCOMPtr <nsISupportsArray> searchTerms;
+    nsCOMPtr <nsIMutableArray> searchTerms;
     uint32_t numSearchTerms=0;
     filter->GetSearchTerms(getter_AddRefs(searchTerms));
     if (searchTerms)
       searchTerms->Count(&numSearchTerms);
     for (uint32_t i = 0; i < numSearchTerms; i++)
     {
       filter->GetTerm(i, &attrib, nullptr, nullptr, nullptr, arbitraryHeader);
       if (!arbitraryHeader.IsEmpty())
--- a/mailnews/base/search/src/nsMsgFilterService.cpp
+++ b/mailnews/base/search/src/nsMsgFilterService.cpp
@@ -378,17 +378,17 @@ nsresult nsMsgFilterAfterTheFact::RunNex
   {
     m_curFilter = nullptr;
     if (m_curFilterIndex >= m_numFilters)
       break;
     BREAK_IF_FALSE(m_filters, "Missing filters");
     rv = m_filters->GetFilterAt(m_curFilterIndex++, getter_AddRefs(m_curFilter));
     CONTINUE_IF_FAILURE(rv, "Could not get filter at index");
 
-    nsCOMPtr <nsISupportsArray> searchTerms;
+    nsCOMPtr <nsIMutableArray> searchTerms;
     rv = m_curFilter->GetSearchTerms(getter_AddRefs(searchTerms));
     CONTINUE_IF_FAILURE(rv, "Could not get searchTerms");
 
     if (m_searchSession)
       m_searchSession->UnregisterListener(this);
     m_searchSession = do_CreateInstance(NS_MSGSEARCHSESSION_CONTRACTID, &rv);
     BREAK_IF_FAILURE(rv, "Failed to get search session");
 
--- a/mailnews/base/search/src/nsMsgImapSearch.cpp
+++ b/mailnews/base/search/src/nsMsgImapSearch.cpp
@@ -5,28 +5,21 @@
 #include "msgCore.h"
 #include "nsMsgSearchAdapter.h"
 #include "nsMsgSearchScopeTerm.h"
 #include "nsMsgResultElement.h"
 #include "nsMsgSearchTerm.h"
 #include "nsIMsgHdr.h"
 #include "nsMsgSearchImap.h"
 #include "prmem.h"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-#include "nsISupportsArray.h"
+#include "nsIArray.h"
 // Implementation of search for IMAP mail folders
 
 
-nsMsgSearchOnlineMail::nsMsgSearchOnlineMail (nsMsgSearchScopeTerm *scope, nsISupportsArray *termList) : nsMsgSearchAdapter (scope, termList)
+nsMsgSearchOnlineMail::nsMsgSearchOnlineMail (nsMsgSearchScopeTerm *scope, nsIArray *termList) : nsMsgSearchAdapter (scope, termList)
 {
 }
 
 
 nsMsgSearchOnlineMail::~nsMsgSearchOnlineMail () 
 {
 }
 
@@ -78,29 +71,29 @@ nsresult nsMsgSearchOnlineMail::Search (
     // we should never end up here for a purely online
     // folder.  We might for an offline IMAP folder.
     nsresult err = NS_ERROR_NOT_IMPLEMENTED;
 
     return err;
 }
 
 nsresult nsMsgSearchOnlineMail::Encode (nsCString& pEncoding,
-                                        nsISupportsArray *searchTerms,
+                                        nsIArray *searchTerms,
                                         const char16_t *destCharset)
 {
   nsCString imapTerms;
   
   //check if searchTerms are ascii only
   bool asciiOnly = true;
   // ### what's this mean in the NWO?????
   
   if (true) // !(srcCharset & CODESET_MASK == STATEFUL || srcCharset & CODESET_MASK == WIDECHAR) )   //assume all single/multiple bytes charset has ascii as subset
   {
     uint32_t termCount;
-    searchTerms->Count(&termCount);
+    searchTerms->GetLength(&termCount);
     uint32_t i = 0;
     
     for (i = 0; i < termCount && asciiOnly; i++)
     {
       nsCOMPtr<nsIMsgSearchTerm> pTerm;
       searchTerms->QueryElementAt(i, NS_GET_IID(nsIMsgSearchTerm),
         (void **)getter_AddRefs(pTerm));
       
--- a/mailnews/base/search/src/nsMsgLocalSearch.cpp
+++ b/mailnews/base/search/src/nsMsgLocalSearch.cpp
@@ -9,24 +9,17 @@
 #include "nsIMsgDatabase.h"
 #include "nsMsgSearchCore.h"
 #include "nsMsgLocalSearch.h"
 #include "nsIStreamListener.h"
 #include "nsMsgSearchBoolExpression.h"
 #include "nsMsgSearchTerm.h"
 #include "nsMsgResultElement.h"
 #include "nsIDBFolderInfo.h"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-#include "nsISupportsArray.h"
+#include "nsIArray.h"
 #include "nsMsgBaseCID.h"
 #include "nsMsgSearchValue.h"
 #include "nsIMsgLocalMailFolder.h"
 #include "nsIMsgWindow.h"
 #include "nsIMsgHdr.h"
 #include "nsIMsgFilterPlugin.h"
 #include "nsMsgMessageFlags.h"
 #include "nsMsgUtils.h"
@@ -232,17 +225,17 @@ void nsMsgSearchBoolExpression::Generate
 
 //-----------------------------------------------------------------------------
 //---------------- Adapter class for searching offline folders ----------------
 //-----------------------------------------------------------------------------
 
 
 NS_IMPL_ISUPPORTS_INHERITED(nsMsgSearchOfflineMail, nsMsgSearchAdapter, nsIUrlListener)
 
-nsMsgSearchOfflineMail::nsMsgSearchOfflineMail (nsIMsgSearchScopeTerm *scope, nsISupportsArray *termList) : nsMsgSearchAdapter (scope, termList)
+nsMsgSearchOfflineMail::nsMsgSearchOfflineMail (nsIMsgSearchScopeTerm *scope, nsIArray *termList) : nsMsgSearchAdapter (scope, termList)
 {
 }
 
 nsMsgSearchOfflineMail::~nsMsgSearchOfflineMail ()
 {
   // Database should have been closed when the scope term finished.
   CleanUpScope();
   NS_ASSERTION(!m_db, "db not closed");
@@ -305,43 +298,43 @@ nsresult nsMsgSearchOfflineMail::OpenSum
     }
 
     return err;
 }
 
 
 nsresult
 nsMsgSearchOfflineMail::MatchTermsForFilter(nsIMsgDBHdr *msgToMatch,
-                                            nsISupportsArray *termList,
+                                            nsIArray *termList,
                                             const char *defaultCharset,
                                             nsIMsgSearchScopeTerm * scope,
                                             nsIMsgDatabase * db,
                                             const char * headers,
                                             uint32_t headerSize,
                                             nsMsgSearchBoolExpression ** aExpressionTree,
                                             bool *pResult)
 {
     return MatchTerms(msgToMatch, termList, defaultCharset, scope, db, headers, headerSize, true, aExpressionTree, pResult);
 }
 
 // static method which matches a header against a list of search terms.
 nsresult
 nsMsgSearchOfflineMail::MatchTermsForSearch(nsIMsgDBHdr *msgToMatch,
-                                            nsISupportsArray* termList,
+                                            nsIArray* termList,
                                             const char *defaultCharset,
                                             nsIMsgSearchScopeTerm *scope,
                                             nsIMsgDatabase *db,
                                             nsMsgSearchBoolExpression ** aExpressionTree,
                                             bool *pResult)
 {
 
     return MatchTerms(msgToMatch, termList, defaultCharset, scope, db, nullptr, 0, false, aExpressionTree, pResult);
 }
 
-nsresult nsMsgSearchOfflineMail::ConstructExpressionTree(nsISupportsArray * termList,
+nsresult nsMsgSearchOfflineMail::ConstructExpressionTree(nsIArray * termList,
                                             uint32_t termCount,
                                             uint32_t &aStartPosInList,
                                             nsMsgSearchBoolExpression ** aExpressionTree)
 {
   nsMsgSearchBoolExpression * finalExpression = *aExpressionTree;
 
   if (!finalExpression)
     finalExpression = new nsMsgSearchBoolExpression();
@@ -659,34 +652,34 @@ nsresult nsMsgSearchOfflineMail::Process
           }
     }
 
     *pResult = result;
     return err;
 }
 
 nsresult nsMsgSearchOfflineMail::MatchTerms(nsIMsgDBHdr *msgToMatch,
-                                            nsISupportsArray * termList,
+                                            nsIArray * termList,
                                             const char *defaultCharset,
                                             nsIMsgSearchScopeTerm * scope,
                                             nsIMsgDatabase * db,
                                             const char * headers,
                                             uint32_t headerSize,
                                             bool Filtering,
                                             nsMsgSearchBoolExpression ** aExpressionTree,
                                             bool *pResult)
 {
   NS_ENSURE_ARG(aExpressionTree);
   nsresult err;
 
   if (!*aExpressionTree)
   {
     uint32_t initialPos = 0;
     uint32_t count;
-    termList->Count(&count);
+    termList->GetLength(&count);
     err = ConstructExpressionTree(termList, count, initialPos, aExpressionTree);
     if (NS_FAILED(err))
       return err;
   }
 
   // evaluate the expression tree and return the result
   *pResult = (*aExpressionTree)
     ?  (*aExpressionTree)->OfflineEvaluate(msgToMatch,
@@ -819,17 +812,17 @@ NS_IMETHODIMP nsMsgSearchOfflineMail::On
   if (m_scope)
     m_scope->GetSearchSession(getter_AddRefs(searchSession));
   if (searchSession)
     searchSession->ResumeSearch();
 
   return NS_OK;
 }
 
-nsMsgSearchOfflineNews::nsMsgSearchOfflineNews (nsIMsgSearchScopeTerm *scope, nsISupportsArray *termList) : nsMsgSearchOfflineMail (scope, termList)
+nsMsgSearchOfflineNews::nsMsgSearchOfflineNews (nsIMsgSearchScopeTerm *scope, nsIArray *termList) : nsMsgSearchOfflineMail (scope, termList)
 {
 }
 
 
 nsMsgSearchOfflineNews::~nsMsgSearchOfflineNews ()
 {
 }
 
--- a/mailnews/base/search/src/nsMsgLocalSearch.h
+++ b/mailnews/base/search/src/nsMsgLocalSearch.h
@@ -19,39 +19,39 @@
 class nsIMsgDBHdr;
 class nsIMsgSearchScopeTerm;
 class nsIMsgFolder;
 class nsMsgSearchBoolExpression;
 
 class nsMsgSearchOfflineMail : public nsMsgSearchAdapter, public nsIUrlListener
 {
 public:
-  nsMsgSearchOfflineMail (nsIMsgSearchScopeTerm*, nsISupportsArray *);
+  nsMsgSearchOfflineMail (nsIMsgSearchScopeTerm*, nsIArray *);
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIURLLISTENER
 
   NS_IMETHOD ValidateTerms () override;
   NS_IMETHOD Search (bool *aDone) override;
   NS_IMETHOD Abort () override;
   NS_IMETHOD AddResultElement (nsIMsgDBHdr *) override;
 
   static nsresult  MatchTermsForFilter(nsIMsgDBHdr * msgToMatch,
-                                         nsISupportsArray *termList,
+                                         nsIArray *termList,
                                          const char *defaultCharset,
                                          nsIMsgSearchScopeTerm *scope,
                                          nsIMsgDatabase * db,
                                          const char * headers,
                                          uint32_t headerSize,
                                          nsMsgSearchBoolExpression ** aExpressionTree,
                      bool *pResult);
 
   static nsresult MatchTermsForSearch(nsIMsgDBHdr * msgTomatch,
-                                      nsISupportsArray * termList,
+                                      nsIArray * termList,
                                       const char *defaultCharset,
                                       nsIMsgSearchScopeTerm *scope,
                                       nsIMsgDatabase *db,
                                       nsMsgSearchBoolExpression ** aExpressionTree,
  bool *pResult);
 
   virtual nsresult OpenSummaryFile ();
 
@@ -62,41 +62,41 @@ public:
                                nsIMsgDatabase * db,
                                const char * headers,
                                uint32_t headerSize,
                                bool Filtering,
                  bool *pResult);
 protected:
   virtual ~nsMsgSearchOfflineMail();
   static nsresult MatchTerms(nsIMsgDBHdr *msgToMatch,
-                                nsISupportsArray *termList,
+                                nsIArray *termList,
                                 const char *defaultCharset,
                                 nsIMsgSearchScopeTerm *scope,
                                 nsIMsgDatabase * db,
                                 const char * headers,
                                 uint32_t headerSize,
                                 bool ForFilters,
                                 nsMsgSearchBoolExpression ** aExpressionTree,
                 bool *pResult);
 
-    static nsresult ConstructExpressionTree(nsISupportsArray * termList,
+    static nsresult ConstructExpressionTree(nsIArray * termList,
                                       uint32_t termCount,
                                       uint32_t &aStartPosInList,
                                       nsMsgSearchBoolExpression ** aExpressionTree);
 
   nsCOMPtr <nsIMsgDatabase> m_db;
   nsCOMPtr<nsISimpleEnumerator> m_listContext;
   void CleanUpScope();
 };
 
 
 class nsMsgSearchOfflineNews : public nsMsgSearchOfflineMail
 {
 public:
-  nsMsgSearchOfflineNews (nsIMsgSearchScopeTerm*, nsISupportsArray *);
+  nsMsgSearchOfflineNews (nsIMsgSearchScopeTerm*, nsIArray *);
   virtual ~nsMsgSearchOfflineNews ();
   NS_IMETHOD ValidateTerms () override;
 
   virtual nsresult OpenSummaryFile () override;
 };
 
 
 
--- a/mailnews/base/search/src/nsMsgSearchAdapter.cpp
+++ b/mailnews/base/search/src/nsMsgSearchAdapter.cpp
@@ -19,24 +19,17 @@
 #include "prprf.h"
 #include "mozilla/UniquePtr.h"
 #include "prmem.h"
 #include "MailNewsTypes.h"
 #include "nsComponentManagerUtils.h"
 #include "nsServiceManagerUtils.h"
 #include "nsMemory.h"
 #include "nsMsgMessageFlags.h"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-#include "nsISupportsArray.h"
+#include "nsIArray.h"
 #include "nsAlgorithm.h"
 #include <algorithm>
 #include "mozilla/Attributes.h"
 
 // This stuff lives in the base class because the IMAP search syntax
 // is used by the Dredd SEARCH command as well as IMAP itself
 
 // km - the NOT and HEADER strings are not encoded with a trailing
@@ -84,17 +77,17 @@ NS_IMETHODIMP nsMsgSearchAdapter::Modify
 
 NS_IMETHODIMP nsMsgSearchAdapter::OpenResultElement(nsMsgResultElement *)
 {
   return NS_ERROR_NOT_IMPLEMENTED;
 }
 
 NS_IMPL_ISUPPORTS(nsMsgSearchAdapter, nsIMsgSearchAdapter)
 
-nsMsgSearchAdapter::nsMsgSearchAdapter(nsIMsgSearchScopeTerm *scope, nsISupportsArray *searchTerms)
+nsMsgSearchAdapter::nsMsgSearchAdapter(nsIMsgSearchScopeTerm *scope, nsIArray *searchTerms)
   : m_searchTerms(searchTerms)
 {
   m_scope = scope;
 }
 
 nsMsgSearchAdapter::~nsMsgSearchAdapter()
 {
 }
@@ -662,26 +655,26 @@ nsresult nsMsgSearchAdapter::EncodeImapV
   PL_strcat (encoding, value);
   if (useQuotes)
     PL_strcat(encoding, "\"");
 
   return NS_OK;
 }
 
 
-nsresult nsMsgSearchAdapter::EncodeImap (char **ppOutEncoding, nsISupportsArray *searchTerms, const char16_t *srcCharset, const char16_t *destCharset, bool reallyDredd)
+nsresult nsMsgSearchAdapter::EncodeImap (char **ppOutEncoding, nsIArray *searchTerms, const char16_t *srcCharset, const char16_t *destCharset, bool reallyDredd)
 {
   // i've left the old code (before using CBoolExpression for debugging purposes to make sure that
   // the new code generates the same encoding string as the old code.....
 
   nsresult err = NS_OK;
   *ppOutEncoding = nullptr;
 
   uint32_t termCount;
-  searchTerms->Count(&termCount);
+  searchTerms->GetLength(&termCount);
   uint32_t i = 0;
 
   // create our expression
   nsMsgSearchBoolExpression * expression = new nsMsgSearchBoolExpression();
   if (!expression)
     return NS_ERROR_OUT_OF_MEMORY;
 
   for (i = 0; i < termCount && NS_SUCCEEDED(err); i++)
@@ -818,24 +811,24 @@ nsMsgSearchValidityTable::GetNumAvailAtt
         break;
       }
         }
   *aResult = m_numAvailAttribs;
     return NS_OK;
 }
 
 nsresult
-nsMsgSearchValidityTable::ValidateTerms (nsISupportsArray *searchTerms)
+nsMsgSearchValidityTable::ValidateTerms (nsIArray *searchTerms)
 {
   nsresult err = NS_OK;
   uint32_t count;
 
   NS_ENSURE_ARG(searchTerms);
 
-  searchTerms->Count(&count);
+  searchTerms->GetLength(&count);
   for (uint32_t i = 0; i < count; i++)
   {
     nsCOMPtr<nsIMsgSearchTerm> pTerm;
     searchTerms->QueryElementAt(i, NS_GET_IID(nsIMsgSearchTerm),
                              (void **)getter_AddRefs(pTerm));
 
     nsIMsgSearchTerm *iTerm = pTerm;
     nsMsgSearchTerm *term = static_cast<nsMsgSearchTerm *>(iTerm);
--- a/mailnews/base/search/src/nsMsgSearchImap.h
+++ b/mailnews/base/search/src/nsMsgSearchImap.h
@@ -9,26 +9,26 @@
 
 //-----------------------------------------------------------------------------
 //---------- Adapter class for searching online (IMAP) folders ----------------
 //-----------------------------------------------------------------------------
 
 class nsMsgSearchOnlineMail : public nsMsgSearchAdapter
 {
 public:
-  nsMsgSearchOnlineMail (nsMsgSearchScopeTerm *scope, nsISupportsArray *termList);
+  nsMsgSearchOnlineMail (nsMsgSearchScopeTerm *scope, nsIArray *termList);
   virtual ~nsMsgSearchOnlineMail ();
 
   NS_IMETHOD ValidateTerms () override;
   NS_IMETHOD Search (bool *aDone) override;
   NS_IMETHOD GetEncoding (char **result) override;
   NS_IMETHOD AddResultElement (nsIMsgDBHdr *) override;
 
   static nsresult Encode (nsCString& ppEncoding,
-                            nsISupportsArray *searchTerms,
+                            nsIArray *searchTerms,
                             const char16_t *destCharset);
 
 
 protected:
   nsCString m_encoding;
 };
 
 
--- a/mailnews/base/search/src/nsMsgSearchNews.cpp
+++ b/mailnews/base/search/src/nsMsgSearchNews.cpp
@@ -10,24 +10,17 @@
 #include "nsMsgSearchTerm.h"
 #include "nsIMsgHdr.h"
 #include "nsMsgSearchNews.h"
 #include "nsIDBFolderInfo.h"
 #include "prprf.h"
 #include "nsIMsgDatabase.h"
 #include "nsMemory.h"
 #include <ctype.h>
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-#include "nsISupportsArray.h"
+#include "nsIArray.h"
 
 // Implementation of search for IMAP mail folders
 
 
 // Implementation of search for newsgroups
 
 
 //-----------------------------------------------------------------------------
@@ -35,17 +28,17 @@
 //-----------------------------------------------------------------------------
 
 
 const char *nsMsgSearchNews::m_kNntpFrom = "FROM ";
 const char *nsMsgSearchNews::m_kNntpSubject = "SUBJECT ";
 const char *nsMsgSearchNews::m_kTermSeparator = "/";
 
 
-nsMsgSearchNews::nsMsgSearchNews (nsMsgSearchScopeTerm *scope, nsISupportsArray *termList) : nsMsgSearchAdapter (scope, termList)
+nsMsgSearchNews::nsMsgSearchNews (nsMsgSearchScopeTerm *scope, nsIArray *termList) : nsMsgSearchAdapter (scope, termList)
 {
 }
 
 
 nsMsgSearchNews::~nsMsgSearchNews ()
 {
 }
 
@@ -218,17 +211,17 @@ nsresult nsMsgSearchNews::Encode (nsCStr
   NS_ASSERTION(outEncoding, "no out encoding");
   if (!outEncoding)
     return NS_ERROR_NULL_POINTER;
 
   nsresult err = NS_OK;
 
   uint32_t numTerms;
 
-  m_searchTerms->Count(&numTerms);
+  m_searchTerms->GetLength(&numTerms);
   char **intermediateEncodings = new char * [numTerms];
   if (intermediateEncodings)
   {
     // Build an XPAT command for each term
     int encodingLength = 0;
     uint32_t i;
     for (i = 0; i < numTerms; i++)
     {
@@ -247,17 +240,17 @@ nsresult nsMsgSearchNews::Encode (nsCStr
     }
     encodingLength += strlen("?search");
     // Combine all the term encodings into one big encoding
     char *encoding = new char [encodingLength + 1];
     if (encoding)
     {
       PL_strcpy (encoding, "?search");
 
-      m_searchTerms->Count(&numTerms);
+      m_searchTerms->GetLength(&numTerms);
 
       for (i = 0; i < numTerms; i++)
       {
         if (intermediateEncodings[i])
         {
           PL_strcat (encoding, m_kTermSeparator);
           PL_strcat (encoding, intermediateEncodings[i]);
           delete [] intermediateEncodings[i];
@@ -330,17 +323,17 @@ void nsMsgSearchNews::CollateHits()
   uint32_t termCount = 1;
   if (!m_ORSearch)
   {
     // We have a traditional AND search which must be collated. In order to
     // get promoted into the hits list, a candidate article number must appear
     // in the results of each XPAT command. So if we fire 3 XPAT commands (one
     // per search term), the article number must appear 3 times. If it appears
     // fewer than 3 times, it matched some search terms, but not all.
-    m_searchTerms->Count(&termCount);
+    m_searchTerms->GetLength(&termCount);
   }
   uint32_t candidateCount = 0;
   uint32_t candidate = m_candidateHits[0];
   for (uint32_t index = 0; index < size; ++index)   
   {
     uint32_t possibleCandidate = m_candidateHits[index];
     if (candidate == possibleCandidate)
     {
--- a/mailnews/base/search/src/nsMsgSearchNews.h
+++ b/mailnews/base/search/src/nsMsgSearchNews.h
@@ -10,17 +10,17 @@
 
 //-----------------------------------------------------------------------------
 //---------- Adapter class for searching online (news) folders ----------------
 //-----------------------------------------------------------------------------
 
 class nsMsgSearchNews : public nsMsgSearchAdapter
 {
 public:
-  nsMsgSearchNews (nsMsgSearchScopeTerm *scope, nsISupportsArray *termList);
+  nsMsgSearchNews (nsMsgSearchScopeTerm *scope, nsIArray *termList);
   virtual ~nsMsgSearchNews ();
 
   NS_IMETHOD ValidateTerms () override;
   NS_IMETHOD Search (bool *aDone) override;
   NS_IMETHOD GetEncoding (char **result) override;
   NS_IMETHOD AddHit(nsMsgKey key) override;
   NS_IMETHOD CurrentUrlDone(nsresult exitCode) override;
 
--- a/mailnews/base/search/src/nsMsgSearchSession.cpp
+++ b/mailnews/base/search/src/nsMsgSearchSession.cpp
@@ -1,14 +1,15 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "msgCore.h"
+#include "nsArray.h"
 #include "nsMsgSearchCore.h"
 #include "nsMsgSearchAdapter.h"
 #include "nsMsgSearchBoolExpression.h"
 #include "nsMsgSearchSession.h"
 #include "nsMsgResultElement.h"
 #include "nsMsgSearchTerm.h"
 #include "nsMsgSearchScopeTerm.h"
 #include "nsIMsgMessageService.h"
@@ -27,19 +28,19 @@ NS_IMPL_ISUPPORTS(nsMsgSearchSession, ns
 
 nsMsgSearchSession::nsMsgSearchSession()
 {
   m_sortAttribute = nsMsgSearchAttrib::Sender;
   m_idxRunningScope = 0;
   m_handlingError = false;
   m_expressionTree = nullptr;
   m_searchPaused = false;
-  nsresult rv = NS_NewISupportsArray(getter_AddRefs(m_termList));
-  if (NS_FAILED(rv))
-    NS_ASSERTION(false, "Failed to allocate a nsISupportsArray for nsMsgFilter");
+  m_termList = nsArray::Create();
+  if (!m_termList)
+    NS_ASSERTION(false, "Failed to allocate a nsIArray for nsMsgFilter");
 }
 
 nsMsgSearchSession::~nsMsgSearchSession()
 {
   InterruptSearch();
   delete m_expressionTree;
   DestroyScopeList();
   DestroyTermList();
@@ -57,35 +58,35 @@ nsMsgSearchSession::AddSearchTerm(nsMsgS
   if (BooleanANDp)
     boolOp = (nsMsgSearchBooleanOperator)nsMsgSearchBooleanOp::BooleanAND;
   else
     boolOp = (nsMsgSearchBooleanOperator)nsMsgSearchBooleanOp::BooleanOR;
   nsMsgSearchTerm *pTerm = new nsMsgSearchTerm(attrib, op, value,
                                                boolOp, customString);
   NS_ENSURE_TRUE(pTerm, NS_ERROR_OUT_OF_MEMORY);
 
-  m_termList->AppendElement(pTerm);
+  m_termList->AppendElement(pTerm, /* weak = */ false);
   // force the expression tree to rebuild whenever we change the terms
   delete m_expressionTree;
   m_expressionTree = nullptr;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgSearchSession::AppendTerm(nsIMsgSearchTerm *aTerm)
 {
     NS_ENSURE_ARG_POINTER(aTerm);
     NS_ENSURE_TRUE(m_termList, NS_ERROR_NOT_INITIALIZED);
     delete m_expressionTree;
     m_expressionTree = nullptr;
-    return m_termList->AppendElement(aTerm);
+    return m_termList->AppendElement(aTerm, /* weak = */ false);
 }
 
 NS_IMETHODIMP
-nsMsgSearchSession::GetSearchTerms(nsISupportsArray **aResult)
+nsMsgSearchSession::GetSearchTerms(nsIMutableArray **aResult)
 {
     NS_ENSURE_ARG_POINTER(aResult);
     *aResult = m_termList;
     NS_ADDREF(*aResult);
     return NS_OK;
 }
 
 NS_IMETHODIMP
--- a/mailnews/base/search/src/nsMsgSearchSession.h
+++ b/mailnews/base/search/src/nsMsgSearchSession.h
@@ -7,24 +7,17 @@
 #define nsMsgSearchSession_h___
 
 #include "nscore.h"
 #include "nsMsgSearchCore.h"
 #include "nsIMsgSearchSession.h"
 #include "nsIUrlListener.h"
 #include "nsIMsgWindow.h"
 #include "nsITimer.h"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-#include "nsISupportsArray.h"
+#include "nsIMutableArray.h"
 #include "nsCOMArray.h"
 #include "nsWeakReference.h"
 #include "nsTObserverArray.h"
 
 class nsMsgSearchAdapter;
 class nsMsgSearchBoolExpression;
 class nsMsgSearchScopeTerm;
 
@@ -50,17 +43,17 @@ protected:
   nsresult DoNextSearch();
   nsresult SearchWOUrls ();
   nsresult GetNextUrl();
   nsresult NotifyListenersDone(nsresult status);
   void EnableFolderNotifications(bool aEnable);
   void ReleaseFolderDBRef();
 
   nsTArray<RefPtr<nsMsgSearchScopeTerm>> m_scopeList;
-  nsCOMPtr <nsISupportsArray> m_termList;
+  nsCOMPtr <nsIMutableArray> m_termList;
 
   nsTArray<nsCOMPtr<nsIMsgSearchNotify> > m_listenerList;
   nsTArray<int32_t> m_listenerFlagList;
   /**
    * Iterator index for m_listenerList/m_listenerFlagList.  We used to use an
    * nsTObserverArray for m_listenerList but its auto-adjusting iterator was
    * not helping us keep our m_listenerFlagList iterator correct.
    *
--- a/mailnews/base/search/src/nsMsgSearchTerm.cpp
+++ b/mailnews/base/search/src/nsMsgSearchTerm.cpp
@@ -1901,17 +1901,17 @@ NS_IMETHODIMP nsMsgSearchScopeTerm::Clos
   return NS_OK;
 }
 
 nsresult nsMsgSearchScopeTerm::TimeSlice (bool *aDone)
 {
   return m_adapter->Search(aDone);
 }
 
-nsresult nsMsgSearchScopeTerm::InitializeAdapter (nsISupportsArray *termList)
+nsresult nsMsgSearchScopeTerm::InitializeAdapter (nsIArray *termList)
 {
   if (m_adapter)
     return NS_OK;
 
   nsresult rv = NS_OK;
 
   switch (m_attribute)
   {
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -4,24 +4,17 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /*
  * The account manager service - manages all accounts, servers, and identities
  */
 
 #include "nsIComponentManager.h"
 #include "nsIServiceManager.h"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-#include "nsISupportsArray.h"
+#include "nsIMutableArray.h"
 #include "nsIArray.h"
 #include "nsArrayUtils.h"
 #include "nsMsgAccountManager.h"
 #include "nsMsgBaseCID.h"
 #include "nsMsgCompCID.h"
 #include "nsMsgDBCID.h"
 #include "prmem.h"
 #include "prcmon.h"
@@ -2554,17 +2547,17 @@ nsresult VirtualFolderChangeListener::In
     nsCOMPtr <nsIMsgFilter> tempFilter;
     filterList->CreateFilter(NS_LITERAL_STRING("temp"), getter_AddRefs(tempFilter));
     NS_ENSURE_SUCCESS(rv, rv);
     filterList->ParseCondition(tempFilter, searchTermString.get());
     NS_ENSURE_SUCCESS(rv, rv);
     m_searchSession = do_CreateInstance(NS_MSGSEARCHSESSION_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    nsCOMPtr<nsISupportsArray> searchTerms;
+    nsCOMPtr<nsIMutableArray> searchTerms;
     rv = tempFilter->GetSearchTerms(getter_AddRefs(searchTerms));
     NS_ENSURE_SUCCESS(rv, rv);
 
     // we add the search scope right before we match the header,
     // because we don't want the search scope caching the body input
     // stream, because that holds onto the mailbox file, breaking
     // compaction.
 
--- a/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp
+++ b/mailnews/base/src/nsMsgXFVirtualFolderDBView.cpp
@@ -13,16 +13,17 @@
 #include "nsIMsgCopyService.h"
 #include "nsICopyMsgStreamListener.h"
 #include "nsMsgUtils.h"
 #include "nsITreeColumns.h"
 #include "nsIMsgSearchSession.h"
 #include "nsMsgDBCID.h"
 #include "nsMsgMessageFlags.h"
 #include "nsServiceManagerUtils.h"
+#include "nsIMutableArray.h"
 
 nsMsgXFVirtualFolderDBView::nsMsgXFVirtualFolderDBView()
 {
   mSuppressMsgDisplay = false;
   m_doingSearch = false;
   m_doingQuickSearch = false;
   m_totalMessagesInView = 0;
 }
@@ -378,17 +379,17 @@ nsMsgXFVirtualFolderDBView::OnNewSearch(
   // Figure out how many search terms the virtual folder has.
   nsCOMPtr<nsIMsgDatabase> virtDatabase;
   nsCOMPtr<nsIDBFolderInfo> dbFolderInfo;
   nsresult rv = m_viewFolder->GetDBFolderInfoAndDB(getter_AddRefs(dbFolderInfo), getter_AddRefs(virtDatabase));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCString terms;
   dbFolderInfo->GetCharProperty("searchStr", terms);
-  nsCOMPtr<nsISupportsArray> searchTerms;
+  nsCOMPtr<nsIMutableArray> searchTerms;
   rv = searchSession->GetSearchTerms(getter_AddRefs(searchTerms));
   NS_ENSURE_SUCCESS(rv, rv);
   nsCString curSearchAsString;
 
   rv = MsgTermListToString(searchTerms, curSearchAsString);
   // Trim off the initial AND/OR, which is irrelevant and inconsistent between
   // what searchSpec.js generates, and what's in virtualFolders.dat.
   curSearchAsString.Cut(0, StringBeginsWith(curSearchAsString, NS_LITERAL_CSTRING("AND")) ? 3 : 2);
--- a/mailnews/base/src/virtualFolderWrapper.js
+++ b/mailnews/base/src/virtualFolderWrapper.js
@@ -25,17 +25,17 @@ var VirtualFolderHelper = {
    *  it.
    *
    * @param aFolderName The name of the new folder to create.
    * @param aParentFolder The folder in which to create the search folder.
    * @param aSearchFolders A list of nsIMsgFolders that you want to use as the
    *     sources for the virtual folder OR a string that is the already '|'
    *     delimited list of folder URIs to use.
    * @param aSearchTerms The search terms to use for the virtual folder.  This
-   *     should be a JS list/nsIMutableArray/nsISupportsArray of
+   *     should be a JS list/nsIMutableArray of
    *     nsIMsgSearchTermbs.
    * @param aOnlineSearch Should the search attempt to use the server's search
    *     capabilities when possible and appropriate?
    *
    * @return The VirtualFolderWrapper wrapping the newly created folder.  You
    *     would probably only want this for its virtualFolder attribute which has
    *     the nsIMsgFolder we created.  Be careful about accessing any of the
    *     other attributes, as they will bring its message database back to life.
@@ -128,18 +128,17 @@ VirtualFolderWrapper.prototype = {
                                .QueryInterface(Ci.nsIMsgFolder));
     }
     return folders;
   },
   /**
    * Set the search folders that back this virtual folder.
    *
    * @param aFolders Either a "|"-delimited string of folder URIs or a list of
-   *     nsIMsgFolders that fixIterator can traverse (JS array/nsIMutableArray/
-   *     nsISupportsArray).
+   *     nsIMsgFolders that fixIterator can traverse (JS array/nsIMutableArray).
    */
   set searchFolders(aFolders) {
     if (typeof(aFolders) == "string") {
       this.dbFolderInfo.setCharProperty("searchFolderUri", aFolders);
     }
     else {
       let uris = Array.from(fixIterator(aFolders, Ci.nsIMsgFolder))
                       .map(folder => folder.URI);
@@ -178,17 +177,17 @@ VirtualFolderWrapper.prototype = {
 
   /**
    * Set the search string for this virtual folder to the stringified version of
    *  the provided list of nsIMsgSearchTerm search terms.  If you already have
    *  a strinigified version of the search constraint, just set |searchString|
    *  directly.
    *
    * @param aTerms Some collection that fixIterator can traverse.  A JS list or
-   *     XPCOM array (nsIMutableArray or nsISupportsArray) should work.
+   *     XPCOM array (nsIMutableArray) should work.
    */
   set searchTerms(aTerms) {
     let condition = "";
     for (let term in fixIterator(aTerms, Ci.nsIMsgSearchTerm)) {
       if (condition.length)
         condition += " ";
       if (term.matchAll) {
         condition = "ALL";
--- a/mailnews/base/util/nsMsgIncomingServer.cpp
+++ b/mailnews/base/util/nsMsgIncomingServer.cpp
@@ -19,16 +19,17 @@
 #include "nsMsgDBCID.h"
 #include "nsIMsgFolder.h"
 #include "nsIMsgFolderCache.h"
 #include "nsIMsgPluggableStore.h"
 #include "nsIMsgFolderCacheElement.h"
 #include "nsIMsgWindow.h"
 #include "nsIMsgFilterService.h"
 #include "nsIMsgProtocolInfo.h"
+#include "nsIMutableArray.h"
 #include "nsIPrefService.h"
 #include "nsIRelativeFilePref.h"
 #include "nsIDocShell.h"
 #include "nsIAuthPrompt.h"
 #include "nsNetUtil.h"
 #include "nsIWindowWatcher.h"
 #include "nsIStringBundle.h"
 #include "nsIMsgHdr.h"
@@ -1870,17 +1871,17 @@ nsMsgIncomingServer::ConfigureTemporaryS
      * We don't want this filter to activate on messages that have
      *  been marked by the user as not spam. This occurs when messages that
      *  were marked as good are moved back into the inbox. But to
      *  do this with a filter, we have to add a boolean term. That requires
      *  that we rewrite the existing filter search terms to group them.
      */
 
     // get the list of search terms from the filter
-    nsCOMPtr<nsISupportsArray> searchTerms;
+    nsCOMPtr<nsIMutableArray> searchTerms;
     rv = newFilter->GetSearchTerms(getter_AddRefs(searchTerms));
     NS_ENSURE_SUCCESS(rv, rv);
     uint32_t count = 0;
     searchTerms->Count(&count);
     if (count > 1) // don't need to group a single term
     {
       // beginGrouping the first term, and endGrouping the last term
       nsCOMPtr<nsIMsgSearchTerm> firstTerm(do_QueryElementAt(searchTerms,
@@ -1906,17 +1907,17 @@ nsMsgIncomingServer::ConfigureTemporaryS
 
     nsCOMPtr<nsIMsgSearchValue> searchValue;
     searchTerm->GetValue(getter_AddRefs(searchValue));
     NS_ENSURE_SUCCESS(rv, rv);
     searchValue->SetAttrib(nsMsgSearchAttrib::JunkScoreOrigin);
     searchValue->SetStr(NS_LITERAL_STRING("user"));
     searchTerm->SetValue(searchValue);
 
-    searchTerms->InsertElementAt(searchTerm, count);
+    searchTerms->InsertElementAt(searchTerm, count, /* weak = */ false);
 
     bool moveOnSpam, markAsReadOnSpam;
     spamSettings->GetMoveOnSpam(&moveOnSpam);
     if (moveOnSpam)
     {
       nsCString spamFolderURI;
       rv = spamSettings->GetSpamFolderURI(getter_Copies(spamFolderURI));
       if (NS_SUCCEEDED(rv) && (!spamFolderURI.IsEmpty()))
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -53,24 +53,17 @@
 #include "nsIMsgDatabase.h"
 #include "nsIMutableArray.h"
 #include "nsIMsgMailNewsUrl.h"
 #include "nsArrayUtils.h"
 #include "nsIStringBundle.h"
 #include "nsIMsgWindow.h"
 #include "nsIWindowWatcher.h"
 #include "nsIPrompt.h"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-#include "nsISupportsArray.h"
+#include "nsIArray.h"
 #include "nsIMsgSearchTerm.h"
 #include "nsTextFormatter.h"
 #include "nsIAtomService.h"
 #include "nsIStreamListener.h"
 #include "nsReadLine.h"
 #include "nsICharsetDetectionObserver.h"
 #include "nsICharsetDetector.h"
 #include "nsILineInputStream.h"
@@ -2232,20 +2225,20 @@ NS_MSG_BASE nsresult MsgPromptLoginFaile
 
 NS_MSG_BASE PRTime MsgConvertAgeInDaysToCutoffDate(int32_t ageInDays)
 {
   PRTime now = PR_Now();
 
   return now - PR_USEC_PER_DAY * ageInDays;
 }
 
-NS_MSG_BASE nsresult MsgTermListToString(nsISupportsArray *aTermList, nsCString &aOutString)
+NS_MSG_BASE nsresult MsgTermListToString(nsIArray *aTermList, nsCString &aOutString)
 {
   uint32_t count;
-  aTermList->Count(&count);
+  aTermList->GetLength(&count);
   nsresult rv = NS_OK;
 
   for (uint32_t searchIndex = 0; searchIndex < count;
        searchIndex++)
   {
     nsAutoCString stream;
 
     nsCOMPtr<nsIMsgSearchTerm> term;
--- a/mailnews/base/util/nsMsgUtils.h
+++ b/mailnews/base/util/nsMsgUtils.h
@@ -9,24 +9,17 @@
 #include "nsIURL.h"
 #include "nsStringGlue.h"
 #include "msgCore.h"
 #include "nsCOMPtr.h"
 #include "MailNewsTypes2.h"
 #include "nsTArray.h"
 #include "nsInterfaceRequestorAgg.h"
 #include "nsILoadGroup.h"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-#include "nsISupportsArray.h"
+#include "nsIArray.h"
 #include "nsIAtom.h"
 #include "nsINetUtil.h"
 #include "nsIRequest.h"
 #include "nsILoadInfo.h"
 #include "nsServiceManagerUtils.h"
 #include "nsUnicharUtils.h"
 #include "nsIFile.h"
 
@@ -37,17 +30,16 @@ class nsIMsgFolder;
 class nsIMsgMessageService;
 class nsIUrlListener;
 class nsIOutputStream;
 class nsIInputStream;
 class nsIMsgDatabase;
 class nsIMutableArray;
 class nsIProxyInfo;
 class nsIMsgWindow;
-class nsISupportsArray;
 class nsIStreamListener;
 
 #define FILE_IO_BUFFER_SIZE (16*1024)
 #define MSGS_URL    "chrome://messenger/locale/messenger.properties"
 
 //These are utility functions that can used throughout the mailnews code
 
 NS_MSG_BASE nsresult GetMessageServiceContractIDForURI(const char *uri, nsCString &contractID);
@@ -282,17 +274,17 @@ NS_MSG_BASE PRTime MsgConvertAgeInDaysTo
 
 /**
  * Converts the passed in term list to its string representation.
  *
  * @param      aTermList    Array of nsIMsgSearchTerms
  * @param[out] aOutString   result representation of search terms.
  *
  */
-NS_MSG_BASE nsresult MsgTermListToString(nsISupportsArray *aTermList, nsCString &aOutString);
+NS_MSG_BASE nsresult MsgTermListToString(nsIArray *aTermList, nsCString &aOutString);
 
 NS_MSG_BASE nsresult
 MsgStreamMsgHeaders(nsIInputStream *aInputStream, nsIStreamListener *aConsumer);
 
 /**
  * convert string to uint64_t
  *
  * @param str conveted string
@@ -399,18 +391,18 @@ ConvertBufToPlainText(nsString &aConBuf,
 #define CaseInsensitiveFindInReadable(what, str) \
         ((str).Find(what, CaseInsensitiveCompare) != kNotFound)
 #define LossyAppendUTF16toASCII(source, dest) \
         (dest).Append(NS_LossyConvertUTF16toASCII(source))
 #define Last() \
         EndReading()[-1]
 #define SetCharAt(ch, index) \
         Replace(index, 1, ch)
-#define NS_NewISupportsArray(result) \
-        CallCreateInstance(NS_SUPPORTSARRAY_CONTRACTID, static_cast<nsISupportsArray**>(result))
+#define NS_NewIMutableArray(result) \
+        CallCreateInstance(NS_ARRAY_CONTRACTID, static_cast<nsIMutableArray**>(result))
 /**
  * The internal and external methods expect the parameters in a different order.
  * The internal API also always expects a flag rather than a comparator.
  */
 inline int32_t MsgFind(nsAString &str, const char *what, bool ignore_case, uint32_t offset)
 {
   return str.Find(what, offset, ignore_case);
 }
--- a/mailnews/extensions/mailviews/public/nsIMsgMailView.idl
+++ b/mailnews/extensions/mailviews/public/nsIMsgMailView.idl
@@ -1,35 +1,26 @@
 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 
 #include "nsISupports.idl"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-%{C++
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-%}
-interface nsISupportsArray;
+interface nsIMutableArray;
 
 interface nsIMsgSearchTerm;
 
 [scriptable, uuid(28AC84DF-CBE5-430d-A5C0-4FA63B5424DF)]
 interface nsIMsgMailView : nsISupports {
     attribute wstring mailViewName;
 	readonly attribute wstring prettyName; // localized pretty name
 
     // the array of search terms 
-    attribute nsISupportsArray searchTerms;
+    attribute nsIMutableArray searchTerms;
 
     // these two helper methods are required to allow searchTermsOverlay.js to
     // manipulate a mail view without knowing it is dealing with a mail view. nsIMsgFilter
     // and nsIMsgSearchSession have the same two methods....we should probably make an interface around them.
 	void appendTerm(in nsIMsgSearchTerm term);
 	nsIMsgSearchTerm createTerm();
 
 };
--- a/mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
+++ b/mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
@@ -1,22 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsMsgMailViewList.h"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-#include "nsISupportsArray.h"
+#include "nsArray.h"
+#include "nsIMutableArray.h"
 #include "nsIFileChannel.h"
 #include "nsIMsgFilterService.h"
 #include "nsIMsgMailSession.h"
 #include "nsIMsgSearchTerm.h"
 #include "nsMsgBaseCID.h"
 #include "nsAppDirectoryServiceDefs.h"
 #include "nsDirectoryServiceUtils.h"
 #include "nsIFile.h"
@@ -27,17 +21,18 @@
 #define kDefaultViewPeopleIKnow "People I Know"
 #define kDefaultViewRecent "Recent Mail"
 #define kDefaultViewFiveDays "Last 5 Days"
 #define kDefaultViewNotJunk "Not Junk"
 #define kDefaultViewHasAttachments "Has Attachments"
  
 nsMsgMailView::nsMsgMailView()
 {
-    mViewSearchTerms = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
+    mViewSearchTerms = nsArray::Create();
+    //mViewSearchTerms = do_CreateInstance(NS_SUPPORTSARRAY_CONTRACTID);
 }
 
 NS_IMPL_ADDREF(nsMsgMailView)
 NS_IMPL_RELEASE(nsMsgMailView)
 NS_IMPL_QUERY_INTERFACE(nsMsgMailView, nsIMsgMailView)
 
 nsMsgMailView::~nsMsgMailView()
 {
@@ -88,34 +83,34 @@ NS_IMETHODIMP nsMsgMailView::GetPrettyNa
     else if (mName.EqualsLiteral(kDefaultViewHasAttachments))
         rv = mBundle->GetStringFromName(u"mailViewHasAttachments", aMailViewName);
     else
         *aMailViewName = ToNewUnicode(mName);
 
     return rv;
 }
 
-NS_IMETHODIMP nsMsgMailView::GetSearchTerms(nsISupportsArray ** aSearchTerms)
+NS_IMETHODIMP nsMsgMailView::GetSearchTerms(nsIMutableArray ** aSearchTerms)
 {
     NS_ENSURE_ARG_POINTER(aSearchTerms);
     NS_IF_ADDREF(*aSearchTerms = mViewSearchTerms);
     return NS_OK;
 }
 
-NS_IMETHODIMP nsMsgMailView::SetSearchTerms(nsISupportsArray * aSearchTerms)
+NS_IMETHODIMP nsMsgMailView::SetSearchTerms(nsIMutableArray * aSearchTerms)
 {
     mViewSearchTerms = aSearchTerms;
     return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgMailView::AppendTerm(nsIMsgSearchTerm * aTerm)
 {
     NS_ENSURE_TRUE(aTerm, NS_ERROR_NULL_POINTER);
     
-    return mViewSearchTerms->AppendElement(static_cast<nsISupports*>(aTerm));
+    return mViewSearchTerms->AppendElement(static_cast<nsISupports*>(aTerm), /* weak = */ false);
 }
 
 NS_IMETHODIMP nsMsgMailView::CreateTerm(nsIMsgSearchTerm **aResult)
 {
     NS_ENSURE_ARG_POINTER(aResult);
     nsCOMPtr<nsIMsgSearchTerm> searchTerm = do_CreateInstance("@mozilla.org/messenger/searchTerm;1");
     NS_IF_ADDREF(*aResult = searchTerm);
     return NS_OK;
@@ -217,17 +212,17 @@ nsresult nsMsgMailViewList::ConvertMailV
       GetMailViewAt(index, getter_AddRefs(mailView));
       if (!mailView)
           continue;
       mailView->GetMailViewName(getter_Copies(mailViewName));
       mFilterList->CreateFilter(mailViewName, getter_AddRefs(newMailFilter));
       if (!newMailFilter)
           continue;
 
-      nsCOMPtr<nsISupportsArray> searchTerms;
+      nsCOMPtr<nsIMutableArray> searchTerms;
       mailView->GetSearchTerms(getter_AddRefs(searchTerms));
       newMailFilter->SetSearchTerms(searchTerms);
       mFilterList->InsertFilterAt(index, newMailFilter);
   }
 
   return NS_OK;
 }
 
@@ -293,17 +288,17 @@ nsresult nsMsgMailViewList::ConvertFilte
         nsCOMPtr<nsIMsgMailView> newMailView;
         rv = CreateMailView(getter_AddRefs(newMailView));
         NS_ENSURE_SUCCESS(rv, rv);
 
         nsString filterName;
         msgFilter->GetFilterName(filterName);
         newMailView->SetMailViewName(filterName.get());
 
-        nsCOMPtr<nsISupportsArray> filterSearchTerms;
+        nsCOMPtr<nsIMutableArray> filterSearchTerms;
         rv = msgFilter->GetSearchTerms(getter_AddRefs(filterSearchTerms));
         NS_ENSURE_SUCCESS(rv, rv);
         rv = newMailView->SetSearchTerms(filterSearchTerms);
         NS_ENSURE_SUCCESS(rv, rv);
 
         // now append this new mail view to our global list view
         m_mailViews.AppendElement(newMailView);
     }
--- a/mailnews/extensions/mailviews/src/nsMsgMailViewList.h
+++ b/mailnews/extensions/mailviews/src/nsMsgMailViewList.h
@@ -6,24 +6,17 @@
 
 #ifndef _nsMsgMailViewList_H_
 #define _nsMsgMailViewList_H_
 
 #include "nscore.h"
 #include "nsIMsgMailViewList.h"
 #include "nsCOMPtr.h"
 #include "nsCOMArray.h"
-// Disable deprecation warnings generated by nsISupportsArray and associated
-// classes.
-#if defined(__GNUC__)
-#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
-#elif defined(_MSC_VER)
-#pragma warning (disable : 4996)
-#endif
-#include "nsISupportsArray.h"
+#include "nsIMutableArray.h"
 #include "nsIStringBundle.h"
 #include "nsStringGlue.h"
 #include "nsIMsgFilterList.h"
 
 // a mail View is just a name and an array of search terms
 class nsMsgMailView : public nsIMsgMailView
 {
 public:
@@ -31,17 +24,17 @@ public:
   NS_DECL_NSIMSGMAILVIEW
 
   nsMsgMailView();
 
 protected:
   virtual ~nsMsgMailView();
   nsString mName;
   nsCOMPtr<nsIStringBundle> mBundle;
-  nsCOMPtr<nsISupportsArray> mViewSearchTerms;
+  nsCOMPtr<nsIMutableArray> mViewSearchTerms;
 };
 
 
 class nsMsgMailViewList : public nsIMsgMailViewList
 {
 public:
   NS_DECL_ISUPPORTS
   NS_DECL_NSIMSGMAILVIEWLIST
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -686,17 +686,17 @@ NS_IMETHODIMP nsImapMailFolder::UpdateFo
         nsMsgFilterTypeType filterType;
         filter->GetFilterType(&filterType);
         if (!(filterType & nsMsgFilterType::Incoming))
           continue;
         bool enabled = false;
         filter->GetEnabled(&enabled);
         if (!enabled)
           continue;
-        nsCOMPtr<nsISupportsArray> searchTerms;
+        nsCOMPtr<nsIMutableArray> searchTerms;
         uint32_t numSearchTerms = 0;
         filter->GetSearchTerms(getter_AddRefs(searchTerms));
         if (searchTerms)
           searchTerms->Count(&numSearchTerms);
         for (uint32_t termIndex = 0;
              termIndex < numSearchTerms && !m_filterListRequiresBody;
              termIndex++)
         {
--- a/suite/mailnews/commandglue.js
+++ b/suite/mailnews/commandglue.js
@@ -973,32 +973,32 @@ function setupXFVirtualFolderSearch(fold
 
   for (i in folderUrisToSearch)
     {
       let realFolder = GetMsgFolderFromUri(folderUrisToSearch[i]);
       if (!realFolder.isServer)
         gSearchSession.addScopeTerm(!searchOnline ? nsMsgSearchScope.offlineMail : GetScopeForFolder(realFolder), realFolder);
     }
 
-    var termsArray = searchTerms.QueryInterface(Components.interfaces.nsISupportsArray);
+    var termsArray = searchTerms.QueryInterface(Components.interfaces.nsIMutableArray);
     const nsIMsgSearchTerm = Components.interfaces.nsIMsgSearchTerm;
     for (let term in fixIterator(termsArray, nsIMsgSearchTerm)) {
       gSearchSession.appendTerm(term);
     }
 }
 
 function CreateGroupedSearchTerms(searchTermsArray)
 {
 
   var searchSession = gSearchSession ||
     Components.classes[searchSessionContractID].createInstance(Components.interfaces.nsIMsgSearchSession);
 
   // create a temporary isupports array to store our search terms
   // since we will be modifying the terms so they work with quick search
-  var searchTermsArrayForQS = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
+  var searchTermsArrayForQS = Components.classes["@mozilla.org/array;1"].createInstance(Components.interfaces.nsIMutableArray);
 
   var numEntries = searchTermsArray.Count();
   for (var i = 0; i < numEntries; i++) {
     var searchTerm = searchTermsArray.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgSearchTerm);
 
     // clone the term, since we might be modifying it
     var searchTermForQS = searchSession.createTerm();
     searchTermForQS.value = searchTerm.value;
@@ -1012,17 +1012,17 @@ function CreateGroupedSearchTerms(search
     if (i == 0)
       searchTermForQS.beginsGrouping = true;
     else if (i == numEntries - 1)
       searchTermForQS.endsGrouping = true;
 
     // turn the first term to true to work with quick search...
     searchTermForQS.booleanAnd = i ? searchTerm.booleanAnd : true;
 
-    searchTermsArrayForQS.AppendElement(searchTermForQS);
+    searchTermsArrayForQS.appendElement(searchTermForQS, /* weak = */ false);
   }
   return searchTermsArrayForQS;
 }
 
 function OnLeavingFolder(aFolder)
 {
   try
   {
--- a/suite/mailnews/msgViewPickerOverlay.js
+++ b/suite/mailnews/msgViewPickerOverlay.js
@@ -205,78 +205,78 @@ function LoadCustomMailView(index)
 }
 
 
 function ViewTagKeyword(keyword)
 {
   PrepareForViewChange();
 
   // create an i supports array to store our search terms
-  var searchTermsArray = Components.classes["@mozilla.org/supports-array;1"]
-                                   .createInstance(Components.interfaces.nsISupportsArray);
+  var searchTermsArray = Components.classes["@mozilla.org/array;1"]
+                                   .createInstance(Components.interfaces.nsIMutableArray);
   var term = gSearchSession.createTerm();
   var value = term.value;
 
   value.str = keyword;
   value.attrib = nsMsgSearchAttrib.Keywords;
   term.value = value;
   term.attrib = nsMsgSearchAttrib.Keywords;
   term.op = nsMsgSearchOp.Contains;
   term.booleanAnd = true;
 
-  searchTermsArray.AppendElement(term);
+  searchTermsArray.appendElement(term, /* weak = */ false);
   AddVirtualFolderTerms(searchTermsArray);
   createSearchTermsWithList(searchTermsArray);
   gDefaultSearchViewTerms = searchTermsArray;
 }
 
 
 function ViewNewMail()
 {
   PrepareForViewChange();
 
   // create an i supports array to store our search terms
-  var searchTermsArray = Components.classes["@mozilla.org/supports-array;1"]
-                                   .createInstance(Components.interfaces.nsISupportsArray);
+  var searchTermsArray = Components.classes["@mozilla.org/array;1"]
+                                   .createInstance(Components.interfaces.nsIMutableArray);
   var term = gSearchSession.createTerm();
   var value = term.value;
 
   value.status = 1;
   value.attrib = nsMsgSearchAttrib.MsgStatus;
   term.value = value;
   term.attrib = nsMsgSearchAttrib.MsgStatus;
   term.op = nsMsgSearchOp.Isnt;
   term.booleanAnd = true;
-  searchTermsArray.AppendElement(term);
+  searchTermsArray.appendElement(term, /* weak = */ false);
 
   AddVirtualFolderTerms(searchTermsArray);
 
   createSearchTermsWithList(searchTermsArray);
   // not quite right - these want to be just the view terms...but it might not matter.
   gDefaultSearchViewTerms = searchTermsArray;
 }
 
 
 function ViewNotDeletedMail()
 {
   PrepareForViewChange();
 
   // create an i supports array to store our search terms
-  var searchTermsArray = Components.classes["@mozilla.org/supports-array;1"]
-                                   .createInstance(Components.interfaces.nsISupportsArray);
+  var searchTermsArray = Components.classes["@mozilla.org/array;1"]
+                                   .createInstance(Components.interfaces.nsIMuatbleArray);
   var term = gSearchSession.createTerm();
   var value = term.value;
 
   value.status = 0x00200000;
   value.attrib = nsMsgSearchAttrib.MsgStatus;
   term.value = value;
   term.attrib = nsMsgSearchAttrib.MsgStatus;
   term.op = nsMsgSearchOp.Isnt;
   term.booleanAnd = true;
-  searchTermsArray.AppendElement(term);
+  searchTermsArray.appendElement(term, /* weak = */ false);
 
   AddVirtualFolderTerms(searchTermsArray);
 
   createSearchTermsWithList(searchTermsArray);
   // not quite right - these want to be just the view terms...but it might not matter.
   gDefaultSearchViewTerms = searchTermsArray;
 }
 
@@ -284,22 +284,22 @@ function ViewNotDeletedMail()
 function AddVirtualFolderTerms(searchTermsArray)
 {
   // add in any virtual folder terms
   var virtualFolderSearchTerms = (gVirtualFolderTerms || gXFVirtualFolderTerms);
   if (virtualFolderSearchTerms)
   {
     var isupports = null;
     var searchTerm;
-    var termsArray = virtualFolderSearchTerms.QueryInterface(Components.interfaces.nsISupportsArray);
+    var termsArray = virtualFolderSearchTerms.QueryInterface(Components.interfaces.nsIMutableArray);
     for (var i = 0; i < termsArray.Count(); i++)
     {
       isupports = termsArray.GetElementAt(i);
       searchTerm = isupports.QueryInterface(Components.interfaces.nsIMsgSearchTerm);
-      searchTermsArray.AppendElement(searchTerm);
+      searchTermsArray.appendElement(searchTerm, /* weak = */ false);
     }
   }
 }
 
 
 function PrepareForViewChange()
 {
   // this is a problem - it saves the current view in gPreQuickSearchView
--- a/suite/mailnews/searchBar.js
+++ b/suite/mailnews/searchBar.js
@@ -288,18 +288,18 @@ function onSearch(aSearchTerms)
 function createSearchTermsWithList(aTermsArray)
 {
   var nsMsgSearchScope = Components.interfaces.nsMsgSearchScope;
   var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
   var nsMsgSearchOp = Components.interfaces.nsMsgSearchOp;
 
   gSearchSession.clearScopes();
   var searchTerms = gSearchSession.searchTerms;
-  var searchTermsArray = searchTerms.QueryInterface(Components.interfaces.nsISupportsArray);
-  searchTermsArray.Clear();
+  var searchTermsArray = searchTerms.QueryInterface(Components.interfaces.nsIMutableArray);
+  searchTermsArray.clear();
 
   var i;
   var selectedFolder = GetThreadPaneFolder();
   if (gXFVirtualFolderTerms)
   {
     var msgDatabase = selectedFolder.msgDatabase;
     if (msgDatabase)
     {
@@ -317,29 +317,29 @@ function createSearchTermsWithList(aTerm
   }
   else
   {
     viewDebug ("in createSearchTermsWithList, adding scope term for selected folder\n");
     gSearchSession.addScopeTerm(nsMsgSearchScope.offlineMail, selectedFolder);
   }
   // add each item in termsArray to the search session
 
-  var termsArray = aTermsArray.QueryInterface(Components.interfaces.nsISupportsArray);
+  var termsArray = aTermsArray.QueryInterface(Components.interfaces.nsIMutableArray);
   for (i = 0; i < termsArray.Count(); ++i)
     gSearchSession.appendTerm(termsArray.GetElementAt(i).QueryInterface(Components.interfaces.nsIMsgSearchTerm));
 }
 
 function createSearchTerms()
 {
   var nsMsgSearchScope = Components.interfaces.nsMsgSearchScope;
   var nsMsgSearchAttrib = Components.interfaces.nsMsgSearchAttrib;
   var nsMsgSearchOp = Components.interfaces.nsMsgSearchOp;
 
-  // create an nsISupportsArray to store our search terms
-  var searchTermsArray = Components.classes["@mozilla.org/supports-array;1"].createInstance(Components.interfaces.nsISupportsArray);
+  // create an nsIMutableArray to store our search terms
+  var searchTermsArray = Components.classes["@mozilla.org/array;1"].createInstance(Components.interfaces.nsIMutableArray);
   var selectedFolder = GetThreadPaneFolder();
 
   // implement | for QS
   // does this break if the user types "foo|bar" expecting to see subjects with that string?
   // I claim no, since "foo|bar" will be a hit for "foo" || "bar"
   // they just might get more false positives
   var termList = gSearchInput.value.split("|");
   for (var i = 0; i < termList.length; i ++)
@@ -351,44 +351,44 @@ function createSearchTerms()
     // create, fill, and append the subject term
     var term = gSearchSession.createTerm();
     var value = term.value;
     value.str = termList[i];
     term.value = value;
     term.attrib = nsMsgSearchAttrib.Subject;
     term.op = nsMsgSearchOp.Contains;
     term.booleanAnd = false;
-    searchTermsArray.AppendElement(term);
+    searchTermsArray.appendElement(term, /* weak = */ false);
 
     // create, fill, and append the AllAddresses term
     term = gSearchSession.createTerm();
     value = term.value;
     value.str = termList[i];
     term.value = value;
     term.attrib = nsMsgSearchAttrib.AllAddresses;
     term.op = nsMsgSearchOp.Contains;
     term.booleanAnd = false;
-    searchTermsArray.AppendElement(term);
+    searchTermsArray.appendElement(term, /* weak = */ false);
   }
 
   // now append the default view or virtual folder criteria to the quick search
   // so we don't lose any default view information
   viewDebug("gDefaultSearchViewTerms = " + gDefaultSearchViewTerms + "gVirtualFolderTerms = " + gVirtualFolderTerms +
     "gXFVirtualFolderTerms = " + gXFVirtualFolderTerms + "\n");
   var defaultSearchTerms = (gDefaultSearchViewTerms || gVirtualFolderTerms || gXFVirtualFolderTerms);
   if (defaultSearchTerms)
   {
     var isupports = null;
     var searchTerm;
-    var termsArray = defaultSearchTerms.QueryInterface(Components.interfaces.nsISupportsArray);
+    var termsArray = defaultSearchTerms.QueryInterface(Components.interfaces.nsIMutableArray);
     for (i = 0; i < termsArray.Count(); i++)
     {
       isupports = termsArray.GetElementAt(i);
       searchTerm = isupports.QueryInterface(Components.interfaces.nsIMsgSearchTerm);
-      searchTermsArray.AppendElement(searchTerm);
+      searchTermsArray.appendElement(searchTerm, /* weak = */ false);
     }
   }
 
   createSearchTermsWithList(searchTermsArray);
 
   // now that we've added the terms, clear out our input array
   searchTermsArray.Clear();
 }