Bug 1411069 - Port bug 1313150 to mailnews: Remove |weak| parameter from nsIMutableArray methods. rs=bustage-fix
authorJorg K <jorgk@jorgk.com>
Tue, 24 Oct 2017 00:58:59 +0200
changeset 29248 c38974cf236ed69bd7d45c938ec39a4f955233be
parent 29247 773c0fd4b6239864864e5f51bb3dff801843f2eb
child 29249 dd1d559aeb262e3aac32d5da7d2ff5b31e7b3079
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbustage-fix
bugs1411069, 1313150
Bug 1411069 - Port bug 1313150 to mailnews: Remove |weak| parameter from nsIMutableArray methods. rs=bustage-fix Affected: AppendElement(), InsertElementAt(), ReplaceElementAt().
mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
mail/components/migration/src/nsProfileMigrator.cpp
mailnews/addrbook/src/nsAbLDAPCard.cpp
mailnews/addrbook/src/nsAbMDBDirProperty.cpp
mailnews/addrbook/src/nsAbMDBDirectory.cpp
mailnews/addrbook/src/nsAbOSXDirectory.mm
mailnews/addrbook/src/nsAbOutlookDirFactory.cpp
mailnews/addrbook/src/nsAbOutlookDirectory.cpp
mailnews/addrbook/src/nsAbQueryStringToExpression.cpp
mailnews/addrbook/src/nsAbView.cpp
mailnews/addrbook/src/nsAddrDatabase.cpp
mailnews/base/search/src/nsMsgFilter.cpp
mailnews/base/search/src/nsMsgFilterService.cpp
mailnews/base/search/src/nsMsgSearchSession.cpp
mailnews/base/src/nsMessenger.cpp
mailnews/base/src/nsMessengerBootstrap.cpp
mailnews/base/src/nsMessengerUnixIntegration.cpp
mailnews/base/src/nsMessengerWinIntegration.cpp
mailnews/base/src/nsMsgAccount.cpp
mailnews/base/src/nsMsgAccountManager.cpp
mailnews/base/src/nsMsgAccountManagerDS.cpp
mailnews/base/src/nsMsgCopyService.cpp
mailnews/base/src/nsMsgDBView.cpp
mailnews/base/src/nsMsgFolderDataSource.cpp
mailnews/base/src/nsMsgProgress.cpp
mailnews/base/src/nsMsgPurgeService.cpp
mailnews/base/src/nsMsgQuickSearchDBView.cpp
mailnews/base/src/nsMsgSearchDBView.cpp
mailnews/base/util/nsImapMoveCoalescer.cpp
mailnews/base/util/nsMsgDBFolder.cpp
mailnews/base/util/nsMsgIncomingServer.cpp
mailnews/base/util/nsMsgReadStateTxn.cpp
mailnews/base/util/nsMsgUtils.cpp
mailnews/compose/src/nsMsgCompose.cpp
mailnews/compose/src/nsMsgSend.cpp
mailnews/compose/src/nsMsgSendLater.cpp
mailnews/db/msgdb/src/nsMsgDatabase.cpp
mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
mailnews/extensions/smime/src/nsMsgComposeSecure.cpp
mailnews/imap/src/nsAutoSyncState.cpp
mailnews/imap/src/nsImapMailFolder.cpp
mailnews/imap/src/nsImapOfflineSync.cpp
mailnews/import/applemail/src/nsAppleMailImport.cpp
mailnews/import/becky/src/nsBeckyAddressBooks.cpp
mailnews/import/becky/src/nsBeckyMail.cpp
mailnews/import/outlook/src/MapiMessage.cpp
mailnews/import/outlook/src/nsOutlookCompose.cpp
mailnews/import/outlook/src/nsOutlookMail.cpp
mailnews/import/text/src/nsTextImport.cpp
mailnews/import/vcard/src/nsVCardImport.cpp
mailnews/local/src/nsLocalMailFolder.cpp
mailnews/local/src/nsLocalUndoTxn.cpp
mailnews/local/src/nsMsgMaildirStore.cpp
mailnews/local/src/nsParseMailbox.cpp
mailnews/news/src/nsNNTPNewsgroupList.cpp
mailnews/news/src/nsNewsFolder.cpp
suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
--- a/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/mail/components/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -98,23 +98,23 @@ nsNetscapeProfileMigratorBase::GetProfil
                       rootDir->SetPersistentDescriptor(filePath);
     if (NS_FAILED(rv))
       continue;
 
     bool exists = false;
     rootDir->Exists(&exists);
 
     if (exists) {
-      aProfileLocations->AppendElement(rootDir, false);
+      aProfileLocations->AppendElement(rootDir);
 
       nsCOMPtr<nsISupportsString> profileNameString(
         do_CreateInstance("@mozilla.org/supports-string;1"));
 
       profileNameString->SetData(NS_ConvertUTF8toUTF16(buffer));
-      aProfileNames->AppendElement(profileNameString, false);
+      aProfileNames->AppendElement(profileNameString);
     }
   }
   return NS_OK;
 }
 
 #define GETPREF(xform, method, value) \
   nsresult rv = aBranch->method(xform->sourcePrefName, value); \
   if (NS_SUCCEEDED(rv)) \
--- a/mail/components/migration/src/nsProfileMigrator.cpp
+++ b/mail/components/migration/src/nsProfileMigrator.cpp
@@ -44,19 +44,19 @@ nsProfileMigrator::Migrate(nsIProfileSta
   cstr->SetData(key);
 
   // By opening the Migration FE with a supplied mailMigrator, it will automatically
   // migrate from it.
   nsCOMPtr<nsIWindowWatcher> ww (do_GetService(NS_WINDOWWATCHER_CONTRACTID));
   nsCOMPtr<nsIMutableArray> params (do_CreateInstance(NS_ARRAY_CONTRACTID));
   if (!ww || !params) return NS_ERROR_FAILURE;
 
-  params->AppendElement(cstr, false);
-  params->AppendElement(mailMigrator, false);
-  params->AppendElement(aStartup, false);
+  params->AppendElement(cstr);
+  params->AppendElement(mailMigrator);
+  params->AppendElement(aStartup);
 
   nsCOMPtr<mozIDOMWindowProxy> migrateWizard;
   return ww->OpenWindow(nullptr,
                         MIGRATION_WIZARD_FE_URL,
                         "_blank",
                         MIGRATION_WIZARD_FE_FEATURES,
                         params,
                         getter_AddRefs(migrateWizard));
--- a/mailnews/addrbook/src/nsAbLDAPCard.cpp
+++ b/mailnews/addrbook/src/nsAbLDAPCard.cpp
@@ -93,24 +93,24 @@ NS_IMETHODIMP nsAbLDAPCard::GetLDAPMessa
   {
     nsCOMPtr<nsILDAPBERValue> value =
       do_CreateInstance("@mozilla.org/network/ldap-ber-value;1", &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     rv = value->SetFromUTF8(m_objectClass.ElementAt(i));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    rv = values->AppendElement(value, false);
+    rv = values->AppendElement(value);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   rv = mod->SetUpModification(aType, NS_LITERAL_CSTRING("objectClass"), values);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  modArray->AppendElement(mod, false);
+  modArray->AppendElement(mod);
 
   // Add card properties
   CharPtrArrayGuard props;
   rv = aAttributeMap->GetAllCardProperties(props.GetSizeAddr(),
     props.GetArrayAddr());
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoCString attr;
@@ -159,17 +159,17 @@ NS_IMETHODIMP nsAbLDAPCard::GetLDAPMessa
       rv = value->SetFromUTF8(propvalue);
       NS_ENSURE_SUCCESS(rv, rv);
 
       rv = mod->SetUpModificationOneValue(aType, attr, value);
       NS_ENSURE_SUCCESS(rv, rv);
 
       printf("LDAP : setting attribute %s (%s) to '%s'\n", attr.get(),
         props[i], propvalue.get());
-      modArray->AppendElement(mod, false);
+      modArray->AppendElement(mod);
       if (index != m_attributes.NoIndex)
         m_attributes.AppendElement(attr);
 
     }
     else if (aType == nsILDAPModification::MOD_REPLACE &&
              index != m_attributes.NoIndex)
     {
       // If the new value is empty, we are performing an update
@@ -177,17 +177,17 @@ NS_IMETHODIMP nsAbLDAPCard::GetLDAPMessa
       nsCOMPtr<nsIMutableArray> novalues =
         do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
       NS_ENSURE_SUCCESS(rv, rv);
 
       rv = mod->SetUpModification(aType, attr, novalues);
       NS_ENSURE_SUCCESS(rv, rv);
 
       printf("LDAP : removing attribute %s (%s)\n", attr.get(), props[i]);
-      modArray->AppendElement(mod, false);
+      modArray->AppendElement(mod);
       m_attributes.RemoveElementAt(index);
     }
   }
 
   modArray.forget(aLDAPAddMessageInfo);
 
   return NS_OK;
 }
--- a/mailnews/addrbook/src/nsAbMDBDirProperty.cpp
+++ b/mailnews/addrbook/src/nsAbMDBDirProperty.cpp
@@ -58,34 +58,34 @@ NS_IMETHODIMP nsAbMDBDirProperty::AddMai
   {
     nsresult rv;
     m_AddressList = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   uint32_t position;
   if (NS_FAILED(m_AddressList->IndexOf(0, mailList, &position)))
-    m_AddressList->AppendElement(mailList, false);
+    m_AddressList->AppendElement(mailList);
 
   return NS_OK;
 }
 
 /* add addresses to the mailing list */
 NS_IMETHODIMP nsAbMDBDirProperty::AddAddressToList(nsIAbCard *card)
 {
   if (!m_AddressList)
   {
     nsresult rv;
     m_AddressList = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   uint32_t position;
   if (NS_FAILED(m_AddressList->IndexOf(0, card, &position)))
-    m_AddressList->AppendElement(card, false);
+    m_AddressList->AppendElement(card);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP nsAbMDBDirProperty::CopyDBMailList(nsIAbMDBDirectory* srcListDB)
 {
 	nsresult err = NS_OK;
 	nsCOMPtr<nsIAbDirectory> srcList(do_QueryInterface(srcListDB));
--- a/mailnews/addrbook/src/nsAbMDBDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbMDBDirectory.cpp
@@ -394,17 +394,17 @@ NS_IMETHODIMP nsAbMDBDirectory::GetChild
     rv = StartSearch();
     NS_ENSURE_SUCCESS(rv, rv);
 
     // TODO
     // Search is synchronous so need to return
     // results after search is complete
     nsCOMPtr<nsIMutableArray> array(do_CreateInstance(NS_ARRAY_CONTRACTID));
     for (auto iter = mSearchCache.Iter(); !iter.Done(); iter.Next()) {
-      array->AppendElement(iter.Data(), false);
+      array->AppendElement(iter.Data());
     }
     return NS_NewArrayEnumerator(result, array);
   }
 
   rv = GetAbDatabase();
 
   if (NS_FAILED(rv) || !mDatabase)
     return rv;
--- a/mailnews/addrbook/src/nsAbOSXDirectory.mm
+++ b/mailnews/addrbook/src/nsAbOSXDirectory.mm
@@ -835,32 +835,32 @@ nsAbOSXDirectory::AssertDirectory(nsIAbM
     return NS_OK;
 
   nsresult rv;
   if (!m_AddressList) {
     m_AddressList = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
   }
   
-  rv = m_AddressList->AppendElement(aDirectory, false);
+  rv = m_AddressList->AppendElement(aDirectory);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return aManager->NotifyDirectoryItemAdded(this, aDirectory);
 }
 
 nsresult
 nsAbOSXDirectory::AssertCard(nsIAbManager *aManager,
                              nsIAbCard *aCard)
 {
   nsAutoCString ourUuid;
   GetUuid(ourUuid);
   aCard->SetDirectoryId(ourUuid);
 
-  nsresult rv = m_IsMailList ? m_AddressList->AppendElement(aCard, false) :
-                               mCardList->AppendElement(aCard, false);
+  nsresult rv = m_IsMailList ? m_AddressList->AppendElement(aCard) :
+                               mCardList->AppendElement(aCard);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // Get the card's URI and add it to our card store
   nsCOMPtr<nsIAbOSXCard> osxCard = do_QueryInterface(aCard, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCString uri;
   rv = osxCard->GetURI(uri);
@@ -960,17 +960,17 @@ nsAbOSXDirectory::GetChildCards(nsISimpl
 
       if (NS_FAILED(rv))
         rv = CreateCard([cards objectAtIndex:i],
                         getter_AddRefs(card));
 
       NS_ENSURE_SUCCESS(rv, rv);
       card->SetDirectoryId(ourUuid);
 
-      mCardList->AppendElement(card, false);
+      mCardList->AppendElement(card);
     }
 
     return NS_NewArrayEnumerator(aCards, mCardList);
   }
 
   // Not a search, so just return the appropriate list of items.
   return m_IsMailList ? NS_NewArrayEnumerator(aCards, m_AddressList) :
          NS_NewArrayEnumerator(aCards, mCardList);
@@ -1204,20 +1204,20 @@ nsAbOSXDirectory::OnSearchFoundCard(nsIA
     NS_ENSURE_SUCCESS(rv, rv);
   }
   
   if (!mCardList) {
     mCardList = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
-  rv = m_AddressList->AppendElement(aCard, false);
+  rv = m_AddressList->AppendElement(aCard);
   NS_ENSURE_SUCCESS(rv, rv);
   
-  rv = mCardList->AppendElement(aCard, false);
+  rv = mCardList->AppendElement(aCard);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsAutoCString ourUuid;
   GetUuid(ourUuid);
   aCard->SetDirectoryId(ourUuid);
   
   return NS_OK;
 }
--- a/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp
+++ b/mailnews/addrbook/src/nsAbOutlookDirFactory.cpp
@@ -66,17 +66,17 @@ nsAbOutlookDirFactory::GetDirectories(co
   for (ULONG i = 0; i < folders.mNbEntries; ++i) {
     folders.mEntries[i].ToString(entryId);
     buildAbWinUri(kOutlookDirectoryScheme, abType, uri);
     uri.Append(entryId);
 
 	nsCOMPtr<nsIAbDirectory> directory;
 	rv = abManager->GetDirectory(uri, getter_AddRefs(directory));
     NS_ENSURE_SUCCESS(rv, rv);
-    directories->AppendElement(directory, false);
+    directories->AppendElement(directory);
   }
   return NS_NewArrayEnumerator(aDirectories, directories);
 }
 
 // No actual deletion, since you cannot create the address books from Mozilla.
 NS_IMETHODIMP nsAbOutlookDirFactory::DeleteDirectory(nsIAbDirectory *aDirectory)
 {
   return NS_OK;
--- a/mailnews/addrbook/src/nsAbOutlookDirectory.cpp
+++ b/mailnews/addrbook/src/nsAbOutlookDirectory.cpp
@@ -191,22 +191,22 @@ NS_IMETHODIMP nsAbOutlookDirectory::GetC
         // we must add the directory to m_AddressList
         nsCString mailListUri;
         rv = card->GetMailListURI(getter_Copies(mailListUri));
         NS_ENSURE_SUCCESS(rv, rv);
         nsCOMPtr<nsIAbDirectory> mailList;
         rv = abManager->GetDirectory(mailListUri, getter_AddRefs(mailList));
         NS_ENSURE_SUCCESS(rv, rv);
 
-        m_AddressList->AppendElement(mailList, false);
+        m_AddressList->AppendElement(mailList);
         NotifyItemAddition(mailList);
       }
       else if (m_IsMailList)
       {
-        m_AddressList->AppendElement(card, false);
+        m_AddressList->AppendElement(card);
         NotifyItemAddition(card);
       }
     }
   }
   return rv;
 }
 
 NS_IMETHODIMP nsAbOutlookDirectory::GetIsQuery(bool *aResult)
