qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kgiu...@apache.org
Subject svn commit: r1211660 - /qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp
Date Wed, 07 Dec 2011 21:55:13 GMT
Author: kgiusti
Date: Wed Dec  7 21:55:13 2011
New Revision: 1211660

URL: http://svn.apache.org/viewvc?rev=1211660&view=rev
Log:
QPID-3666: replace both the index and the value when updating duplicate objects

Modified:
    qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp?rev=1211660&r1=1211659&r2=1211660&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/management/ManagementAgent.cpp Wed Dec  7 21:55:13 2011
@@ -684,7 +684,7 @@ void ManagementAgent::moveNewObjectsLH()
             ManagementObjectMap::iterator destIter = managementObjects.find(oid);
             if (destIter != managementObjects.end()) {
                 // duplicate found.  It is OK if the old object has been marked
-                // deleted...
+                // deleted, just replace the old with the new.
                 ManagementObject *oldObj = destIter->second;
                 if (oldObj->isDeleted()) {
                     DeletedObject::shared_ptr dptr(new DeletedObject(oldObj, qmf1Support,
qmf2Support));
@@ -696,6 +696,10 @@ void ManagementAgent::moveNewObjectsLH()
                     // and complain loudly...
                     QPID_LOG(error, "Detected two management objects with the same identifier:
" << oid);
                 }
+                // QPID-3666: be sure to replace the -index- also, as non-key members of
+                // the index object may be different for the new object!  So erase the
+                // entry, rather than []= assign here:
+                managementObjects.erase(destIter);
             }
             managementObjects[oid] = object;
         }



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message