Version: 1.5.7 (using KDE KDE 3.5.7) Installed from: Fedora RPMs OS: Linux I have this old XMI file from January 2006, written last time by Umbrello 1.5. Umbrello 1.5.7 can read it, but when I save the file from Umbrello 1.5.7 and loads it into Umbrello 1.5.7 again, Umbrello crashes. The thing prevents me from continuing my work. All I really want is to have the XMI file readable by 1.5.7 again. Backtrace: (no debugging symbols found) [KCrash handler] #6 0x008c719f in main_arena () from /lib/libc.so.6 #7 0x0816d01e in Model_Utils::findObjectInList () #8 0x0817e980 in UMLPackage::findObjectById () #9 0x081a0a16 in UMLDoc::findObjectById () #10 0x0814f377 in UMLFolder::load () #11 0x0814ef18 in UMLFolder::load () #12 0x081c86b8 in UMLObject::loadFromXMI () #13 0x081ae9ca in UMLDoc::loadUMLObjectsFromXMI () #14 0x081ae6d4 in UMLDoc::loadUMLObjectsFromXMI () #15 0x081b00af in UMLDoc::loadFromXMI () #16 0x081aa08a in UMLDoc::openDocument () #17 0x081953dd in UMLApp::openDocumentFile () #18 0x08167190 in initDocument () #19 0x08167750 in main ()
Created attachment 21179 [details] XMI file created by version 1.5 Open this file in Umbrello 1.5.7, click save, then open it again. It make Umbrello crash.
Confirm with SVN branches/KDE/3.5 of today.
Created attachment 21182 [details] corrected XMI file The problem was that apparently the older version generated conflicting xmi.id's for <UML:Association.connection> (i.e. UMLRole) items. I simply prefixed thse xmi.id's with "r" to make them unique.
The file saved by 1.5.71 now loads but there may still be more duplicated xmi.id's, please check.
SVN commit 690647 by okellogg: loadFromXMI(): If the xmi.id of an UMLRole is already in use then generate a new one. CCBUG:147988 M +1 -0 ChangeLog M +15 -3 umbrello/umlobject.cpp --- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #690646:690647 @@ -9,6 +9,7 @@ * Crash when changing the association type to containment (147202) * Moving component on diagram results in absurd shape of self-association (147810) * Crash when changing the attribute name (147919) +* Reads XMI exported by version 1.5 but crashes when rereading after saving (147988) Version 1.5.71 --- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlobject.cpp #690646:690647 @@ -565,6 +565,18 @@ } } else { m_nId = STR2ID(id); + if (m_BaseType == Uml::ot_Role) { + // Some older Umbrello versions had a problem with xmi.id's + // of other objects being reused for the UMLRole, see e.g. + // attachment 21179 [details] at http://bugs.kde.org/147988 . + // If the xmi.id is already being used then we generate a new one. + UMLObject *o = umldoc->findObjectById(m_nId); + if (o) { + kDebug() << "loadFromXMI(UMLRole): id " << id + << " is already in use, generating a new one." << endl; + m_nId = UniqueID::gen(); + } + } } if (element.hasAttribute("documentation")) // for bkwd compat. @@ -647,11 +659,11 @@ if (vis.isEmpty()) vis = elem.text(); if (vis == "private" || vis == "private_vis") - m_Vis = Uml::Visibility::Private; + m_Vis = Uml::Visibility::Private; else if (vis == "protected" || vis == "protected_vis") - m_Vis = Uml::Visibility::Protected; + m_Vis = Uml::Visibility::Protected; else if (vis == "implementation") - m_Vis = Uml::Visibility::Implementation; + m_Vis = Uml::Visibility::Implementation; } else if (Uml::tagEq(tag, "isAbstract")) { QString isAbstract = elem.attribute("xmi.value", ""); if (isAbstract.isEmpty())