@@ -371,17 +371,17 @@ NS_IMETHODIMP nsAbOutlookDirectory::AddC
 
     if (!m_AddressList)
     {
         m_AddressList = do_CreateInstance(NS_ARRAY_CONTRACTID, &retCode);
         NS_ENSURE_SUCCESS(retCode, retCode);
     }
 
     if (m_IsMailList)
-        m_AddressList->AppendElement(*addedCard, false);
+        m_AddressList->AppendElement(*addedCard);
     NotifyItemAddition(*addedCard) ;
     return retCode ;
 }
 
 NS_IMETHODIMP nsAbOutlookDirectory::DropCard(nsIAbCard *aData, bool needToCopyCard)
 {
     nsCOMPtr <nsIAbCard> addedCard;
     return AddCard(aData, getter_AddRefs(addedCard));
@@ -440,17 +440,17 @@ NS_IMETHODIMP nsAbOutlookDirectory::AddM
     NS_ENSURE_SUCCESS(rv, rv);
   }
 
   if (!m_AddressList)
   {
     m_AddressList = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
   }
-  m_AddressList->AppendElement(newList, false);
+  m_AddressList->AppendElement(newList);
   NotifyItemAddition(newList);
   newList.forget(addedList);
 
   return rv;
 }
 
 NS_IMETHODIMP nsAbOutlookDirectory::EditMailListToDatabase(nsIAbCard *listCard)
 {
@@ -1035,17 +1035,17 @@ nsresult nsAbOutlookDirectory::GetChildC
     cardEntries.mEntries[card].ToString(entryId);
     buildAbWinUri(kOutlookCardScheme, mAbWinType, uriName);
     uriName.Append(entryId);
 
     rv = OutlookCardForURI(uriName, getter_AddRefs(childCard));
     NS_ENSURE_SUCCESS(rv, rv);
     childCard->SetDirectoryId(ourUuid);
 
-    aCards->AppendElement(childCard, false);
+    aCards->AppendElement(childCard);
   }
   return rv;
 }
 
 nsresult nsAbOutlookDirectory::GetChildNodes(nsIMutableArray* aNodes)
 {
   NS_ENSURE_ARG_POINTER(aNodes);
 
@@ -1075,17 +1075,17 @@ nsresult nsAbOutlookDirectory::GetChildN
     nodeEntries.mEntries[node].ToString(entryId);
     buildAbWinUri(kOutlookDirectoryScheme, mAbWinType, uriName);
     uriName.Append(entryId);
 
     nsCOMPtr <nsIAbDirectory> directory;
     rv = abManager->GetDirectory(uriName, getter_AddRefs(directory));
     NS_ENSURE_SUCCESS(rv, rv);
 
-    aNodes->AppendElement(directory, false);
+    aNodes->AppendElement(directory);
   }
   return rv;
 }
 
 nsresult nsAbOutlookDirectory::NotifyItemDeletion(nsISupports *aItem)
 {
   nsresult rv;
   nsCOMPtr<nsIAbManager> abManager(do_GetService(NS_ABMANAGER_CONTRACTID, &rv));
@@ -1144,17 +1144,17 @@ nsresult nsAbOutlookDirectory::CommitAdd
         NS_ENSURE_SUCCESS(rv, rv);
 
         // The entry was not already there
         nsCOMPtr<nsIAbCard> card(do_QueryInterface(element, &rv));
         NS_ENSURE_SUCCESS(rv, rv);
 
         rv = CreateCard(card, getter_AddRefs(newCard));
         NS_ENSURE_SUCCESS(rv, rv);
-        m_AddressList->ReplaceElementAt(newCard, i, false);
+        m_AddressList->ReplaceElementAt(newCard, i);
     }
   }
   return DeleteCards(oldList);
 }
 
 nsresult nsAbOutlookDirectory::UpdateAddressList(void)
 {
     if (!m_AddressList)
--- a/mailnews/addrbook/src/nsAbQueryStringToExpression.cpp
+++ b/mailnews/addrbook/src/nsAbQueryStringToExpression.cpp
@@ -135,17 +135,17 @@ nsresult nsAbQueryStringToExpression::Pa
     // Case: ")(*)(*)....(*))"
     // printf ("Case: )(*)(*)....(*)): %s\n", *index);
     while (**index == '(')
     {
         nsCOMPtr<nsISupports> childExpression;
         rv = ParseExpression(index, getter_AddRefs (childExpression));
         NS_ENSURE_SUCCESS(rv, rv);
 
-        expressions->AppendElement(childExpression, false);
+        expressions->AppendElement(childExpression);
     }
 
     if (**index == 0)
         return NS_ERROR_FAILURE;
 
     // Case: "))"
     // printf ("Case: )): %s\n", *index);
 
--- a/mailnews/addrbook/src/nsAbView.cpp
+++ b/mailnews/addrbook/src/nsAbView.cpp
@@ -1219,17 +1219,17 @@ nsresult nsAbView::GetSelectedCards(nsCO
     int32_t totalCards = mCards.Length();
     if (startRange >= 0 && startRange < totalCards)
     {
       for (int32_t rangeIndex = startRange; rangeIndex <= endRange && rangeIndex < totalCards; rangeIndex++) {
         nsCOMPtr<nsIAbCard> abCard;
         rv = GetCardFromRow(rangeIndex, getter_AddRefs(abCard));
         NS_ENSURE_SUCCESS(rv,rv);
 
-        rv = aSelectedCards->AppendElement(abCard, false);
+        rv = aSelectedCards->AppendElement(abCard);
         NS_ENSURE_SUCCESS(rv, rv);
       }
     }
   }
 
   return NS_OK;
 }
 
@@ -1415,28 +1415,28 @@ NS_IMETHODIMP nsAbView::GetSelectedAddre
         NS_ENSURE_SUCCESS(rv,rv);
 
         rv = mailListCard->GetPrimaryEmail(primaryEmail);
         NS_ENSURE_SUCCESS(rv,rv);
 
         if (!primaryEmail.IsEmpty()) {
           nsCOMPtr<nsISupportsString> supportsEmail(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
           supportsEmail->SetData(primaryEmail);
-          addresses->AppendElement(supportsEmail, false);
+          addresses->AppendElement(supportsEmail);
         }
       }
     }
     else {
       rv = card->GetPrimaryEmail(primaryEmail);
       NS_ENSURE_SUCCESS(rv,rv);
 
       if (!primaryEmail.IsEmpty()) {
         nsCOMPtr<nsISupportsString> supportsEmail(do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID));
         supportsEmail->SetData(primaryEmail);
-        addresses->AppendElement(supportsEmail, false);
+        addresses->AppendElement(supportsEmail);
       }
     }
   }
 
   addresses.forget(_retval);
 
   return NS_OK;
 }
--- a/mailnews/addrbook/src/nsAddrDatabase.cpp
+++ b/mailnews/addrbook/src/nsAddrDatabase.cpp
@@ -1220,17 +1220,17 @@ NS_IMETHODIMP nsAddrDatabase::CreateNewL
 
   // start from 1
   uint32_t totalAddress = GetListAddressTotal(pListRow) + 1;
   SetListAddressTotal(pListRow, totalAddress);
   nsCOMPtr<nsIAbCard> pNewCard;
   rv = AddListCardColumnsToRow(newCard, pListRow, totalAddress, getter_AddRefs(pNewCard), true /* aInMailingList */, aList, nullptr);
   NS_ENSURE_SUCCESS(rv,rv);
 
-  addressList->AppendElement(newCard, false);
+  addressList->AppendElement(newCard);
 
   if (notify)
     NotifyCardEntryChange(AB_NotifyInserted, newCard, aList);
 
   return rv;
 }
 
 NS_IMETHODIMP nsAddrDatabase::AddListCardColumnsToRow
