Hi Matieu,
Yes, I've seen you created the issue - thanks. I'll try to look at it (when
the CVS-SVN conversion is over).
About the XMI files:
There are several ways to see the XMI representation of the UML model in
ArgoUML:
1. In the menu, use View -> XML Dump.
2. Save as XMI with the menu File -> Export XMI...
This gives a text file containing XML format.
3. Save the project as zargo file, rename to "name.zip" file, unpack with
your zip utility. This contains a file with ".xmi" extension.
Anyhow, you will see something like the extraction below.
Try this with a very small project, e.g. only one named package and one
class in it. This example will give:
<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' timestamp =
'Mon Sep 25 20:41:10 CEST 2006'>
<XMI.header> <XMI.documentation>
<XMI.exporter>ArgoUML (using Netbeans XMI Writer version
1.0)</XMI.exporter>
<XMI.exporterVersion>0.20.x</XMI.exporterVersion>
</XMI.documentation>
<XMI.metamodel xmi.name="UML" xmi.version="1.4"/></XMI.header>
<XMI.content>
<UML:Model xmi.id =
'10-0-0-9--26c19faa:10de6444d37:-8000:000000000000077B'
name = 'untitledModel' isSpecification = 'false' isRoot = 'false'
isLeaf = 'false'
isAbstract = 'false'>
<UML:Namespace.ownedElement>
<UML:Package xmi.id =
'10-0-0-9--26c19faa:10de6444d37:-8000:000000000000077C'
name = 'pack1' isSpecification = 'false' isRoot = 'false'
isLeaf = 'false'
isAbstract = 'false'>
<UML:Namespace.ownedElement>
<UML:Class xmi.id =
'10-0-0-9--26c19faa:10de6444d37:-8000:000000000000077D'
name = 'ClassA' visibility = 'public' isSpecification =
'false' isRoot = 'false'
isLeaf = 'false' isAbstract = 'false' isActive = 'false'/>
</UML:Namespace.ownedElement>
</UML:Package>
</UML:Namespace.ownedElement>
</UML:Model>
</XMI.content>
</XMI>
As you can see in the above: the Model has a Namespace with a Package in it:
<UML:Package name = 'pack1' ...>
The Namespace of the Package contains a Class:
<UML:Class name = 'ClassA' ...>
I hope this clarifies to you the way the UML model is stored/persisted!
Feel free to ask more.
Regards,
Michiel
----- Original Message -----
From: "Mathieu Suen" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, September 25, 2006 8:24 PM
Subject: Re: [argouml-dev] [BUG] When package name is empty an error occure
Michiel van der Wulp a écrit :
Hi Matieu,
When you generate a class that is in a package with an empty name it
raise a NullPointerException.
So I fix it in GeneratorJava but I think the best is to provide a
default value(empty string) to the
name of a package.
1. Your fix for the GeneratorJava is very welcome, but would you please
create an issue for this bug and attach a patch to it? Especially since
we are in transition from CVS to SVN now.
2. In the GeneratorJava code, you can not presume that every package has
a name, even if you create one in ArgoUML every time the user creates a
package.
This since the model data may also have been imported as XMI without a
name set, and we want to be able to export the same XMI, i.e. still
without name.
IIRC, then a class without name is ignored when generating code, i.e. it
does not appear in the UI for selection. You may extend this behaviour
to exclude the contents of unnamed packages... this is the best solution
IMHO.
PS: I checked the XMI file for an unnamed package containing an unnamed
class. And strangely enough, the class has a name = '' and the package
does not.
So, I presume that you may have a similar exception in generating code
when you import a handcrafted XMI in which you removed the name of a
class - this is something worth testing.
Regards,
Michiel
Thanks, I have made a report:
http://argouml.tigris.org/issues/show_bug.cgi?id=4460
I think NullPointerException are very bad. It should be avoid even if data
come out with empty tag.
But I don't know how you store your XMI.
Math
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le
sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et
vos expériences.
http://fr.answers.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.8/455 - Release Date: 22/09/2006
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.405 / Virus Database: 268.12.8/455 - Release Date: 22/09/2006
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]