[Uml-devel] [Bug 144924] XMI file contains massive duplications of <UML:Stereotype>

Oliver Kellogg okellogg at users.sourceforge.net
Thu May 10 05:39:01 UTC 2007


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=144924         




------- Additional Comments From okellogg users sourceforge net  2007-05-10 07:38 -------
SVN commit 663112 by okellogg:

UMLDoc::saveToXMI(): While I haven't been able to find the cause of the bug,
as a workaround check against the duplicated entries in m_stereoList on saving.
CCBUG:144924


 M  +14 -1     umldoc.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umldoc.cpp #663111:663112
 @ -1287,8 +1287,21  @
 
     // Save stereotypes and toplevel datatypes first so that upon loading
     // they are known first.
+    // There is a bug causing duplication of the same stereotype in m_stereoList.
+    // As a workaround, we use a string list to memorize which stereotype has been saved.
+    QStringList stereoNames;
+    QValueList<Uml::IDType> stereoIDs;
     for (UMLStereotype *s = m_stereoList.first(); s; s = m_stereoList.next() ) {
-        s->saveToXMI(doc, ownedNS);
+        QString stName = s->getName();
+        Uml::IDType stID = s->getID();
+        if (!stereoNames.contains(stName) && !stereoIDs.contains(stID)) {
+            s->saveToXMI(doc, ownedNS);
+            stereoNames.append(stName);
+            stereoIDs.append(stID);
+        } else {
+            kDebug() << "UMLDoc::saveToXMI: encountered duplicated stereotype "
+                << stName << " (id " << ID2STR(stID) << "), see bug 144924" << endl;
+        }
     }
     for (int i = 0; i < Uml::N_MODELTYPES; i++) {
         m_root[i]->saveToXMI(doc, ownedNS);




More information about the umbrello-devel mailing list