@@ -1383,17 +1383,17 @@ nsresult nsAddrDatabase::AddListAttribut
             // start from 1
             pos = i + 1;
             pCard->GetPrimaryEmail(email);
             if (!email.IsEmpty())
             {
                 nsCOMPtr<nsIAbCard> pNewCard;
                 err = AddListCardColumnsToRow(pCard, listRow, pos, getter_AddRefs(pNewCard), listHasCard, list, aParent);
                 if (pNewCard)
-                    pAddressLists->ReplaceElementAt(pNewCard, i, false);
+                    pAddressLists->ReplaceElementAt(pNewCard, i);
             }
         }
     }
     return NS_OK;
 }
 
 uint32_t nsAddrDatabase::GetListAddressTotal(nsIMdbRow* listRow)
 {
--- a/mailnews/base/search/src/nsMsgFilter.cpp
+++ b/mailnews/base/search/src/nsMsgFilter.cpp
@@ -240,17 +240,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(aTerm, /* weak = */ false);
+    return m_termList->AppendElement(aTerm);
 }
 
 NS_IMETHODIMP
 nsMsgFilter::CreateTerm(nsIMsgSearchTerm **aResult)
 {
     NS_ENSURE_ARG_POINTER(aResult);
     NS_ADDREF(*aResult = new nsMsgSearchTerm);
     return NS_OK;
@@ -304,56 +304,56 @@ nsMsgFilter::GetSortedActionList(nsIArra
 
     nsMsgRuleActionType actionType;
     action->GetType(&actionType);
     switch (actionType)
     {
       case nsMsgFilterAction::FetchBodyFromPop3Server:
       {
         // always insert in front
-        rv = orderedActions->InsertElementAt(action, 0, false);
+        rv = orderedActions->InsertElementAt(action, 0);
         NS_ENSURE_SUCCESS(rv, rv);
         ++nextIndexForNormal;
         ++nextIndexForCopy;
         ++nextIndexForMove;
         break;
       }
 
       case nsMsgFilterAction::CopyToFolder:
       {
         // insert into copy actions block, in order of appearance
-        rv = orderedActions->InsertElementAt(action, nextIndexForCopy, false);
+        rv = orderedActions->InsertElementAt(action, nextIndexForCopy);
         NS_ENSURE_SUCCESS(rv, rv);
         ++nextIndexForCopy;
         ++nextIndexForMove;
         break;
       }
 
       case nsMsgFilterAction::MoveToFolder:
       case nsMsgFilterAction::Delete:
       {
         // insert into move/delete action block
-        rv = orderedActions->InsertElementAt(action, nextIndexForMove, false);
+        rv = orderedActions->InsertElementAt(action, nextIndexForMove);
         NS_ENSURE_SUCCESS(rv, rv);
         ++nextIndexForMove;
         break;
       }
 
       case nsMsgFilterAction::StopExecution:
       {
         // insert into stop action block
-        rv = orderedActions->AppendElement(action, false);
+        rv = orderedActions->AppendElement(action);
         NS_ENSURE_SUCCESS(rv, rv);
         break;
       }
 
       default:
       {
         // insert into normal action block, in order of appearance
-        rv = orderedActions->InsertElementAt(action, nextIndexForNormal, false);
+        rv = orderedActions->InsertElementAt(action, nextIndexForNormal);
         NS_ENSURE_SUCCESS(rv, rv);
         ++nextIndexForNormal;
         ++nextIndexForCopy;
         ++nextIndexForMove;
         break;
       }
     }
   }
--- a/mailnews/base/search/src/nsMsgFilterService.cpp
+++ b/mailnews/base/search/src/nsMsgFilterService.cpp
@@ -487,17 +487,17 @@ NS_IMETHODIMP nsMsgFilterAfterTheFact::O
   header->GetMessageKey(&msgKey);
 
   // Under various previous actions (a move, delete, or stopExecution)
   //  we do not want to process filters on a per-message basis.
   if (m_stopFiltering.Contains(msgKey))
     return NS_OK;
 
   m_searchHits.AppendElement(msgKey);
-  m_searchHitHdrs->AppendElement(header, false);
+  m_searchHitHdrs->AppendElement(header);
   return NS_OK;
 }
 
 // Continue after an async operation.
 NS_IMETHODIMP nsMsgFilterAfterTheFact::OnSearchDone(nsresult status)
 {
   if (NS_SUCCEEDED(status))
     return m_searchHits.IsEmpty() ? RunNextFilter() : ApplyFilter();
@@ -806,17 +806,17 @@ nsresult nsMsgFilterAfterTheFact::ApplyF
             CONTINUE_IF_FALSE(msgHdr, "Could not get msgHdr");
             uint32_t flags;
             msgHdr->GetFlags(&flags);
             if (flags & nsMsgMessageFlags::Partial)
             {
               if (!partialMsgs)
                 partialMsgs = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
               CONTINUE_IF_FALSE(partialMsgs, "Could not create partialMsgs array");
-              partialMsgs->AppendElement(msgHdr, false);
+              partialMsgs->AppendElement(msgHdr);
               m_stopFiltering.AppendElement(m_searchHits[msgIndex]);
               m_curFolder->OrProcessingFlags(m_searchHits[msgIndex],
                                              nsMsgProcessingFlags::FilterToMove);
             }
           }
           if (partialMsgs)
           {
             m_curFolder->DeleteMessages(partialMsgs, m_msgWindow, true, false, nullptr, false);
@@ -832,17 +832,17 @@ nsresult nsMsgFilterAfterTheFact::ApplyF
           CONTINUE_IF_FAILURE(rv, "Could not create messages array");
           for (uint32_t msgIndex = 0; msgIndex < m_searchHits.Length(); msgIndex++)
           {
             nsCOMPtr<nsIMsgDBHdr> msgHdr = do_QueryElementAt(m_searchHitHdrs, msgIndex);
             CONTINUE_IF_FALSE(msgHdr, "Could not get msgHdr");
             uint32_t flags = 0;
             msgHdr->GetFlags(&flags);
             if (flags & nsMsgMessageFlags::Partial)
-              messages->AppendElement(msgHdr, false);
+              messages->AppendElement(msgHdr);
           }
           uint32_t msgsToFetch;
           messages->GetLength(&msgsToFetch);
           if (msgsToFetch > 0)
           {
             rv = m_curFolder->DownloadMessagesForOffline(messages, m_msgWindow);
             CONTINUE_IF_FAILURE(rv, "DownloadMessagesForOffline failed");
           }
@@ -1097,17 +1097,17 @@ NS_IMETHODIMP nsMsgFilterService::ApplyF
 
   nsCOMPtr<nsIMsgFilterList>    filterList;
   nsresult rv = aFolder->GetFilterList(aMsgWindow, getter_AddRefs(filterList));
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMutableArray> folderList(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  folderList->AppendElement(aFolder, false);
+  folderList->AppendElement(aFolder);
 
   // Create our nsMsgApplyFiltersToMessages object which will be called when ApplyFiltersToHdr
   // finds one or more filters that hit.
   RefPtr<nsMsgApplyFiltersToMessages> filterExecutor =
     new nsMsgApplyFiltersToMessages(aMsgWindow, filterList, folderList,
                                     aMsgHdrList, aFilterType, aCallback);
 
   if (filterExecutor)
--- a/mailnews/base/search/src/nsMsgSearchSession.cpp
+++ b/mailnews/base/search/src/nsMsgSearchSession.cpp
@@ -57,31 +57,31 @@ 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, /* weak = */ false);
+  m_termList->AppendElement(pTerm);
   // 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, /* weak = */ false);
+    return m_termList->AppendElement(aTerm);
 }
 
 NS_IMETHODIMP
 nsMsgSearchSession::GetSearchTerms(nsIMutableArray **aResult)
 {
     NS_ENSURE_ARG_POINTER(aResult);
     NS_ADDREF(*aResult = m_termList);
     return NS_OK;
--- a/mailnews/base/src/nsMessenger.cpp
+++ b/mailnews/base/src/nsMessenger.cpp
@@ -2682,17 +2682,17 @@ nsDelAttachListener::OnStartRunningUrl(n
 }
 
 nsresult nsDelAttachListener::DeleteOriginalMessage()
 {
   nsresult rv;
   nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
-  rv = messageArray->AppendElement(mOriginalMessage, false);
+  rv = messageArray->AppendElement(mOriginalMessage);
   NS_ENSURE_SUCCESS(rv,rv);
   nsCOMPtr<nsIMsgCopyServiceListener> listenerCopyService;
 
   QueryInterface( NS_GET_IID(nsIMsgCopyServiceListener), getter_AddRefs(listenerCopyService) );
 
   mOriginalMessage = nullptr;
   m_state = eDeletingOldMessage;
   return mMessageFolder->DeleteMessages(
--- a/mailnews/base/src/nsMessengerBootstrap.cpp
+++ b/mailnews/base/src/nsMessengerBootstrap.cpp
@@ -49,30 +49,30 @@ NS_IMETHODIMP nsMessengerBootstrap::Open
       nsAutoCString msgUri;
       folder->GetBaseMessageURI(msgUri);
 
       nsCOMPtr<nsISupportsCString> scriptableMsgURI (do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
       NS_ENSURE_TRUE(scriptableMsgURI, NS_ERROR_FAILURE);
       msgUri.Append('#');
       msgUri.AppendInt(aMessageKey, 10);
       scriptableMsgURI->SetData(msgUri);
-      argsArray->AppendElement(scriptableMsgURI, false);
+      argsArray->AppendElement(scriptableMsgURI);
     }
     nsCOMPtr<nsISupportsCString> scriptableFolderURI (do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID));
     NS_ENSURE_TRUE(scriptableFolderURI, NS_ERROR_FAILURE);
 
     scriptableFolderURI->SetData(nsDependentCString(aFolderURI));
-    argsArray->AppendElement(scriptableFolderURI, false);
+    argsArray->AppendElement(scriptableFolderURI);
 
     if (!standAloneMsgWindow)
     {
       nsCOMPtr<nsISupportsPRUint32> scriptableMessageKey (do_CreateInstance(NS_SUPPORTS_PRUINT32_CONTRACTID));
       NS_ENSURE_TRUE(scriptableMessageKey, NS_ERROR_FAILURE);
       scriptableMessageKey->SetData(aMessageKey);
-      argsArray->AppendElement(scriptableMessageKey, false);
+      argsArray->AppendElement(scriptableMessageKey);
     }
   }
 
   nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
 
   // we need to use the "mailnews.reuse_thread_window2" pref
   // to determine if we should open a new window, or use an existing one.
--- a/mailnews/base/src/nsMessengerUnixIntegration.cpp
+++ b/mailnews/base/src/nsMessengerUnixIntegration.cpp
@@ -379,31 +379,31 @@ nsresult nsMessengerUnixIntegration::Sho
   if (!argsArray)
     return NS_ERROR_FAILURE;
 
   // pass in the array of folders with unread messages
   nsCOMPtr<nsISupportsInterfacePointer> ifptr = do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   ifptr->SetData(mFoldersWithNewMail);
   ifptr->SetDataIID(&NS_GET_IID(nsIArray));
-  argsArray->AppendElement(ifptr, false);
+  argsArray->AppendElement(ifptr);
 
   // pass in the observer
   ifptr = do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr <nsISupports> supports = do_QueryInterface(static_cast<nsIMessengerOSIntegration*>(this));
   ifptr->SetData(supports);
   ifptr->SetDataIID(&NS_GET_IID(nsIObserver));
-  argsArray->AppendElement(ifptr, false);
+  argsArray->AppendElement(ifptr);
 
   // pass in the animation flag
   nsCOMPtr<nsISupportsPRBool> scriptableUserInitiated (do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
   scriptableUserInitiated->SetData(aUserInitiated);
-  argsArray->AppendElement(scriptableUserInitiated, false);
+  argsArray->AppendElement(scriptableUserInitiated);
 
   nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
   nsCOMPtr<mozIDOMWindowProxy> newWindow;
 
   mAlertInProgress = true;
   rv = wwatch->OpenWindow(0, ALERT_CHROME_URL, "_blank",
                           "chrome,dialog=yes,titlebar=no,popup=yes", argsArray,
                           getter_AddRefs(newWindow));
@@ -689,17 +689,17 @@ nsMessengerUnixIntegration::OnItemIntPro
       nsCOMPtr<nsIMsgIncomingServer> server;
       aItem->GetServer(getter_AddRefs(server));
       if (server)
         server->GetPerformingBiff(&performingBiff);
       if (!performingBiff)
         return NS_OK; // kick out right now...
 
       if (!folderFound)
-        mFoldersWithNewMail->AppendElement(weakFolder, false);
+        mFoldersWithNewMail->AppendElement(weakFolder);
       // now regenerate the tooltip
       FillToolTipInfo();
     }
     else if (aNewValue == nsIMsgFolder::nsMsgBiffState_NoMail)
     {
       if (folderFound) {
         mFoldersWithNewMail->RemoveElementAt(indexInNewArray);
       }
--- a/mailnews/base/src/nsMessengerWinIntegration.cpp
+++ b/mailnews/base/src/nsMessengerWinIntegration.cpp
@@ -486,44 +486,44 @@ nsresult nsMessengerWinIntegration::Show
     nsCOMPtr<nsIMutableArray> argsArray(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv, rv);
 
     // pass in the array of folders with unread messages
     nsCOMPtr<nsISupportsInterfacePointer> ifptr = do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
     ifptr->SetData(mFoldersWithNewMail);
     ifptr->SetDataIID(&NS_GET_IID(nsIArray));
-    rv = argsArray->AppendElement(ifptr, false);
+    rv = argsArray->AppendElement(ifptr);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // pass in the observer
     ifptr = do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
     nsCOMPtr <nsISupports> supports = do_QueryInterface(static_cast<nsIMessengerOSIntegration*>(this));
     ifptr->SetData(supports);
     ifptr->SetDataIID(&NS_GET_IID(nsIObserver));
-    rv = argsArray->AppendElement(ifptr, false);
+    rv = argsArray->AppendElement(ifptr);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // pass in the animation flag
     nsCOMPtr<nsISupportsPRBool> scriptableUserInitiated (do_CreateInstance(NS_SUPPORTS_PRBOOL_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv, rv);
     scriptableUserInitiated->SetData(aUserInitiated);
-    rv = argsArray->AppendElement(scriptableUserInitiated, false);
+    rv = argsArray->AppendElement(scriptableUserInitiated);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // pass in the alert origin
     nsCOMPtr<nsISupportsPRUint8> scriptableOrigin (do_CreateInstance(NS_SUPPORTS_PRUINT8_CONTRACTID));
     NS_ENSURE_TRUE(scriptableOrigin, NS_ERROR_FAILURE);
     scriptableOrigin->SetData(0);
     int32_t origin = 0;
     origin = LookAndFeel::GetInt(LookAndFeel::eIntID_AlertNotificationOrigin);
     scriptableOrigin->SetData(origin);
 
-    rv = argsArray->AppendElement(scriptableOrigin, false);
+    rv = argsArray->AppendElement(scriptableOrigin);
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService(NS_WINDOWWATCHER_CONTRACTID));
     nsCOMPtr<mozIDOMWindowProxy> newWindow;
     rv = wwatch->OpenWindow(0, ALERT_CHROME_URL, "_blank",
                 "chrome,dialog=yes,titlebar=no,popup=yes", argsArray,
                  getter_AddRefs(newWindow));
 
@@ -863,17 +863,17 @@ nsMessengerWinIntegration::OnItemIntProp
         nsCOMPtr<nsIMsgIncomingServer> server;
         aItem->GetServer(getter_AddRefs(server));
         if (server)
           server->GetPerformingBiff(&performingBiff);
         if (!performingBiff)
           return NS_OK; // kick out right now...
       }
       if (!folderFound)
-        mFoldersWithNewMail->InsertElementAt(weakFolder, 0, false);
+        mFoldersWithNewMail->InsertElementAt(weakFolder, 0);
       // now regenerate the tooltip
       FillToolTipInfo();
     }
     else if (aNewValue == nsIMsgFolder::nsMsgBiffState_NoMail)
     {
       // we are always going to remove the icon whenever we get our first no mail
       // notification.
 
--- a/mailnews/base/src/nsMsgAccount.cpp
+++ b/mailnews/base/src/nsMsgAccount.cpp
@@ -263,31 +263,31 @@ nsMsgAccount::SetDefaultIdentity(nsIMsgI
   uint32_t position = 0;
   nsresult rv = m_identities->IndexOf(0, aDefaultIdentity, &position);
   NS_ENSURE_SUCCESS(rv, rv);
 
   rv = m_identities->RemoveElementAt(position);
   NS_ENSURE_SUCCESS(rv, rv);
 
   // The passed in identity is in the list, so we have at least one element.
-  rv = m_identities->InsertElementAt(aDefaultIdentity, 0, false);
+  rv = m_identities->InsertElementAt(aDefaultIdentity, 0);
   NS_ENSURE_SUCCESS(rv, rv);
 
   return saveIdentitiesPref();
 }
 
 // add the identity to m_identities, but don't fiddle with the
 // prefs. The assumption here is that the pref for this identity is
 // already set.
 nsresult
 nsMsgAccount::addIdentityInternal(nsIMsgIdentity *identity)
 {
   NS_ENSURE_TRUE(m_identities, NS_ERROR_FAILURE);
 
-  return m_identities->AppendElement(identity, false);
+  return m_identities->AppendElement(identity);
 }
 
 /* void addIdentity (in nsIMsgIdentity identity); */
 NS_IMETHODIMP
 nsMsgAccount::AddIdentity(nsIMsgIdentity *identity)
 {
   NS_ENSURE_ARG_POINTER(identity);
 
--- a/mailnews/base/src/nsMsgAccountManager.cpp
+++ b/mailnews/base/src/nsMsgAccountManager.cpp
@@ -920,17 +920,17 @@ nsMsgAccountManager::GetAccounts(nsIArra
       continue;
     if (server)
     {
       bool hidden = false;
       server->GetHidden(&hidden);
       if (hidden)
         continue;
     }
-    accounts->AppendElement(existingAccount, false);
+    accounts->AppendElement(existingAccount);
   }
   accounts.forget(_retval);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::GetAllIdentities(nsIArray **_retval)
 {
@@ -978,17 +978,17 @@ nsMsgAccountManager::GetAllIdentities(ns
         if (NS_FAILED(rv))
           continue;
 
         if (key == thisKey)
           found = true;
       }
 
       if (!found)
-        result->AppendElement(identity, false);
+        result->AppendElement(identity);
     }
   }
   result.forget(_retval);
   return rv;
 }
 
 NS_IMETHODIMP
 nsMsgAccountManager::GetAllServers(nsIArray **_retval)
@@ -1011,17 +1011,17 @@ nsMsgAccountManager::GetAllServers(nsIAr
 
     nsCString type;
     if (NS_FAILED(server->GetType(type))) {
       NS_WARNING("server->GetType() failed");
       continue;
     }
 
     if (!type.EqualsLiteral("im")) {
-      servers->AppendElement(server, false);
+      servers->AppendElement(server);
     }
   }
 
   servers.forget(_retval);
   return rv;
 }
 
 nsresult
@@ -2125,17 +2125,17 @@ nsMsgAccountManager::GetIdentitiesForSer
         uint32_t theseLength;
         rv = theseIdentities->GetLength(&theseLength);
         if (NS_SUCCEEDED(rv))
         {
           for (uint32_t j = 0; j < theseLength; ++j)
           {
             nsCOMPtr<nsISupports> id(do_QueryElementAt(theseIdentities, j, &rv));
             if (NS_SUCCEEDED(rv))
-              identities->AppendElement(id, false);
+              identities->AppendElement(id);
           }
         }
       }
     }
   }
 
   identities.forget(_retval);
   return NS_OK;
@@ -2176,17 +2176,17 @@ nsMsgAccountManager::GetServersForIdenti
         rv = thisIdentity->GetKey(thisIdentityKey);
 
         if (NS_SUCCEEDED(rv) && identityKey.Equals(thisIdentityKey))
         {
           nsCOMPtr<nsIMsgIncomingServer> thisServer;
           rv = m_accounts[i]->GetIncomingServer(getter_AddRefs(thisServer));
           if (thisServer && NS_SUCCEEDED(rv))
           {
-            servers->AppendElement(thisServer, false);
+            servers->AppendElement(thisServer);
             break;
           }
         }
       }
     }
   }
   servers.forget(_retval);
   return NS_OK;
