Bug 144924 - Umbrello creates massive duplications of UMLStereotype <<folder>> et al. internally
Summary: Umbrello creates massive duplications of UMLStereotype <<folder>> et al. inte...
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-01 16:29 UTC by Baldo Davide
Modified: 2022-02-15 15:10 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Baldo Davide 2007-05-01 16:29:57 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Gentoo Packages
Compiler:          gcc version 4.1.1, Target: i686-pc-linux-gnu 
OS:                Linux

There is always a clear overuse of cpu when I open a file or when I move something on the 'class diagram', please do something, it took me over 20 seconds for open a file or undo a change.

My cpu is: AMD Athlon(TM) XP 2600+
gcc flags: -O2 -march=athlon-xp -pipe -fomit-frame-pointer
Comment 1 Oliver Kellogg 2007-05-01 19:41:52 UTC
1) Please update to 1.5.7-beta1, this bug has been fixed.

2) In your XMI files, you will see massive repetitions of lines like this:

<UML:Stereotype isSpecification="false" isLeaf="false" visibility="public" namespace="m1" xmi.id="2" isRoot="false" isAbstract="false" name="folder" />

In a text editor, remove all the duplicated <UML:Stereotype>s for "folder".
Comment 2 Oliver Kellogg 2007-05-10 07:33:30 UTC
> 1) Please update to 1.5.7-beta1, this bug has been fixed.

Unfortunately, I again was too quick closing this PR.
After working on a model for a while, I found that the duplicated
<UML:Stereotype>s are still present in branches/KDE/3.5/kdesdk r663030.
Comment 3 Oliver Kellogg 2007-05-10 07:38:59 UTC
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);
Comment 4 Oliver Kellogg 2007-05-10 07:43:19 UTC
Ah. It looks as though the duplications have something to do with using "Undo".
To be further investigated.
Comment 5 Oliver Kellogg 2007-06-01 20:47:48 UTC
I am tempted to close this but will keep it open
since only the symptom is fixed, not the cause.
Comment 6 Justin Zobel 2021-03-09 07:00:32 UTC
Thank you for the bug report.

As this report hasn't seen any changes in 5 years or more, we ask if you can please confirm that the issue still persists.

If this bug is no longer persisting or relevant please change the status to resolved.
Comment 7 Oliver Kellogg 2022-02-15 15:10:45 UTC
(In reply to Oliver Kellogg from comment #5)
> I am tempted to close this but will keep it open
> since only the symptom is fixed, not the cause.

After years of use without problem, I hereby change my mind to "symptom fix is good enough".