--- a/mailnews/base/src/nsMsgAccountManagerDS.cpp
+++ b/mailnews/base/src/nsMsgAccountManagerDS.cpp
@@ -752,47 +752,47 @@ nsMsgAccountManagerDataSource::serverHas
 nsresult
 nsMsgAccountManagerDataSource::getAccountArcs(nsIMutableArray **aResult)
 {
   nsresult rv;
   if (!mAccountArcsOut) {
     mAccountArcsOut = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    mAccountArcsOut->AppendElement(kNC_Settings, false);
-    mAccountArcsOut->AppendElement(kNC_Name, false);
-    mAccountArcsOut->AppendElement(kNC_FolderTreeName, false);
-    mAccountArcsOut->AppendElement(kNC_FolderTreeSimpleName, false);
-    mAccountArcsOut->AppendElement(kNC_NameSort, false);
-    mAccountArcsOut->AppendElement(kNC_FolderTreeNameSort, false);
-    mAccountArcsOut->AppendElement(kNC_PageTag, false);
+    mAccountArcsOut->AppendElement(kNC_Settings);
+    mAccountArcsOut->AppendElement(kNC_Name);
+    mAccountArcsOut->AppendElement(kNC_FolderTreeName);
+    mAccountArcsOut->AppendElement(kNC_FolderTreeSimpleName);
+    mAccountArcsOut->AppendElement(kNC_NameSort);
+    mAccountArcsOut->AppendElement(kNC_FolderTreeNameSort);
+    mAccountArcsOut->AppendElement(kNC_PageTag);
   }
 
   NS_IF_ADDREF(*aResult = mAccountArcsOut);
   return NS_OK;
 }
 
 nsresult
 nsMsgAccountManagerDataSource::getAccountRootArcs(nsIMutableArray **aResult)
 {
   nsresult rv;
   if (!mAccountRootArcsOut) {
     mAccountRootArcsOut = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
-    mAccountRootArcsOut->AppendElement(kNC_Server, false);
-    mAccountRootArcsOut->AppendElement(kNC_Child, false);
+    mAccountRootArcsOut->AppendElement(kNC_Server);
+    mAccountRootArcsOut->AppendElement(kNC_Child);
 
-    mAccountRootArcsOut->AppendElement(kNC_Settings, false);
-    mAccountRootArcsOut->AppendElement(kNC_Name, false);
-    mAccountRootArcsOut->AppendElement(kNC_FolderTreeName, false);
-    mAccountRootArcsOut->AppendElement(kNC_FolderTreeSimpleName, false);
-    mAccountRootArcsOut->AppendElement(kNC_NameSort, false);
-    mAccountRootArcsOut->AppendElement(kNC_FolderTreeNameSort, false);
-    mAccountRootArcsOut->AppendElement(kNC_PageTag, false);
+    mAccountRootArcsOut->AppendElement(kNC_Settings);
+    mAccountRootArcsOut->AppendElement(kNC_Name);
+    mAccountRootArcsOut->AppendElement(kNC_FolderTreeName);
+    mAccountRootArcsOut->AppendElement(kNC_FolderTreeSimpleName);
+    mAccountRootArcsOut->AppendElement(kNC_NameSort);
+    mAccountRootArcsOut->AppendElement(kNC_FolderTreeNameSort);
+    mAccountRootArcsOut->AppendElement(kNC_PageTag);
   }
 
   NS_IF_ADDREF(*aResult = mAccountRootArcsOut);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsMsgAccountManagerDataSource::HasArcOut(nsIRDFResource *source, nsIRDFResource *aArc, bool *result)
--- a/mailnews/base/src/nsMsgCopyService.cpp
+++ b/mailnews/base/src/nsMsgCopyService.cpp
@@ -37,17 +37,17 @@ nsCopySource::nsCopySource(nsIMsgFolder*
 
 nsCopySource::~nsCopySource()
 {
   MOZ_COUNT_DTOR(nsCopySource);
 }
 
 void nsCopySource::AddMessage(nsIMsgDBHdr* aMsg)
 {
-  m_messageArray->AppendElement(aMsg, false);
+  m_messageArray->AppendElement(aMsg);
 }
 
 // ************ nsCopyRequest *****************
 //
 
 nsCopyRequest::nsCopyRequest() :
     m_requestType(nsCopyMessagesType),
     m_isMoveOrDraftOrTemplate(false),
--- a/mailnews/base/src/nsMsgDBView.cpp
+++ b/mailnews/base/src/nsMsgDBView.cpp
@@ -3112,17 +3112,17 @@ nsMsgDBView::ListCollapsedChildren(nsMsg
   thread->GetNumChildren(&numChildren);
   for (uint32_t i = 1; i < numChildren && NS_SUCCEEDED(rv); i++)
   {
     nsCOMPtr<nsIMsgDBHdr> msgHdr;
     rv = thread->GetChildHdrAt(i, getter_AddRefs(msgHdr));
     if (!msgHdr)
       continue;
 
-    rv = messageArray->AppendElement(msgHdr, false);
+    rv = messageArray->AppendElement(msgHdr);
   }
 
   return rv;
 }
 
 bool
 nsMsgDBView::OperateOnMsgsInCollapsedThreads()
 {
@@ -3175,17 +3175,17 @@ nsMsgDBView::GetHeadersFromSelection(uin
 
       continue;
     }
 
     nsCOMPtr<nsIMsgDBHdr> msgHdr;
     rv = GetMsgHdrForViewIndex(viewIndex, getter_AddRefs(msgHdr));
     if (NS_SUCCEEDED(rv) && msgHdr)
     {
-      rv = messageArray->AppendElement(msgHdr, false);
+      rv = messageArray->AppendElement(msgHdr);
       if (NS_SUCCEEDED(rv) && includeCollapsedMsgs &&
           viewIndexFlags & nsMsgMessageFlags::Elided &&
           viewIndexFlags & MSG_VIEW_FLAG_HASCHILDREN &&
           m_viewFlags & nsMsgViewFlagsType::kThreadedDisplay)
       {
         rv = ListCollapsedChildren(viewIndex, messageArray);
       }
     }
@@ -3345,23 +3345,23 @@ nsMsgDBView::ApplyCommandToIndices(nsMsg
       msgHdr->GetMessageKey(&msgKey);
       if (thisIsImapFolder)
         imapUids[i] = msgKey;
 
       switch (command)
       {
         case nsMsgViewCommandType::junk:
           mNumMessagesRemainingInBatch++;
-          mJunkHdrs->AppendElement(msgHdr, false);
+          mJunkHdrs->AppendElement(msgHdr);
           rv = SetMsgHdrJunkStatus(junkPlugin.get(), msgHdr,
                                    nsIJunkMailPlugin::JUNK);
           break;
         case nsMsgViewCommandType::unjunk:
           mNumMessagesRemainingInBatch++;
-          mJunkHdrs->AppendElement(msgHdr, false);
+          mJunkHdrs->AppendElement(msgHdr);
           rv = SetMsgHdrJunkStatus(junkPlugin.get(), msgHdr,
                                    nsIJunkMailPlugin::GOOD);
           break;
         case nsMsgViewCommandType::toggleMessageRead:
         case nsMsgViewCommandType::undeleteMsg:
         case nsMsgViewCommandType::markMessagesRead:
         case nsMsgViewCommandType::markMessagesUnread:
         case nsMsgViewCommandType::unflagMessages:
@@ -3653,17 +3653,17 @@ nsMsgDBView::DownloadForOffline(nsIMsgWi
     nsCOMPtr <nsIMsgDBHdr> msgHdr;
     rv = m_db->GetMsgHdrForKey(key, getter_AddRefs(msgHdr));
     NS_ENSURE_SUCCESS(rv,rv);
     if (msgHdr)
     {
       uint32_t flags;
       msgHdr->GetFlags(&flags);
       if (!(flags & nsMsgMessageFlags::Offline))
-        messageArray->AppendElement(msgHdr, false);
+        messageArray->AppendElement(msgHdr);
     }
   }
 
   m_folder->DownloadMessagesForOffline(messageArray, window);
   return rv;
 }
 
 nsresult
@@ -3682,17 +3682,17 @@ nsMsgDBView::DownloadFlaggedForOffline(n
       rv = enumerator->GetNext(getter_AddRefs(supports));
       NS_ASSERTION(NS_SUCCEEDED(rv), "nsMsgDBEnumerator broken");
       nsCOMPtr <nsIMsgDBHdr> pHeader = do_QueryInterface(supports);
       if (pHeader && NS_SUCCEEDED(rv))
       {
         uint32_t flags;
         pHeader->GetFlags(&flags);
         if ((flags & nsMsgMessageFlags::Marked) && !(flags & nsMsgMessageFlags::Offline))
-          messageArray->AppendElement(pHeader, false);
+          messageArray->AppendElement(pHeader);
       }
     }
   }
 
   m_folder->DownloadMessagesForOffline(messageArray, window);
   return rv;
 }
 
@@ -3994,17 +3994,17 @@ nsMsgDBView::PerformActionsOnJunkMsgs(bo
         for (uint32_t i = 0; i < cnt; i++)
         {
           nsCOMPtr<nsIMsgDBHdr> msgHdr = do_QueryElementAt(mJunkHdrs, i);
           if (msgHdr)
           {
             uint32_t flags;
             msgHdr->GetFlags(&flags);
             if (!(flags & nsMsgMessageFlags::IMAPDeleted))
-              hdrsToDelete->AppendElement(msgHdr, false);
+              hdrsToDelete->AppendElement(msgHdr);
           }
         }
 
         hdrsToDelete->GetLength(&cnt);
         if (cnt)
           rv = srcFolder->DeleteMessages(hdrsToDelete, msgWindow, false, false,
                                          nullptr, true);
       }
--- a/mailnews/base/src/nsMsgFolderDataSource.cpp
+++ b/mailnews/base/src/nsMsgFolderDataSource.cpp
@@ -561,29 +561,29 @@ nsMsgFolderDataSource::GetAllCmds(nsIRDF
 
   nsCOMPtr<nsIMsgFolder> folder(do_QueryInterface(source, &rv));
   if (NS_FAILED(rv)) return rv;
 
   nsCOMPtr<nsIMutableArray> cmds =
     do_CreateInstance(NS_ARRAY_CONTRACTID);
   NS_ENSURE_STATE(cmds);
 
-  cmds->AppendElement(kNC_Delete, false);
-  cmds->AppendElement(kNC_ReallyDelete, false);
-  cmds->AppendElement(kNC_NewFolder, false);
-  cmds->AppendElement(kNC_GetNewMessages, false);
-  cmds->AppendElement(kNC_Copy, false);
-  cmds->AppendElement(kNC_Move, false);
-  cmds->AppendElement(kNC_CopyFolder, false);
-  cmds->AppendElement(kNC_MoveFolder, false);
-  cmds->AppendElement(kNC_MarkAllMessagesRead, false);
-  cmds->AppendElement(kNC_Compact, false);
-  cmds->AppendElement(kNC_CompactAll, false);
-  cmds->AppendElement(kNC_Rename, false);
-  cmds->AppendElement(kNC_EmptyTrash, false);
+  cmds->AppendElement(kNC_Delete);
+  cmds->AppendElement(kNC_ReallyDelete);
+  cmds->AppendElement(kNC_NewFolder);
+  cmds->AppendElement(kNC_GetNewMessages);
+  cmds->AppendElement(kNC_Copy);
+  cmds->AppendElement(kNC_Move);
+  cmds->AppendElement(kNC_CopyFolder);
+  cmds->AppendElement(kNC_MoveFolder);
+  cmds->AppendElement(kNC_MarkAllMessagesRead);
+  cmds->AppendElement(kNC_Compact);
+  cmds->AppendElement(kNC_CompactAll);
+  cmds->AppendElement(kNC_Rename);
+  cmds->AppendElement(kNC_EmptyTrash);
 
   return cmds->Enumerate(commands);
 }
 
 NS_IMETHODIMP
 nsMsgFolderDataSource::IsCommandEnabled(nsISupports/*nsISupportsArray<nsIRDFResource>*/* aSources,
                                         nsIRDFResource*   aCommand,
                                         nsISupports/*nsISupportsArray<nsIRDFResource>*/* aArguments,
@@ -1797,17 +1797,17 @@ nsresult nsMsgFolderDataSource::DoCopyTo
   nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
 
   // Remove first element
   for(uint32_t i = 1; i < itemCount; i++)
   {
     nsCOMPtr<nsIMsgDBHdr> message(do_QueryElementAt(arguments, i));
     if (message)
     {
-      messageArray->AppendElement(message, false);
+      messageArray->AppendElement(message);
     }
   }
 
   //Call copyservice with dstFolder, srcFolder, messages, isMove, and txnManager
   nsCOMPtr<nsIMsgCopyService> copyService =
     do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv,rv);
 
@@ -1830,17 +1830,17 @@ nsresult nsMsgFolderDataSource::DoFolder
   if (!isMoveFolder)   // copy folder not on the same server
   {
     // Create an nsIMutableArray from the nsISupportsArray
     nsCOMPtr<nsIMutableArray> folderArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
     for (uint32_t i = 0; i < itemCount; i++)
     {
       nsCOMPtr<nsISupports> element(do_QueryElementAt(arguments, i, &rv));
       if (NS_SUCCEEDED(rv))
-        folderArray->AppendElement(element, false);
+        folderArray->AppendElement(element);
     }
 
     //Call copyservice with dstFolder, srcFolder, folders and isMoveFolder
     nsCOMPtr<nsIMsgCopyService> copyService = do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
     if(NS_SUCCEEDED(rv))
     {
       rv = copyService->CopyFolders(folderArray, dstFolder, isMoveFolder,
         nullptr, msgWindow);
@@ -1881,21 +1881,21 @@ nsresult nsMsgFolderDataSource::DoDelete
   //for deletion.
   for(uint32_t item = 0; item < itemCount; item++)
   {
     nsCOMPtr<nsISupports> supports(do_QueryElementAt(arguments, item));
     nsCOMPtr<nsIMsgDBHdr> deletedMessage(do_QueryInterface(supports));
     nsCOMPtr<nsIMsgFolder> deletedFolder(do_QueryInterface(supports));
     if (deletedMessage)
     {
-      messageArray->AppendElement(supports, false);
+      messageArray->AppendElement(supports);
     }
     else if(deletedFolder)
     {
-      folderArray->AppendElement(supports, false);
+      folderArray->AppendElement(supports);
     }
   }
   uint32_t cnt;
   rv = messageArray->GetLength(&cnt);
   if (NS_FAILED(rv)) return rv;
   if (cnt > 0)
     rv = folder->DeleteMessages(messageArray, msgWindow, reallyDelete, false, nullptr, true /*allowUndo*/);
 
--- a/mailnews/base/src/nsMsgProgress.cpp
+++ b/mailnews/base/src/nsMsgProgress.cpp
@@ -62,18 +62,18 @@ NS_IMETHODIMP nsMsgProgress::OpenProgres
 
   nsCOMPtr<nsISupportsInterfacePointer> ifptr =
     do_CreateInstance(NS_SUPPORTS_INTERFACE_POINTER_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   ifptr->SetData(static_cast<nsIMsgProgress*>(this));
   ifptr->SetDataIID(&NS_GET_IID(nsIMsgProgress));
 
-  array->AppendElement(ifptr, false);
-  array->AppendElement(parameters, false);
+  array->AppendElement(ifptr);
+  array->AppendElement(parameters);
 
   // Open the dialog.
   nsCOMPtr<nsPIDOMWindowOuter> newWindow;
 
   nsString chromeOptions(NS_LITERAL_STRING("chrome,dependent,centerscreen"));
   if (inDisplayModal)
     chromeOptions.AppendLiteral(",modal");
 
--- a/mailnews/base/src/nsMsgPurgeService.cpp
+++ b/mailnews/base/src/nsMsgPurgeService.cpp
@@ -448,17 +448,17 @@ NS_IMETHODIMP nsMsgPurgeService::OnSearc
   MOZ_LOG(MsgPurgeLogModule, mozilla::LogLevel::Info, ("junkScore=%s (if empty or != nsIJunkMailPlugin::IS_SPAM_SCORE, don't add to list delete)", junkScoreStr.get()));
 
   // if "junkscore" is not set, don't delete the message
   if (junkScoreStr.IsEmpty())
     return NS_OK;
 
   if (atoi(junkScoreStr.get()) == nsIJunkMailPlugin::IS_SPAM_SCORE) {
     MOZ_LOG(MsgPurgeLogModule, mozilla::LogLevel::Info, ("added message to delete"));
-    return mHdrsToDelete->AppendElement(aMsgHdr, false);
+    return mHdrsToDelete->AppendElement(aMsgHdr);
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgPurgeService::OnSearchDone(nsresult status)
 {
   if (NS_SUCCEEDED(status))
   {
--- a/mailnews/base/src/nsMsgQuickSearchDBView.cpp
+++ b/mailnews/base/src/nsMsgQuickSearchDBView.cpp
@@ -594,17 +594,17 @@ nsMsgQuickSearchDBView::ListCollapsedChi
     if (msgHdr)
     {
       nsMsgKey msgKey;
       msgHdr->GetMessageKey(&msgKey);
       if (msgKey != rootKey || (GroupViewUsesDummyRow() && rootKeySkipped))
       {
         // if this hdr is in the original view, add it to new view.
         if (m_origKeys.BinaryIndexOf(msgKey) != m_origKeys.NoIndex)
-          messageArray->AppendElement(msgHdr, false);
+          messageArray->AppendElement(msgHdr);
       }
       else
       {
         rootKeySkipped = true;
       }
     }
   }
   return NS_OK;
--- a/mailnews/base/src/nsMsgSearchDBView.cpp
+++ b/mailnews/base/src/nsMsgSearchDBView.cpp
@@ -1054,17 +1054,17 @@ nsMsgSearchDBView::GetFoldersAndHdrsForS
       nsCOMPtr<nsIMsgDBHdr> hdr = do_QueryElementAt(messages, i, &rv);
       if (hdr)
       {
         nsCOMPtr<nsIMsgFolder> msgFolder;
         hdr->GetFolder(getter_AddRefs(msgFolder));
         if (NS_SUCCEEDED(rv) && msgFolder && msgFolder == curFolder)
         {
           nsCOMPtr<nsISupports> hdrSupports = do_QueryInterface(hdr);
-          msgHdrsForOneFolder->AppendElement(hdrSupports, false);
+          msgHdrsForOneFolder->AppendElement(hdrSupports);
         }
       }
     }
 
     m_hdrsForEachFolder.AppendElement(msgHdrsForOneFolder);
   }
 
   return rv;
--- a/mailnews/base/util/nsImapMoveCoalescer.cpp
+++ b/mailnews/base/util/nsImapMoveCoalescer.cpp
@@ -82,17 +82,17 @@ nsresult nsImapMoveCoalescer::PlaybackMo
 
     nsCOMPtr<nsIMutableArray> messages(do_CreateInstance(NS_ARRAY_CONTRACTID));
     for (uint32_t keyIndex = 0; keyIndex < keysToAdd.Length(); keyIndex++)
     {
       nsCOMPtr<nsIMsgDBHdr> mailHdr = nullptr;
       rv = m_sourceFolder->GetMessageHeader(keysToAdd.ElementAt(keyIndex), getter_AddRefs(mailHdr));
       if (NS_SUCCEEDED(rv) && mailHdr)
       {
-        messages->AppendElement(mailHdr, false);
+        messages->AppendElement(mailHdr);
         bool isRead = false;
         mailHdr->GetIsRead(&isRead);
         if (!isRead)
           numNewMessages++;
       }
     }
     uint32_t destFlags;
     destFolder->GetFlags(&destFlags);
--- a/mailnews/base/util/nsMsgDBFolder.cpp
+++ b/mailnews/base/util/nsMsgDBFolder.cpp
@@ -1886,31 +1886,31 @@ nsresult nsMsgDBFolder::HandleAutoCompac
             {
               nsCOMPtr<nsIMsgFolder> folder = do_QueryElementAt(allDescendents, i);
               expungedBytes = 0;
               folder->GetFlags(&flags);
               if (flags & nsMsgFolderFlags::Offline)
                 folder->GetExpungedBytes(&expungedBytes);
               if (expungedBytes > 0 )
               {
-                offlineFolderArray->AppendElement(folder, false);
+                offlineFolderArray->AppendElement(folder);
                 offlineExpungedBytes += expungedBytes;
               }
             }
           }
           else  //pop or local
           {
             for (uint32_t i = 0; i < cnt; i++)
             {
               nsCOMPtr<nsIMsgFolder> folder = do_QueryElementAt(allDescendents, i);
               expungedBytes = 0;
               folder->GetExpungedBytes(&expungedBytes);
               if (expungedBytes > 0 )
               {
-                folderArray->AppendElement(folder, false);
+                folderArray->AppendElement(folder);
                 localExpungedBytes += expungedBytes;
               }
             }
           }
         }
       }
       while (++serverIndex < numServers);
       totalExpungedBytes = localExpungedBytes + offlineExpungedBytes;
@@ -2372,17 +2372,17 @@ nsMsgDBFolder::OnMessageClassified(const
       // a filter moved it.
       rv = mDatabase->ContainsKey(msgKey, &hasKey);
       if (!NS_SUCCEEDED(rv) || !hasKey)
         continue;
       nsCOMPtr <nsIMsgDBHdr> msgHdr;
       rv = mDatabase->GetMsgHdrForKey(msgKey, getter_AddRefs(msgHdr));
       if (!NS_SUCCEEDED(rv))
         continue;
-      classifiedMsgHdrs->AppendElement(msgHdr, false);
+      classifiedMsgHdrs->AppendElement(msgHdr);
     }
 
     // only generate the notification if there are some classified messages
     if (NS_SUCCEEDED(classifiedMsgHdrs->GetLength(&length)) && length)
       notifier->NotifyMsgsClassified(classifiedMsgHdrs,
                                      mBayesJunkClassifying,
                                      mBayesTraitClassifying);
     mClassifiedMsgKeys.Clear();
@@ -2747,17 +2747,17 @@ nsMsgDBFolder::CallFilterPlugins(nsIMsgW
       {
         // Don't do filters on this message again.
         // (Only set this if we are actually filtering since this is
         // tantamount to a memory leak.)
         OrProcessingFlags(msgKey, nsMsgProcessingFlags::FiltersDone);
         // Lazily create the array.
         if (!mPostBayesMessagesToFilter)
           mPostBayesMessagesToFilter = do_CreateInstance(NS_ARRAY_CONTRACTID);
-        mPostBayesMessagesToFilter->AppendElement(msgHdr, false);
+        mPostBayesMessagesToFilter->AppendElement(msgHdr);
       }
     }
   }
 
   NotifyHdrsNotBeingClassified();
   // If there weren't any new messages, just return.
   if (newMessageKeys.IsEmpty())
     return NS_OK;
@@ -4447,17 +4447,17 @@ NS_IMETHODIMP nsMsgDBFolder::GetFoldersW
   array.forget(aResult);
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::ListFoldersWithFlags(uint32_t aFlags, nsIMutableArray* aFolders)
 {
   NS_ENSURE_ARG_POINTER(aFolders);
   if ((mFlags & aFlags) == aFlags)
-    aFolders->AppendElement(static_cast<nsRDFResource*>(this), false);
+    aFolders->AppendElement(static_cast<nsRDFResource*>(this));
 
   nsCOMPtr<nsISimpleEnumerator> dummy;
   GetSubFolders(getter_AddRefs(dummy)); // initialize mSubFolders
 
   int32_t count = mSubFolders.Count();
   for (int32_t i = 0; i < count; ++i)
     mSubFolders[i]->ListFoldersWithFlags(aFlags, aFolders);
 
@@ -5139,17 +5139,17 @@ NS_IMETHODIMP nsMsgDBFolder::ListDescend
   NS_ENSURE_ARG_POINTER(aDescendants);
 
   nsCOMPtr<nsISimpleEnumerator> dummy;
   GetSubFolders(getter_AddRefs(dummy)); // initialize mSubFolders
   uint32_t count = mSubFolders.Count();
   for (uint32_t i = 0; i < count; i++)
   {
     nsCOMPtr<nsIMsgFolder> child(mSubFolders[i]);
-    aDescendants->AppendElement(child, false);
+    aDescendants->AppendElement(child);
     child->ListDescendants(aDescendants);  // recurse
   }
   return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgDBFolder::GetBaseMessageURI(nsACString& baseMessageURI)
 {
   if (mBaseMessageURI.IsEmpty())
@@ -5970,17 +5970,17 @@ nsresult nsMsgDBFolder::MessagesInKeyOrd
   rv = srcFolder->GetDBFolderInfoAndDB(getter_AddRefs(folderInfo), getter_AddRefs(db));
   if (NS_SUCCEEDED(rv) && db)
   {
     for (uint32_t i = 0; i < numMessages; i++)
     {
       rv = db->GetMsgHdrForKey(aKeyArray[i], getter_AddRefs(msgHdr));
       NS_ENSURE_SUCCESS(rv,rv);
       if (msgHdr)
-        messages->AppendElement(msgHdr, false);
+        messages->AppendElement(msgHdr);
     }
   }
   return rv;
 }
 
 /* static */ nsMsgKeySetU* nsMsgKeySetU::Create()
 {
   nsMsgKeySetU* set = new nsMsgKeySetU;
--- a/mailnews/base/util/nsMsgIncomingServer.cpp
+++ b/mailnews/base/util/nsMsgIncomingServer.cpp
@@ -1913,17 +1913,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, /* weak = */ false);
+    searchTerms->InsertElementAt(searchTerm, count);
 
     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/nsMsgReadStateTxn.cpp
+++ b/mailnews/base/util/nsMsgReadStateTxn.cpp
@@ -52,15 +52,15 @@ nsMsgReadStateTxn::MarkMessages(bool aAs
   NS_ENSURE_SUCCESS(rv, rv);
 
   uint32_t length = mMarkedMessages.Length();
   for (uint32_t i = 0; i < length; i++) {
     nsCOMPtr<nsIMsgDBHdr> curMsgHdr;
     rv = mParentFolder->GetMessageHeader(mMarkedMessages[i],
                                          getter_AddRefs(curMsgHdr));
     if (NS_SUCCEEDED(rv) && curMsgHdr) {
-      messageArray->AppendElement(curMsgHdr, false);
+      messageArray->AppendElement(curMsgHdr);
     }
   }
 
   return mParentFolder->MarkMessagesRead(messageArray, aAsRead);
 }
 
--- a/mailnews/base/util/nsMsgUtils.cpp
+++ b/mailnews/base/util/nsMsgUtils.cpp
@@ -1646,17 +1646,17 @@ NS_MSG_BASE nsresult MsgGetHeadersFromKe
 
     // This function silently skips when the key is not found. This is an expected case.
     if (hasKey)
     {
       nsCOMPtr<nsIMsgDBHdr> msgHdr;
       rv = aDB->GetMsgHdrForKey(key, getter_AddRefs(msgHdr));
       NS_ENSURE_SUCCESS(rv, rv);
 
-      aHeaders->AppendElement(msgHdr, false);
+      aHeaders->AppendElement(msgHdr);
     }
   }
 
   return rv;
 }
 
 NS_MSG_BASE nsresult MsgGetHdrsFromKeys(nsIMsgDatabase *aDB, nsMsgKey *aMsgKeys,
                                         uint32_t aNumKeys, nsIMutableArray **aHeaders)
@@ -1674,17 +1674,17 @@ NS_MSG_BASE nsresult MsgGetHdrsFromKeys(
     bool hasKey;
     rv = aDB->ContainsKey(key, &hasKey);
     // This function silently skips when the key is not found. This is an expected case.
     if (NS_SUCCEEDED(rv) && hasKey)
     {
       nsCOMPtr<nsIMsgDBHdr> msgHdr;
       rv = aDB->GetMsgHdrForKey(key, getter_AddRefs(msgHdr));
       if (NS_SUCCEEDED(rv))
-        messages->AppendElement(msgHdr, false);
+        messages->AppendElement(msgHdr);
     }
   }
 
   messages.forget(aHeaders);
   return NS_OK;
 }
 
 bool MsgAdvanceToNextLine(const char *buffer, uint32_t &bufferOffset, uint32_t maxBufferOffset)
--- a/mailnews/compose/src/nsMsgCompose.cpp
+++ b/mailnews/compose/src/nsMsgCompose.cpp
@@ -3903,17 +3903,17 @@ nsMsgComposeSendListener::RemoveCurrentD
         if (!containsKey)
           break;
 
         // Build the msg array.
         nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
         NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveCurrentDraftMessage can't allocate array.");
         if (NS_FAILED(rv) || !messageArray)
           break;
-        rv = messageArray->AppendElement(msgDBHdr, false);
+        rv = messageArray->AppendElement(msgDBHdr);
         NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveCurrentDraftMessage can't append msg header to array.");
         if (NS_FAILED(rv))
           break;
 
         // Ready to delete the msg.
         rv = msgFolder->DeleteMessages(messageArray, nullptr, true, false, nullptr, false /*allowUndo*/);
         NS_ASSERTION(NS_SUCCEEDED(rv), "RemoveCurrentDraftMessage can't delete message.");
       } while(false);
--- a/mailnews/compose/src/nsMsgSend.cpp
+++ b/mailnews/compose/src/nsMsgSend.cpp
@@ -3980,17 +3980,17 @@ nsMsgComposeAndSend::FilterSentMessage()
   nsCOMPtr<nsIMutableArray> msgArray(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
   if (NS_FAILED(rv))
     return rv;
 
   nsCOMPtr<nsIMsgFilterService> filterSvc = do_GetService(NS_MSGFILTERSERVICE_CONTRACTID, &rv);
   if (NS_FAILED(rv))
     return rv;
 
-  rv = msgArray->AppendElement(msgHdr, false);
+  rv = msgArray->AppendElement(msgHdr);
   if (NS_FAILED(rv))
     return rv;
 
   nsCOMPtr<nsIMsgWindow> msgWindow;
   if (mSendProgress)
     mSendProgress->GetMsgWindow(getter_AddRefs(msgWindow));
 
   return filterSvc->ApplyFilters(nsMsgFilterType::PostOutgoing, msgArray, folder, msgWindow, this);
--- a/mailnews/compose/src/nsMsgSendLater.cpp
+++ b/mailnews/compose/src/nsMsgSendLater.cpp
@@ -879,17 +879,17 @@ nsMsgSendLater::DeleteCurrentMessage()
   // Get the composition fields interface
   nsCOMPtr<nsIMutableArray> msgArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
   if (!msgArray)
     return NS_ERROR_FACTORY_NOT_LOADED;
 
   if (!mMessageFolder)
     return NS_ERROR_UNEXPECTED;
 
-  msgArray->InsertElementAt(mMessage, 0, false);
+  msgArray->InsertElementAt(mMessage, 0);
 
   nsresult res = mMessageFolder->DeleteMessages(msgArray, nullptr, true, false, nullptr, false /*allowUndo*/);
   if (NS_FAILED(res))
     return NS_ERROR_FAILURE;
 
   // Null out the message so we don't try and delete it again.
   mMessage = nullptr;
 
--- a/mailnews/db/msgdb/src/nsMsgDatabase.cpp
+++ b/mailnews/db/msgdb/src/nsMsgDatabase.cpp
@@ -465,17 +465,17 @@ NS_IMETHODIMP nsMsgDBService::ForceFolde
 
 NS_IMETHODIMP nsMsgDBService::GetOpenDBs(nsIArray **aOpenDBs)
 {
   NS_ENSURE_ARG_POINTER(aOpenDBs);
   nsresult rv;
   nsCOMPtr<nsIMutableArray> openDBs(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
   for (uint32_t i = 0; i < m_dbCache.Length(); i++)
-    openDBs->AppendElement(m_dbCache[i], false);
+    openDBs->AppendElement(m_dbCache[i]);
 
   openDBs.forget(aOpenDBs);
   return NS_OK;
 }
 
 static bool gGotGlobalPrefs = false;
 static bool gThreadWithoutRe = true;
 static bool gStrictThreading = false;
@@ -2896,17 +2896,17 @@ nsMsgDatabase::NextMatchingHdrs(nsISimpl
   do
   {
     nsCOMPtr <nsISupports> supports;
     rv = enumerator->GetNext(getter_AddRefs(supports));
     nsCOMPtr <nsIMsgDBHdr> nextMessage = do_QueryInterface(supports);
     if (NS_SUCCEEDED(rv) && nextMessage)
     {
       if (aMatchingHdrs)
-        aMatchingHdrs->AppendElement(nextMessage, false);
+        aMatchingHdrs->AppendElement(nextMessage);
       ++numMatches;
       if (aMaxResults && numMatches == aMaxResults)
         break;
     }
     else
       break;
   }
   while (true);
@@ -5016,17 +5016,17 @@ nsresult nsMsgDatabase::PurgeMessagesOld
         purgeHdr = true;
     }
     if (purgeHdr)
     {
       nsMsgKey msgKey;
       pHeader->GetMessageKey(&msgKey);
       keysToDelete.AppendElement(msgKey);
       if (hdrsToDelete)
-        hdrsToDelete->AppendElement(pHeader, false);
+        hdrsToDelete->AppendElement(pHeader);
     }
     NS_RELEASE(pHeader);
   }
 
   if (!hdrsToDelete)
   {
     DeleteMessages(keysToDelete.Length(), keysToDelete.Elements(), nullptr);
 
@@ -5079,17 +5079,17 @@ nsresult nsMsgDatabase::PurgeExcessMessa
 
     if (purgeHdr)
     {
       nsMsgKey msgKey;
       pHeader->GetMessageKey(&msgKey);
       keysToDelete.AppendElement(msgKey);
       numHdrs--;
       if (hdrsToDelete)
-        hdrsToDelete->AppendElement(pHeader, false);
+        hdrsToDelete->AppendElement(pHeader);
     }
     NS_RELEASE(pHeader);
   }
 
   if (!hdrsToDelete)
   {
     int32_t numKeysToDelete = keysToDelete.Length();
     if (numKeysToDelete > 0)
--- a/mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
+++ b/mailnews/extensions/mailviews/src/nsMsgMailViewList.cpp
@@ -108,17 +108,17 @@ NS_IMETHODIMP nsMsgMailView::SetSearchTe
     mViewSearchTerms = aSearchTerms;
     return NS_OK;
 }
 
 NS_IMETHODIMP nsMsgMailView::AppendTerm(nsIMsgSearchTerm *aTerm)
 {
     NS_ENSURE_TRUE(aTerm, NS_ERROR_NULL_POINTER);
 
-    return mViewSearchTerms->AppendElement(aTerm, /* weak */ false);
+    return mViewSearchTerms->AppendElement(aTerm);
 }
 
 NS_IMETHODIMP nsMsgMailView::CreateTerm(nsIMsgSearchTerm **aResult)
 {
     NS_ENSURE_ARG_POINTER(aResult);
     nsCOMPtr<nsIMsgSearchTerm> searchTerm = do_CreateInstance("@mozilla.org/messenger/searchTerm;1");
     searchTerm.forget(aResult);
     return NS_OK;
--- a/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp
+++ b/mailnews/extensions/smime/src/nsMsgComposeSecure.cpp
@@ -983,21 +983,21 @@ nsresult nsMsgComposeSecure::MimeCryptoH
      */
 
       bool isSame;
       if (NS_SUCCEEDED(cert->Equals(mSelfEncryptionCert, &isSame))
           && isSame) {
         already_added_self_cert = true;
       }
 
-      mCerts->AppendElement(cert, false);
+      mCerts->AppendElement(cert);
     }
 
     if (!already_added_self_cert) {
-      mCerts->AppendElement(mSelfEncryptionCert, false);
+      mCerts->AppendElement(mSelfEncryptionCert);
     }
   }
   return res;
 }
 
 NS_IMETHODIMP nsMsgComposeSecure::MimeCryptoWriteBlock (const char *buf, int32_t size)
 {
   int status = 0;
--- a/mailnews/imap/src/nsAutoSyncState.cpp
+++ b/mailnews/imap/src/nsAutoSyncState.cpp
@@ -293,24 +293,24 @@ NS_IMETHODIMP nsAutoSyncState::GetNextGr
         // ignore 0 byte messages; the imap parser asserts when we try 
         // to download them, and there's no point anyway.
         if (!msgSize)
           continue;
 
         if (!*aActualGroupSize && msgSize >= aSuggestedGroupSizeLimit) 
         {
           *aActualGroupSize = msgSize;
-          group->AppendElement(qhdr, false);
+          group->AppendElement(qhdr);
           idx++;
           break;
         }
         if ((*aActualGroupSize) + msgSize > aSuggestedGroupSizeLimit)
           break;
 
-        group->AppendElement(qhdr, false);
+        group->AppendElement(qhdr);
         *aActualGroupSize += msgSize;
       }// endfor
 
       mLastOffset = mOffset;
       mOffset = idx;
     }
 
     LogOwnerFolderName("Next group of messages to be downloaded.");
--- a/mailnews/imap/src/nsImapMailFolder.cpp
+++ b/mailnews/imap/src/nsImapMailFolder.cpp
@@ -1030,17 +1030,17 @@ NS_IMETHODIMP nsImapMailFolder::List()
 
 NS_IMETHODIMP nsImapMailFolder::RemoveSubFolder (nsIMsgFolder *which)
 {
   nsresult rv;
   nsCOMPtr<nsIMutableArray> folders(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
   NS_ENSURE_TRUE(folders, rv);
   nsCOMPtr<nsISupports> folderSupport = do_QueryInterface(which, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
-  folders->AppendElement(folderSupport, false);
+  folders->AppendElement(folderSupport);
   rv = nsMsgDBFolder::DeleteSubFolders(folders, nullptr);
   which->Delete();
   return rv;
 }
 
 NS_IMETHODIMP nsImapMailFolder::CreateStorageIfMissing(nsIUrlListener* urlListener)
 {
   nsresult rv = NS_OK;
@@ -1392,19 +1392,19 @@ NS_IMETHODIMP nsImapMailFolder::CompactA
     for (uint32_t i = 0; i < cnt; i++)
     {
       nsCOMPtr<nsIMsgFolder> folder = do_QueryElementAt(allDescendents, i, &rv);
       NS_ENSURE_SUCCESS(rv, rv);
       uint32_t folderFlags;
       folder->GetFlags(&folderFlags);
       if (! (folderFlags & (nsMsgFolderFlags::Virtual | nsMsgFolderFlags::ImapNoselect)))
       {
-        rv = folderArray->AppendElement(folder, false);
+        rv = folderArray->AppendElement(folder);
         if (aCompactOfflineAlso)
-          offlineFolderArray->AppendElement(folder, false);
+          offlineFolderArray->AppendElement(folder);
       }
     }
     rv = folderArray->GetLength(&cnt);
     NS_ENSURE_SUCCESS(rv, rv);
     if (cnt == 0)
       return NotifyCompactCompleted();
   }
   nsCOMPtr <nsIMsgFolderCompactor> folderCompactor =
@@ -2370,17 +2370,17 @@ nsImapMailFolder::DeleteSubFolders(nsIAr
       if (folderFlags & nsMsgFolderFlags::Virtual)
       {
         RemoveSubFolder(curFolder);
         // since the folder pane only allows single selection, we can do this
         deleteNoTrash = confirmed = true;
         confirmDeletion = false;
       }
       else
-        foldersRemaining->InsertElementAt(curFolder, 0, false);
+        foldersRemaining->InsertElementAt(curFolder, 0);
     }
   }
 
   foldersRemaining->GetLength(&folderCount);
 
   nsCOMPtr<nsIImapService> imapService = do_GetService(NS_IMAPSERVICE_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
   if (!deleteNoTrash)
@@ -3563,17 +3563,17 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
             if (msgFlags & nsMsgMessageFlags::MDNReportNeeded && !isRead)
             {
                mDatabase->MarkMDNNeeded(msgKey, false, nullptr);
                mDatabase->MarkMDNSent(msgKey, true, nullptr);
             }
 
             nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
             NS_ENSURE_TRUE(messageArray, rv);
-            messageArray->AppendElement(msgHdr, false);
+            messageArray->AppendElement(msgHdr);
 
             nsCOMPtr<nsIMsgFolder> dstFolder;
             rv = GetExistingFolder(actionTargetFolderUri, getter_AddRefs(dstFolder));
             NS_ENSURE_SUCCESS(rv, rv);
 
             nsCOMPtr<nsIMsgCopyService> copyService =
               do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
             NS_ENSURE_SUCCESS(rv, rv);
@@ -3658,17 +3658,17 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
         }
         break;
         case nsMsgFilterAction::AddTag:
         {
           nsCString keyword;
           filterAction->GetStrValue(keyword);
           nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
           NS_ENSURE_TRUE(messageArray, rv);
-          messageArray->AppendElement(msgHdr, false);
+          messageArray->AppendElement(msgHdr);
           AddKeywordsToMessages(messageArray, keyword);
           break;
         }
         case nsMsgFilterAction::JunkScore:
         {
           nsAutoCString junkScoreStr;
           int32_t junkScore;
           filterAction->GetJunkScore(&junkScore);
@@ -3768,17 +3768,17 @@ NS_IMETHODIMP nsImapMailFolder::ApplyFil
           NS_ENSURE_SUCCESS(rv, rv);
 
           nsAutoCString value;
           filterAction->GetStrValue(value);
 
           nsCOMPtr<nsIMutableArray> messageArray(
               do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
           NS_ENSURE_TRUE(messageArray, rv);
-          messageArray->AppendElement(msgHdr, false);
+          messageArray->AppendElement(msgHdr);
 
           customAction->Apply(messageArray, value, nullptr,
                               nsMsgFilterType::InboxRule, msgWindow);
           // allow custom action to affect new
           msgHdr->GetFlags(&msgFlags);
           if (!(msgFlags & nsMsgMessageFlags::New))
             msgIsNew = false;
         }
@@ -3866,17 +3866,17 @@ nsImapMailFolder::ReplayOfflineMoveCopy(
               for (uint32_t msgIndex = 0; msgIndex < aNumKeys; msgIndex++)
               {
                 if (srcMessageKey == aMsgKeys[msgIndex])
                 {
                   nsCOMPtr<nsIMsgDBHdr> fakeDestHdr;
                   dstFolderDB->GetMsgHdrForKey(offlineOps[opIndex],
                     getter_AddRefs(fakeDestHdr));
                   if (fakeDestHdr)
-                    messages->AppendElement(fakeDestHdr, false);
+                    messages->AppendElement(fakeDestHdr);
                   break;
                 }
               }
             }
           }
         }
         destImapFolder->SetPendingAttributes(messages, isMove);
       }
@@ -7273,17 +7273,17 @@ nsresult nsImapMailFolder::CopyMessagesO
             NS_ASSERTION(false, "failed to copy hdr");
             stopit = rv;
           }
 
           if (NS_SUCCEEDED(stopit))
           {
             bool hasMsgOffline = false;
 
-            destMsgHdrs->AppendElement(newMailHdr, false);
+            destMsgHdrs->AppendElement(newMailHdr);
             srcFolder->HasMsgOffline(originalKey, &hasMsgOffline);
             newMailHdr->SetUint32Property("pseudoHdr", 1);
             if (!reusable)
               (void)srcFolder->GetMsgInputStream(newMailHdr, &reusable,
                                                  getter_AddRefs(inputStream));
 
             if (inputStream && hasMsgOffline && !isLocked)
             {
@@ -7328,17 +7328,17 @@ nsresult nsImapMailFolder::CopyMessagesO
           {
             if (deleteToTrash || deleteImmediately)
               keysToDelete.AppendElement(msgKey);
             else
               sourceMailDB->MarkImapDeleted(msgKey, true, nullptr); // offline delete
           }
           if (successfulCopy)
             // This is for both moves and copies
-            msgHdrsCopied->AppendElement(mailHdr, false);
+            msgHdrsCopied->AppendElement(mailHdr);
         }
       }
       EnableNotifications(nsIMsgFolder::allMessageCountNotifications, true);
       RefPtr<nsImapOfflineTxn> addHdrMsgTxn = new
         nsImapOfflineTxn(this, &addedKeys, nullptr, this, isMove, nsIMsgOfflineImapOperation::kAddedHeader,
                          addedHdrs);
       if (addHdrMsgTxn && txnMgr)
          txnMgr->DoTransaction(addHdrMsgTxn);
@@ -7863,17 +7863,17 @@ nsImapFolderCopyState::OnStopRunningUrl(
 
           if (!hasMore)
             return AdvanceToNextFolder(NS_OK);
 
           while (NS_SUCCEEDED(rv) && hasMore)
           {
             rv = enumerator->GetNext(getter_AddRefs(item));
             NS_ENSURE_SUCCESS(rv, rv);
-            rv = msgArray->AppendElement(item, false);
+            rv = msgArray->AppendElement(item);
             NS_ENSURE_SUCCESS(rv, rv);
             rv = enumerator->HasMoreElements(&hasMore);
           }
 
           nsCOMPtr<nsIMsgCopyService> copyService = do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
           NS_ENSURE_SUCCESS(rv, rv);
           rv = copyService->CopyMessages(m_curSrcFolder,
                              msgArray, newMsgFolder,
@@ -8089,17 +8089,17 @@ nsImapMailFolder::CopyFileMessage(nsIFil
         {
           messageId.AppendInt((int32_t) key);
           // Perhaps we have the message offline, but even if we do it is
           // not valid, since the only time we do a file copy for an
           // existing message is when we are changing the message.
           // So set the offline size to 0 to force SetPendingAttributes to
           // clear the offline message flag.
           msgToReplace->SetOfflineMessageSize(0);
-          messages->AppendElement(msgToReplace, false);
+          messages->AppendElement(msgToReplace);
           SetPendingAttributes(messages, false);
         }
     }
 
     bool isMove = (msgToReplace ? true : false);
     rv = InitCopyState(srcSupport, messages, isMove, isDraftOrTemplate,
                        false, aNewMsgFlags, aNewMsgKeywords, listener, 
                        msgWindow, false);
@@ -8428,17 +8428,17 @@ nsImapMailFolder::CopyFileToOfflineStore
       nsCOMPtr<nsIMsgPluggableStore> msgStore;
       GetMsgStore(getter_AddRefs(msgStore));
       if (msgStore)
         msgStore->FinishNewMessage(offlineStore, fakeHdr);
     }
 
     nsCOMPtr<nsIMutableArray> messages(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv, rv);
-    messages->AppendElement(fakeHdr, false);
+    messages->AppendElement(fakeHdr);
 
     SetPendingAttributes(messages, false);
     // Gloda needs this notification to index the fake message.
     nsCOMPtr<nsIMsgFolderNotificationService>
       notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
     if (notifier)
       notifier->NotifyMsgsClassified(messages, false, false);
     inputStream->Close();
@@ -9138,17 +9138,17 @@ nsImapMailFolder::OnMessageClassified(co
         (void)spamSettings->GetMarkAsReadOnSpam(&markAsReadOnSpam);
         if (markAsReadOnSpam)
         {
           if (!m_junkMessagesToMarkAsRead)
           {
             m_junkMessagesToMarkAsRead = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
             NS_ENSURE_SUCCESS(rv, rv);
           }
-          m_junkMessagesToMarkAsRead->AppendElement(msgHdr, false);
+          m_junkMessagesToMarkAsRead->AppendElement(msgHdr);
         }
 
         bool willMoveMessage = false;
 
         // don't do the move when we are opening up
         // the junk mail folder or the trash folder
         // or when manually classifying messages in those folders
         if (!(mFlags & nsMsgFolderFlags::Junk || mFlags & nsMsgFolderFlags::Trash))
--- a/mailnews/imap/src/nsImapOfflineSync.cpp
+++ b/mailnews/imap/src/nsImapOfflineSync.cpp
@@ -600,17 +600,17 @@ void nsImapOfflineSync::ProcessMoveOpera
             op->GetNewFlags(&newImapFlags);
             // first three bits are the same
             msgFlags |= (newImapFlags & 0x07);
             if (newImapFlags & kImapMsgForwardedFlag)
               msgFlags |= nsMsgMessageFlags::Forwarded;
             mailHdr->SetFlags(msgFlags);
             mailHdr->SetMessageSize(msgSize);
           }
-          messages->AppendElement(mailHdr, false);
+          messages->AppendElement(mailHdr);
         }
       }
       nsCOMPtr<nsIMsgCopyService> copyService = do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
       if (copyService)
         copyService->CopyMessages(m_currentFolder, messages, destFolder, true, this, m_window, false);
     }
   }
 }
@@ -695,17 +695,17 @@ void nsImapOfflineSync::ProcessCopyOpera
     nsCOMPtr<nsIMutableArray> messages(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
     if (messages && NS_SUCCEEDED(rv))
     {
       for (uint32_t keyIndex = 0; keyIndex < matchingFlagKeys.Length(); keyIndex++)
       {
         nsCOMPtr<nsIMsgDBHdr> mailHdr = nullptr;
         rv = m_currentFolder->GetMessageHeader(matchingFlagKeys.ElementAt(keyIndex), getter_AddRefs(mailHdr));
         if (NS_SUCCEEDED(rv) && mailHdr)
-          messages->AppendElement(mailHdr, false);
+          messages->AppendElement(mailHdr);
       }
       nsCOMPtr<nsIMsgCopyService> copyService = do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
       if (copyService)
         copyService->CopyMessages(m_currentFolder, messages, destFolder, false, this, m_window, false);
     }
   }
 }
 
--- a/mailnews/import/applemail/src/nsAppleMailImport.cpp
+++ b/mailnews/import/applemail/src/nsAppleMailImport.cpp
@@ -283,17 +283,17 @@ void nsAppleMailImportMail::FindAccountM
         nsCOMPtr<nsIFile> mailboxDescFile;
         rv = desc->GetFile(getter_AddRefs(mailboxDescFile));
         if (!mailboxDescFile)
           continue;
 
         mailboxDescFile->InitWithFile(currentEntry);
 
         // add this mailbox descriptor to the list
-        aMailboxDescs->AppendElement(desc, false);
+        aMailboxDescs->AppendElement(desc);
 
         // now add all the children mailboxes
         mCurDepth++;
         FindMboxDirs(currentEntry, aMailboxDescs, aImportService);
         mCurDepth--;
       }
     }
   }
@@ -360,17 +360,17 @@ nsresult nsAppleMailImportMail::AddMboxD
     nsCOMPtr<nsIFile> mailboxDescFile;
     rv = desc->GetFile(getter_AddRefs(mailboxDescFile));
     NS_ENSURE_SUCCESS(rv, rv);
 
     if (mailboxDescFile)
       mailboxDescFile->InitWithFile(aFolder);
 
     // add this mailbox descriptor to the list
-    aMailboxDescs->AppendElement(desc, false);
+    aMailboxDescs->AppendElement(desc);
   }
 
   return NS_OK;
 }
 
 // Starts looking for .mbox dirs in the specified dir. The .mbox dirs contain messages and can be considered leafs in a tree of
 // nested mailboxes (subfolders).
 //
--- a/mailnews/import/becky/src/nsBeckyAddressBooks.cpp
+++ b/mailnews/import/becky/src/nsBeckyAddressBooks.cpp
@@ -232,17 +232,17 @@ nsBeckyAddressBooks::AppendAddressBookDe
   uint32_t size = CountAddressBookSize(aEntry);
   descriptor->SetSize(size);
   descriptor->SetAbFile(aEntry);
 
   nsAutoString name;
   aEntry->GetLeafName(name);
   descriptor->SetPreferredName(name);
 
-  return aCollected->AppendElement(descriptor, false);
+  return aCollected->AppendElement(descriptor);
 }
 
 nsresult
 nsBeckyAddressBooks::CollectAddressBooks(nsIFile *aTarget,
                                          nsIMutableArray *aCollected)
 {
   nsresult rv = AppendAddressBookDescriptor(aTarget, aCollected);
   NS_ENSURE_SUCCESS(rv, rv);
--- a/mailnews/import/becky/src/nsBeckyMail.cpp
+++ b/mailnews/import/becky/src/nsBeckyMail.cpp
@@ -136,17 +136,17 @@ nsBeckyMail::AppendMailboxDescriptor(nsI
 
   nsCOMPtr<nsIFile> mailboxFile;
   rv = descriptor->GetFile(getter_AddRefs(mailboxFile));
   NS_ENSURE_SUCCESS(rv, rv);
 
   descriptor->SetDepth(aDepth);
 
   mailboxFile->InitWithFile(aEntry);
-  aCollected->AppendElement(descriptor, false);
+  aCollected->AppendElement(descriptor);
 
   return NS_OK;
 }
 
 nsresult
 nsBeckyMail::CollectMailboxesInFolderListFile(nsIFile *aListFile,
                                               uint32_t aDepth,
                                               nsIMutableArray *aCollected)
--- a/mailnews/import/outlook/src/MapiMessage.cpp
+++ b/mailnews/import/outlook/src/MapiMessage.cpp
@@ -1175,17 +1175,17 @@ nsresult CMapiMessage::GetAttachments(ns
        it != m_stdattachments.end(); it++) {
     nsCOMPtr<nsIMsgAttachedFile> a(do_CreateInstance(NS_MSGATTACHEDFILE_CONTRACTID, &rv));
     NS_ENSURE_SUCCESS(rv, rv);
     a->SetOrigUrl((*it)->orig_url);
     a->SetTmpFile((*it)->tmp_file);
     a->SetEncoding(nsDependentCString((*it)->encoding));
     a->SetRealName(nsDependentCString((*it)->real_name));
     a->SetType(nsDependentCString((*it)->type));
-    attachments->AppendElement(a, false);
+    attachments->AppendElement(a);
   }
   attachments.forget(aArray);
   return rv;
 }
 
 bool CMapiMessage::GetEmbeddedAttachmentInfo(unsigned int i, nsIURI **uri,
                                              const char **cid,
                                              const char **name) const
--- a/mailnews/import/outlook/src/nsOutlookCompose.cpp
+++ b/mailnews/import/outlook/src/nsOutlookCompose.cpp
@@ -293,17 +293,17 @@ nsresult nsOutlookCompose::ComposeTheMes
       if (msg.GetEmbeddedAttachmentInfo(i, &uri, &cid, &name)) {
         if (!embeddedObjects) {
           embeddedObjects = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
           NS_ENSURE_SUCCESS(rv, rv);
         }
         nsCOMPtr<nsIMsgEmbeddedImageData> imageData =
           new nsImportEmbeddedImageData(uri, nsDependentCString(cid),
                                      nsDependentCString(name));
-        embeddedObjects->AppendElement(imageData, false);
+        embeddedObjects->AppendElement(imageData);
       }
     }
   }
 
   nsCString bodyA;
   nsMsgI18NConvertFromUnicode(msg.GetBodyCharset(), bodyW, bodyA);
 
   nsCOMPtr<nsIImportService> impService(do_GetService(NS_IMPORTSERVICE_CONTRACTID, &rv));
--- a/mailnews/import/outlook/src/nsOutlookMail.cpp
+++ b/mailnews/import/outlook/src/nsOutlookMail.cpp
@@ -169,17 +169,17 @@ nsresult nsOutlookMail::GetMailFolders(n
       pID->SetDepth(pFolder->GetDepth());
       pID->SetIdentifier(i);
 
       pFolder->GetDisplayName(name);
       pID->SetDisplayName(name.get());
 
       pID->SetSize(1000);
       nsCOMPtr<nsISupports> pInterface(do_QueryInterface(pID));
-      array->AppendElement(pInterface, false);
+      array->AppendElement(pInterface);
     }
   }
   array.forget(pArray);
   return NS_OK;
 }
 
 bool nsOutlookMail::IsAddressBookNameUnique(nsString& name, nsString& list)
 {
@@ -268,17 +268,17 @@ nsresult nsOutlookMail::GetAddressBooks(
       rv = impSvc->CreateNewABDescriptor(getter_AddRefs(pID));
       if (NS_SUCCEEDED(rv)) {
         pID->SetIdentifier(i);
         pFolder->GetDisplayName(name);
         MakeAddressBookNameUnique(name, list);
         pID->SetPreferredName(name);
         pID->SetSize(100);
         nsCOMPtr<nsISupports> pInterface(do_QueryInterface(pID));
-        array->AppendElement(pInterface, false);
+        array->AppendElement(pInterface);
       }
     }
   }
   array.forget(pArray);
   return NS_OK;
 }
 
 void nsOutlookMail::OpenMessageStore(CMapiFolder *pNextFolder)
--- a/mailnews/import/text/src/nsTextImport.cpp
+++ b/mailnews/import/text/src/nsTextImport.cpp
@@ -303,17 +303,17 @@ NS_IMETHODIMP ImportAddressImpl::FindAdd
   rv = impSvc->CreateNewABDescriptor(getter_AddRefs(desc));
   if (NS_SUCCEEDED(rv)) {
     int64_t sz = 0;
     pLoc->GetFileSize(&sz);
     desc->SetPreferredName(name);
     desc->SetSize((uint32_t) sz);
     desc->SetAbFile(m_fileLoc);
     nsCOMPtr<nsISupports> pInterface(do_QueryInterface(desc));
-    array->AppendElement(pInterface, false);
+    array->AppendElement(pInterface);
   }
   if (NS_FAILED(rv)) {
     IMPORT_LOG0("*** Error creating address book descriptor for text import\n");
     return rv;
   }
   array.forget(ppArray);
   return NS_OK;
 }
--- a/mailnews/import/vcard/src/nsVCardImport.cpp
+++ b/mailnews/import/vcard/src/nsVCardImport.cpp
@@ -261,17 +261,17 @@ NS_IMETHODIMP ImportVCardAddressImpl::Fi
   rv = impSvc->CreateNewABDescriptor(getter_AddRefs(desc));
   if (NS_SUCCEEDED(rv)) {
     int64_t sz = 0;
     pLoc->GetFileSize(&sz);
     desc->SetPreferredName(name);
     desc->SetSize((uint32_t) sz);
     desc->SetAbFile(m_fileLoc);
     nsCOMPtr<nsISupports> pInterface(do_QueryInterface(desc, &rv));
-    array->AppendElement(pInterface, false);
+    array->AppendElement(pInterface);
   }
   if (NS_FAILED(rv)) {
     IMPORT_LOG0(
         "*** Error creating address book descriptor for vCard import\n");
     return rv;
   }
 
   array.forget(ppArray);
--- a/mailnews/local/src/nsLocalMailFolder.cpp
+++ b/mailnews/local/src/nsLocalMailFolder.cpp
@@ -611,17 +611,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::Comp
 
       expungedBytes = 0;
       if (folder)
         rv = folder->GetExpungedBytes(&expungedBytes);
 
       NS_ENSURE_SUCCESS(rv, rv);
 
       if (expungedBytes > 0)
-        rv = folderArray->AppendElement(folder, false);
+        rv = folderArray->AppendElement(folder);
     }
     rv = folderArray->GetLength(&cnt);
     NS_ENSURE_SUCCESS(rv,rv);
     if (cnt == 0)
       return NotifyCompactCompleted();
   }
   nsCOMPtr <nsIMsgFolderCompactor> folderCompactor =  do_CreateInstance(NS_MSGLOCALFOLDERCOMPACTOR_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1269,17 +1269,17 @@ nsMsgLocalMailFolder::AddMessageDisposit
   nsresult rv = nsMsgDBFolder::AddMessageDispositionState(aMessage, aDispositionFlag);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsCOMPtr<nsIMsgPluggableStore> msgStore;
   rv = GetMsgStore(getter_AddRefs(msgStore));
   NS_ENSURE_SUCCESS(rv, rv);
   nsCOMPtr<nsIMutableArray> messages(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
   NS_ENSURE_SUCCESS(rv, rv);
-  messages->AppendElement(aMessage, false);
+  messages->AppendElement(aMessage);
   return msgStore->ChangeFlags(messages, msgFlag, true);
 }
 
 NS_IMETHODIMP
 nsMsgLocalMailFolder::MarkMessagesRead(nsIArray *aMessages, bool aMarkRead)
 {
   nsresult rv = nsMsgDBFolder::MarkMessagesRead(aMessages, aMarkRead);
   NS_ENSURE_SUCCESS(rv, rv);
@@ -1458,17 +1458,17 @@ nsMsgLocalMailFolder::OnCopyCompleted(ns
   if (NS_SUCCEEDED(rv) && haveSemaphore)
     ReleaseSemaphore(static_cast<nsIMsgLocalMailFolder*>(this));
 
   if (mCopyState && !mCopyState->m_newMsgKeywords.IsEmpty() &&
       mCopyState->m_newHdr)
   {
     nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
     NS_ENSURE_TRUE(messageArray, rv);
-    messageArray->AppendElement(mCopyState->m_newHdr, false);
+    messageArray->AppendElement(mCopyState->m_newHdr);
     AddKeywordsToMessages(messageArray, mCopyState->m_newMsgKeywords);
   }
   if (moveCopySucceeded && mDatabase)
   {
     mDatabase->SetSummaryValid(true);
     (void) CloseDBIfFolderNotOpen();
   }
 
@@ -1739,17 +1739,17 @@ nsMsgLocalMailFolder::CopyFolderAcrossSe
 
   if (messages)
     rv = messages->HasMoreElements(&hasMoreElements);
 
   while (NS_SUCCEEDED(rv) && hasMoreElements)
   {
     rv = messages->GetNext(getter_AddRefs(aSupport));
     NS_ENSURE_SUCCESS(rv, rv);
-    rv = msgArray->AppendElement(aSupport, false);
+    rv = msgArray->AppendElement(aSupport);
     NS_ENSURE_SUCCESS(rv, rv);
     rv = messages->HasMoreElements(&hasMoreElements);
   }
 
   uint32_t numMsgs=0;
   msgArray->GetLength(&numMsgs);
 
   if (numMsgs > 0 )   //if only srcFolder has messages..
@@ -1914,17 +1914,17 @@ nsMsgLocalMailFolder::CopyFileMessage(ns
 
   aFile->GetFileSize(&fileSize);
   if (!CheckIfSpaceForCopy(msgWindow, nullptr, fileSupport, false, fileSize))
     return NS_OK;
 
   nsCOMPtr<nsIMutableArray> messages(do_CreateInstance(NS_ARRAY_CONTRACTID));
 
   if (msgToReplace)
-    messages->AppendElement(msgToReplace, false);
+    messages->AppendElement(msgToReplace);
 
   rv = InitCopyState(fileSupport, messages, msgToReplace ? true : false,
                      listener, msgWindow, false, false);
   if (NS_SUCCEEDED(rv))
   {
     if (mCopyState)
       mCopyState->m_newMsgKeywords = aNewMsgKeywords;
 
@@ -2425,17 +2425,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::EndC
           mCopyState->m_message, true,
           getter_AddRefs(newHdr));
         }
         uint32_t newHdrFlags;
         if (newHdr)
         {
           // turn off offline flag - it's not valid for local mail folders.
           newHdr->AndFlags(~nsMsgMessageFlags::Offline, &newHdrFlags);
-          mCopyState->m_destMessages->AppendElement(newHdr, false);
+          mCopyState->m_destMessages->AppendElement(newHdr);
         }
       }
       // we can do undo with the dest folder db, see bug #198909
       //else
       //  mCopyState->m_undoMsgTxn = nullptr; //null out the transaction because we can't undo w/o the msg db
     }
 
     // if we plan on allowing undo, (if we have a mCopyState->m_parseMsgState or not)
@@ -2496,17 +2496,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::EndC
         {
           // ** jt - recording the message size for possible undo use; the
           // message size is different for pop3 and imap4 messages
           uint32_t msgSize;
           newHdr->GetMessageSize(&msgSize);
           localUndoTxn->AddDstMsgSize(msgSize);
         }
 
-        mCopyState->m_destMessages->AppendElement(newHdr, false);
+        mCopyState->m_destMessages->AppendElement(newHdr);
       }
       // msgDb->SetSummaryValid(true);
       // msgDb->Commit(nsMsgDBCommitType::kLargeCommit);
     }
     else
       mCopyState->m_undoMsgTxn = nullptr; //null out the transaction because we can't undo w/o the msg db
 
     mCopyState->m_parseMsgState->Clear();
@@ -2579,17 +2579,17 @@ NS_IMETHODIMP nsMsgLocalMailFolder::EndC
       nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
       if (notifier)
       {
         notifier->NotifyMsgAdded(newHdr);
         // We do not appear to trigger classification in this case, so let's
         // paper over the abyss by just sending the classification notification.
         nsCOMPtr <nsIMutableArray> oneHeaderArray =
           do_CreateInstance(NS_ARRAY_CONTRACTID);
-        oneHeaderArray->AppendElement(newHdr, false);
+        oneHeaderArray->AppendElement(newHdr);
         notifier->NotifyMsgsClassified(oneHeaderArray, false, false);
         // (We do not add the NotReportedClassified processing flag since we
         // just reported it!)
       }
     }
   }
   return rv;
 }
@@ -3543,17 +3543,17 @@ nsMsgLocalMailFolder::OnMessageClassifie
         nsMsgKey msgKey = mSpamKeysToMove.ElementAt(keyIndex);
         nsMsgProcessingFlagType processingFlags;
         GetProcessingFlags(msgKey, &processingFlags);
         if (folder && !(processingFlags & nsMsgProcessingFlags::FilterToMove))
         {
           nsCOMPtr<nsIMsgDBHdr> mailHdr;
           rv = GetMessageHeader(msgKey, getter_AddRefs(mailHdr));
           if (NS_SUCCEEDED(rv) && mailHdr)
-            messages->AppendElement(mailHdr, false);
+            messages->AppendElement(mailHdr);
         }
         else
         {
           // We don't need the processing flag any more.
           AndProcessingFlags(msgKey, ~nsMsgProcessingFlags::FilterToMove);
         }
       }
 
@@ -3732,17 +3732,17 @@ nsMsgLocalMailFolder::AddMessageBatch(ui
       outFileStream->Write(aMessages[i], messageLen, &bytesWritten);
       newMailParser->BufferInput(aMessages[i], messageLen);
 
       msgStore->FinishNewMessage(outFileStream, newHdr);
       outFileStream->Close();
       outFileStream = nullptr;
       newMailParser->OnStopRequest(nullptr, nullptr, NS_OK);
       newMailParser->EndMsgDownload();
-      hdrArray->AppendElement(newHdr, false);
+      hdrArray->AppendElement(newHdr);
     }
     hdrArray.forget(aHdrArray);
   }
   ReleaseSemaphore(static_cast<nsIMsgLocalMailFolder*>(this));
   return rv;
 }
 
 NS_IMETHODIMP
--- a/mailnews/local/src/nsLocalUndoTxn.cpp
+++ b/mailnews/local/src/nsLocalUndoTxn.cpp
@@ -257,19 +257,19 @@ nsLocalMoveCopyMsgTxn::UndoTransactionIn
                                              oldHdr, true,
                                              getter_AddRefs(newHdr));
           NS_ASSERTION(newHdr,
                        "fatal ... cannot create new msg header\n");
           if (NS_SUCCEEDED(rv) && newHdr)
           {
             newHdr->SetStatusOffset(m_srcStatusOffsetArray[i]);
             srcDB->UndoDelete(newHdr);
-            srcMessages->AppendElement(newHdr, false);
+            srcMessages->AppendElement(newHdr);
             // (we want to keep these two lists in sync)
-            dstMessages->AppendElement(oldHdr, false);
+            dstMessages->AppendElement(oldHdr);
           }
         }
       }
 
       nsCOMPtr<nsIMsgFolderNotificationService>
         notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
       if (notifier)
       {
@@ -296,17 +296,17 @@ nsLocalMoveCopyMsgTxn::UndoTransactionIn
         dstDB->ContainsKey(m_dstKeyArray[i], &hasKey);
         nsCOMPtr<nsIMsgDBHdr> dstHdr;
         if (hasKey)
           dstDB->GetMsgHdrForKey(m_dstKeyArray[i], getter_AddRefs(dstHdr));
         if (dstHdr)
         {
           nsCString messageId;
           dstHdr->GetMessageId(getter_Copies(messageId));
-          dstMessages->AppendElement(dstHdr, false);
+          dstMessages->AppendElement(dstHdr);
           m_copiedMsgIds.AppendElement(messageId);
         }
         else
         {
           NS_WARNING("Cannot get old msg header");
         }
       }
       if (m_copiedMsgIds.Length())
@@ -362,17 +362,17 @@ nsLocalMoveCopyMsgTxn::RedoTransaction()
   {
     rv = srcDB->GetMsgHdrForKey(m_srcKeyArray[i],
                                 getter_AddRefs(oldHdr));
     NS_ASSERTION(oldHdr, "fatal ... cannot get old msg header\n");
 
     if (NS_SUCCEEDED(rv) && oldHdr)
     {
       msgSupports =do_QueryInterface(oldHdr);
-      srcMessages->AppendElement(msgSupports, false);
+      srcMessages->AppendElement(msgSupports);
 
       if (m_canUndelete)
       {
       rv = dstDB->CopyHdrFromExistingHdr(m_dstKeyArray[i],
                                          oldHdr, true,
                                          getter_AddRefs(newHdr));
       NS_ASSERTION(newHdr, "fatal ... cannot get new msg header\n");
       if (NS_SUCCEEDED(rv) && newHdr)
--- a/mailnews/local/src/nsMsgMaildirStore.cpp
+++ b/mailnews/local/src/nsMsgMaildirStore.cpp
@@ -1088,17 +1088,17 @@ nsMsgMaildirStore::CopyMessages(bool aIs
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIMsgDBHdr> destHdr;
     if (destDB)
     {
       rv = destDB->CopyHdrFromExistingHdr(nsMsgKey_None, srcHdr, true, getter_AddRefs(destHdr));
       NS_ENSURE_SUCCESS(rv, rv);
       destHdr->SetStringProperty("storeToken", fileName.get());
-      dstHdrs->AppendElement(destHdr, false);
+      dstHdrs->AppendElement(destHdr);
       nsMsgKey dstKey;
       destHdr->GetMessageKey(&dstKey);
       msgTxn->AddDstKey(dstKey);
       if (aListener)
         aListener->SetMessageKey(dstKey);
     }
   }
   nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
--- a/mailnews/local/src/nsParseMailbox.cpp
+++ b/mailnews/local/src/nsParseMailbox.cpp
@@ -2095,17 +2095,17 @@ NS_IMETHODIMP nsParseNewMailState::Apply
         case nsMsgFilterAction::CopyToFolder:
         {
           nsCString uri;
           rv = m_rootFolder->GetURI(uri);
 
           if (!actionTargetFolderUri.IsEmpty() && !actionTargetFolderUri.Equals(uri))
           {
             nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
-            messageArray->AppendElement(msgHdr, false);
+            messageArray->AppendElement(msgHdr);
 
             nsCOMPtr<nsIMsgFolder> dstFolder;
             nsCOMPtr<nsIMsgCopyService> copyService;
             rv = GetExistingFolder(actionTargetFolderUri,
                                    getter_AddRefs(dstFolder));
             if (NS_SUCCEEDED(rv)) {
               copyService = do_GetService(NS_MSGCOPYSERVICE_CONTRACTID, &rv);
             }
@@ -2143,31 +2143,31 @@ NS_IMETHODIMP nsParseNewMailState::Apply
         msgHdr->OrFlags(nsMsgMessageFlags::Ignored, &newFlags);
         break;
       case nsMsgFilterAction::WatchThread:
         msgHdr->OrFlags(nsMsgMessageFlags::Watched, &newFlags);
         break;
       case nsMsgFilterAction::MarkFlagged:
         {
           nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
-          messageArray->AppendElement(msgHdr, false);
+          messageArray->AppendElement(msgHdr);
           m_downloadFolder->MarkMessagesFlagged(messageArray, true);
         }
         break;
       case nsMsgFilterAction::ChangePriority:
         nsMsgPriorityValue filterPriority;
         filterAction->GetPriority(&filterPriority);
         msgHdr->SetPriority(filterPriority);
         break;
       case nsMsgFilterAction::AddTag:
       {
         nsCString keyword;
         filterAction->GetStrValue(keyword);
         nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
-        messageArray->AppendElement(msgHdr, false);
+        messageArray->AppendElement(msgHdr);
         m_downloadFolder->AddKeywordsToMessages(messageArray, keyword);
         break;
       }
       case nsMsgFilterAction::Label:
         nsMsgLabelValue filterLabel;
         filterAction->GetLabel(&filterLabel);
         nsMsgKey msgKey;
         msgHdr->GetMessageKey(&msgKey);
@@ -2211,17 +2211,17 @@ NS_IMETHODIMP nsParseNewMailState::Apply
           nsCOMPtr <nsIMsgFolder> downloadFolder;
           msgHdr->GetFolder(getter_AddRefs(downloadFolder));
           nsCOMPtr <nsIMsgLocalMailFolder> localFolder = do_QueryInterface(downloadFolder);
           msgHdr->GetFlags(&flags);
           if (localFolder)
           {
             nsCOMPtr<nsIMutableArray> messages = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
             NS_ENSURE_SUCCESS(rv, rv);
-            messages->AppendElement(msgHdr, false);
+            messages->AppendElement(msgHdr);
             // This action ignores the deleteMailLeftOnServer preference
             localFolder->MarkMsgsOnPop3Server(messages, POP3_FORCE_DEL);
 
             // If this is just a header, throw it away. It's useless now
             // that the server copy is being deleted.
             if (flags & nsMsgMessageFlags::Partial)
             {
               m_msgMovedByFilter = true;
@@ -2236,17 +2236,17 @@ NS_IMETHODIMP nsParseNewMailState::Apply
           nsCOMPtr <nsIMsgFolder> downloadFolder;
           msgHdr->GetFolder(getter_AddRefs(downloadFolder));
           nsCOMPtr <nsIMsgLocalMailFolder> localFolder = do_QueryInterface(downloadFolder);
           msgHdr->GetFlags(&flags);
           if (localFolder && (flags & nsMsgMessageFlags::Partial))
           {
             nsCOMPtr<nsIMutableArray> messages = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
             NS_ENSURE_SUCCESS(rv, rv);
-            messages->AppendElement(msgHdr, false);
+            messages->AppendElement(msgHdr);
             localFolder->MarkMsgsOnPop3Server(messages, POP3_FETCH_BODY);
             // Don't add this header to the DB, we're going to replace it
             // with the full message.
             m_msgMovedByFilter = true;
             msgIsNew = false;
             // Don't do anything else in this filter, wait until we
             // have the full message.
             *applyMore = false;
@@ -2269,17 +2269,17 @@ NS_IMETHODIMP nsParseNewMailState::Apply
 
         nsAutoCString value;
         filterAction->GetStrValue(value);
 
         nsCOMPtr<nsIMutableArray> messageArray(
             do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
         NS_ENSURE_TRUE(messageArray, rv);
         if (NS_SUCCEEDED(rv))
-          rv = messageArray->AppendElement(msgHdr, false);
+          rv = messageArray->AppendElement(msgHdr);
 
 
         if (NS_SUCCEEDED(rv))
           rv = customAction->Apply(messageArray, value, nullptr,
                                    nsMsgFilterType::InboxRule, msgWindow);
         if (NS_FAILED(rv)) {
             // XXX: Invoke MSG_LOG_TO_CONSOLE once bug 1135265 lands.
             if (loggingEnabled)
@@ -2366,17 +2366,17 @@ nsresult nsParseNewMailState::ApplyForwa
   m_replyTemplateUri.Clear();
   m_msgToForwardOrReply = nullptr;
   return rv;
 }
 
 void nsParseNewMailState::MarkFilteredMessageRead(nsIMsgDBHdr *msgHdr)
 {
   nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
-  messageArray->AppendElement(msgHdr, false);
+  messageArray->AppendElement(msgHdr);
   m_downloadFolder->MarkMessagesRead(messageArray, true);
 }
 
 void nsParseNewMailState::MarkFilteredMessageUnread(nsIMsgDBHdr *msgHdr)
 {
   uint32_t newFlags;
   if (m_mailDB)
   {
@@ -2384,17 +2384,17 @@ void nsParseNewMailState::MarkFilteredMe
     msgHdr->GetMessageKey(&msgKey);
     m_mailDB->AddToNewList(msgKey);
   }
   else
   {
     msgHdr->OrFlags(nsMsgMessageFlags::New, &newFlags);
   }
   nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
-  messageArray->AppendElement(msgHdr, false);
+  messageArray->AppendElement(msgHdr);
   m_downloadFolder->MarkMessagesRead(messageArray, false);
 }
 
 nsresult nsParseNewMailState::EndMsgDownload()
 {
   if (m_moveCoalescer)
     m_moveCoalescer->PlaybackMoves();
 
--- a/mailnews/news/src/nsNNTPNewsgroupList.cpp
+++ b/mailnews/news/src/nsNNTPNewsgroupList.cpp
@@ -689,17 +689,17 @@ NS_IMETHODIMP nsNNTPNewsgroupList::Apply
           m_newMsgHdr->SetPriority(filterPriority);
         }
         break;
       case nsMsgFilterAction::AddTag:
       {
         nsCString keyword;
         filterAction->GetStrValue(keyword);
         nsCOMPtr<nsIMutableArray> messageArray(do_CreateInstance(NS_ARRAY_CONTRACTID));
-        messageArray->AppendElement(m_newMsgHdr, false);
+        messageArray->AppendElement(m_newMsgHdr);
         nsCOMPtr <nsIMsgFolder> folder = do_QueryInterface(m_newsFolder, &rv);
         if (folder)
           folder->AddKeywordsToMessages(messageArray, keyword);
         break;
       }
       case nsMsgFilterAction::Label:
         {
           nsMsgLabelValue filterLabel;
@@ -724,17 +724,17 @@ NS_IMETHODIMP nsNNTPNewsgroupList::Apply
         NS_ENSURE_SUCCESS(rv, rv);
 
         nsAutoCString value;
         filterAction->GetStrValue(value);
 
         nsCOMPtr<nsIMutableArray> messageArray(
             do_CreateInstance(NS_ARRAY_CONTRACTID, &rv));
         NS_ENSURE_TRUE(messageArray, rv);
-        messageArray->AppendElement(m_newMsgHdr, false);
+        messageArray->AppendElement(m_newMsgHdr);
 
         customAction->Apply(messageArray, value, nullptr,
                             nsMsgFilterType::NewsRule, aMsgWindow);
       }
       break;
 
       default:
         NS_ERROR("unexpected action");
--- a/mailnews/news/src/nsNewsFolder.cpp
+++ b/mailnews/news/src/nsNewsFolder.cpp
@@ -1532,17 +1532,17 @@ NS_IMETHODIMP nsMsgNewsFolder::RemoveMes
   nsCOMPtr<nsIMsgFolderNotificationService> notifier(do_GetService(NS_MSGNOTIFICATIONSERVICE_CONTRACTID));
   if (notifier)
   {
     nsCOMPtr<nsIMsgDBHdr> msgHdr;
     rv = mDatabase->GetMsgHdrForKey(key, getter_AddRefs(msgHdr));
     NS_ENSURE_SUCCESS(rv, rv);
 
     nsCOMPtr<nsIMutableArray> msgHdrs(do_CreateInstance(NS_ARRAY_CONTRACTID));
-    msgHdrs->AppendElement(msgHdr, false);
+    msgHdrs->AppendElement(msgHdr);
 
     notifier->NotifyMsgsDeleted(msgHdrs);
   }
   return mDatabase->DeleteMessage(key, nullptr, false);
 }
 
 NS_IMETHODIMP nsMsgNewsFolder::RemoveMessages(nsTArray<nsMsgKey> &aMsgKeys)
 {
--- a/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
+++ b/suite/profile/migration/src/nsNetscapeProfileMigratorBase.cpp
@@ -385,23 +385,23 @@ nsNetscapeProfileMigratorBase::GetProfil
       rv = rootDir->SetPersistentDescriptor(filePath);
 
     if (NS_FAILED(rv)) continue;
 
     bool exists;
     rootDir->Exists(&exists);
 
     if (exists) {
-      aProfileLocations->AppendElement(rootDir, false);
+      aProfileLocations->AppendElement(rootDir);
 
       nsCOMPtr<nsISupportsString> profileNameString(
         do_CreateInstance("@mozilla.org/supports-string;1"));
 
       profileNameString->SetData(NS_ConvertUTF8toUTF16(buffer));
-      aProfileNames->AppendElement(profileNameString, false);
+      aProfileNames->AppendElement(profileNameString);
     }
   }
   return NS_OK;
 }
 
 nsresult
 nsNetscapeProfileMigratorBase::CopyFile(const char* aSourceFileName,
                                         const char* aTargetFileName)